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
Boxiang Sun
cython
Commits
676fc5f0
Commit
676fc5f0
authored
Nov 23, 2014
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve variable name
parent
26522db7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
Cython/Compiler/Parsing.py
Cython/Compiler/Parsing.py
+8
-8
No files found.
Cython/Compiler/Parsing.py
View file @
676fc5f0
...
@@ -790,7 +790,7 @@ def p_string_literal(s, kind_override=None):
...
@@ -790,7 +790,7 @@ def p_string_literal(s, kind_override=None):
pos
=
s
.
position
()
pos
=
s
.
position
()
is_raw
=
False
is_raw
=
False
is_python3_source
=
s
.
context
.
language_level
>=
3
is_python3_source
=
s
.
context
.
language_level
>=
3
has_non_
ASCII
_literal_characters
=
False
has_non_
ascii
_literal_characters
=
False
kind
=
s
.
systring
[:
1
].
lower
()
kind
=
s
.
systring
[:
1
].
lower
()
if
kind
==
'r'
:
if
kind
==
'r'
:
# Py3 allows both 'br' and 'rb' as prefix
# Py3 allows both 'br' and 'rb' as prefix
...
@@ -823,14 +823,14 @@ def p_string_literal(s, kind_override=None):
...
@@ -823,14 +823,14 @@ def p_string_literal(s, kind_override=None):
#print "p_string_literal: sy =", sy, repr(s.systring) ###
#print "p_string_literal: sy =", sy, repr(s.systring) ###
if
sy
==
'CHARS'
:
if
sy
==
'CHARS'
:
chars
.
append
(
systr
)
chars
.
append
(
systr
)
if
is_python3_source
and
not
has_non_
ASCII
_literal_characters
and
check_for_non_ascii_characters
(
systr
):
if
is_python3_source
and
not
has_non_
ascii
_literal_characters
and
check_for_non_ascii_characters
(
systr
):
has_non_
ASCII
_literal_characters
=
True
has_non_
ascii
_literal_characters
=
True
elif
sy
==
'ESCAPE'
:
elif
sy
==
'ESCAPE'
:
if
is_raw
:
if
is_raw
:
chars
.
append
(
systr
)
chars
.
append
(
systr
)
if
is_python3_source
and
not
has_non_
ASCII
_literal_characters
\
if
is_python3_source
and
not
has_non_
ascii
_literal_characters
\
and
check_for_non_ascii_characters
(
systr
):
and
check_for_non_ascii_characters
(
systr
):
has_non_
ASCII
_literal_characters
=
True
has_non_
ascii
_literal_characters
=
True
else
:
else
:
c
=
systr
[
1
]
c
=
systr
[
1
]
if
c
in
u"01234567"
:
if
c
in
u"01234567"
:
...
@@ -868,9 +868,9 @@ def p_string_literal(s, kind_override=None):
...
@@ -868,9 +868,9 @@ def p_string_literal(s, kind_override=None):
chars
.
append_uescape
(
chrval
,
systr
)
chars
.
append_uescape
(
chrval
,
systr
)
else
:
else
:
chars
.
append
(
u'
\
\
'
+
systr
[
1
:])
chars
.
append
(
u'
\
\
'
+
systr
[
1
:])
if
is_python3_source
and
not
has_non_
ASCII
_literal_characters
\
if
is_python3_source
and
not
has_non_
ascii
_literal_characters
\
and
check_for_non_ascii_characters
(
systr
):
and
check_for_non_ascii_characters
(
systr
):
has_non_
ASCII
_literal_characters
=
True
has_non_
ascii
_literal_characters
=
True
elif
sy
==
'NEWLINE'
:
elif
sy
==
'NEWLINE'
:
chars
.
append
(
u'
\
n
'
)
chars
.
append
(
u'
\
n
'
)
elif
sy
==
'END_STRING'
:
elif
sy
==
'END_STRING'
:
...
@@ -888,7 +888,7 @@ def p_string_literal(s, kind_override=None):
...
@@ -888,7 +888,7 @@ def p_string_literal(s, kind_override=None):
error
(
pos
,
u"invalid character literal: %r"
%
bytes_value
)
error
(
pos
,
u"invalid character literal: %r"
%
bytes_value
)
else
:
else
:
bytes_value
,
unicode_value
=
chars
.
getstrings
()
bytes_value
,
unicode_value
=
chars
.
getstrings
()
if
is_python3_source
and
has_non_
ASCII
_literal_characters
:
if
is_python3_source
and
has_non_
ascii
_literal_characters
:
# Python 3 forbids literal non-ASCII characters in byte strings
# Python 3 forbids literal non-ASCII characters in byte strings
if
kind
!=
'u'
:
if
kind
!=
'u'
:
s
.
error
(
"bytes can only contain ASCII literal characters."
,
s
.
error
(
"bytes can only contain ASCII literal characters."
,
...
...
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