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
Kirill Smelkov
cython
Commits
b2de02c5
Commit
b2de02c5
authored
Sep 29, 2020
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Declare "scanner.sy" as "unicode" string to optimise its usage.
parent
5e425df6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
+11
-11
Cython/Compiler/Parsing.py
Cython/Compiler/Parsing.py
+9
-9
Cython/Compiler/Scanning.pxd
Cython/Compiler/Scanning.pxd
+2
-2
No files found.
Cython/Compiler/Parsing.py
View file @
b2de02c5
...
...
@@ -2334,7 +2334,7 @@ def p_statement(s, ctx, first_statement = 0):
return
p_async_statement
(
s
,
ctx
,
decorators
)
elif
decorators
:
s
.
error
(
"Decorators can only be followed by functions or classes"
)
s
.
put_back
(
'IDENT'
,
ident_name
)
# re-insert original token
s
.
put_back
(
u
'IDENT'
,
ident_name
)
# re-insert original token
return
p_simple_statement_list
(
s
,
ctx
,
first_statement
=
first_statement
)
...
...
@@ -2556,13 +2556,13 @@ def p_c_simple_base_type(s, self_flag, nonempty, templates = None):
s
.
next
()
if
(
s
.
sy
==
'*'
or
s
.
sy
==
'**'
or
s
.
sy
==
'&'
or
(
s
.
sy
==
'IDENT'
and
s
.
systring
in
calling_convention_words
)):
s
.
put_back
(
'('
,
'('
)
s
.
put_back
(
u'('
,
u
'('
)
else
:
s
.
put_back
(
'('
,
'('
)
s
.
put_back
(
'IDENT'
,
name
)
s
.
put_back
(
u'('
,
u
'('
)
s
.
put_back
(
u
'IDENT'
,
name
)
name
=
None
elif
s
.
sy
not
in
(
'*'
,
'**'
,
'['
,
'&'
):
s
.
put_back
(
'IDENT'
,
name
)
s
.
put_back
(
u
'IDENT'
,
name
)
name
=
None
type_node
=
Nodes
.
CSimpleBaseTypeNode
(
pos
,
...
...
@@ -2703,10 +2703,10 @@ def looking_at_expr(s):
dotted_path
.
reverse
()
for
p
in
dotted_path
:
s
.
put_back
(
'IDENT'
,
p
)
s
.
put_back
(
'.'
,
'.'
)
s
.
put_back
(
u
'IDENT'
,
p
)
s
.
put_back
(
u'.'
,
u
'.'
)
s
.
put_back
(
'IDENT'
,
name
)
s
.
put_back
(
u
'IDENT'
,
name
)
return
not
is_type
and
saved
[
0
]
else
:
return
True
...
...
@@ -2720,7 +2720,7 @@ def looking_at_dotted_name(s):
name
=
s
.
systring
s
.
next
()
result
=
s
.
sy
==
'.'
s
.
put_back
(
'IDENT'
,
name
)
s
.
put_back
(
u
'IDENT'
,
name
)
return
result
else
:
return
0
...
...
Cython/Compiler/Scanning.pxd
View file @
b2de02c5
...
...
@@ -34,8 +34,8 @@ cdef class PyrexScanner(Scanner):
cdef
public
indentation_char
cdef
public
int
bracket_nesting_level
cdef
readonly
bint
async_enabled
cdef
public
sy
cdef
public
systring
cdef
public
unicode
sy
cdef
public
systring
# EncodedString
cdef
long
current_level
(
self
)
#cpdef commentline(self, text)
...
...
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