Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython
Commits
6f43f6d7
Commit
6f43f6d7
authored
Mar 22, 2016
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reject f-strings for parsed cnames
parent
08b0e6f1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
Cython/Compiler/Parsing.py
Cython/Compiler/Parsing.py
+11
-9
No files found.
Cython/Compiler/Parsing.py
View file @
6f43f6d7
...
...
@@ -835,16 +835,18 @@ def p_cat_string_literal(s):
def
p_opt_string_literal
(
s
,
required_type
=
'u'
):
if
s
.
sy
==
'BEGIN_STRING'
:
kind
,
bytes_value
,
unicode_value
=
p_string_literal
(
s
,
required_type
)
if
required_type
==
'u'
:
return
unicode_value
elif
required_type
==
'b'
:
return
bytes_value
else
:
s
.
error
(
"internal parser configuration error"
)
else
:
if
s
.
sy
!=
'BEGIN_STRING'
:
return
None
pos
=
s
.
position
()
kind
,
bytes_value
,
unicode_value
=
p_string_literal
(
s
,
required_type
)
if
required_type
==
'u'
:
if
kind
==
'f'
:
s
.
error
(
"f-string not allowed here"
,
pos
)
return
unicode_value
elif
required_type
==
'b'
:
return
bytes_value
else
:
s
.
error
(
"internal parser configuration error"
)
def
check_for_non_ascii_characters
(
string
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment