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
4242799c
Commit
4242799c
authored
Jan 15, 2011
by
Vitja Makarov
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote branch 'upstream/master'
parents
7b515269
5692f740
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
50 additions
and
6 deletions
+50
-6
Cython/Compiler/Parsing.py
Cython/Compiler/Parsing.py
+11
-6
tests/errors/invalid_hex_escape0.pyx
tests/errors/invalid_hex_escape0.pyx
+6
-0
tests/errors/invalid_hex_escape1.pyx
tests/errors/invalid_hex_escape1.pyx
+6
-0
tests/errors/invalid_uescape.pyx
tests/errors/invalid_uescape.pyx
+6
-0
tests/errors/invalid_uescape0.pyx
tests/errors/invalid_uescape0.pyx
+6
-0
tests/errors/invalid_uescape2.pyx
tests/errors/invalid_uescape2.pyx
+6
-0
tests/run/strliterals.pyx
tests/run/strliterals.pyx
+9
-0
No files found.
Cython/Compiler/Parsing.py
View file @
4242799c
...
...
@@ -782,15 +782,20 @@ def p_string_literal(s, kind_override=None):
elif
c
==
u'
\
n
'
:
pass
elif
c
==
u'x'
:
chars
.
append_charval
(
int
(
systr
[
2
:],
16
)
)
if
len
(
systr
)
==
4
:
chars
.
append_charval
(
int
(
systr
[
2
:],
16
)
)
else
:
s
.
error
(
"Invalid hex escape '%s'"
%
systr
)
elif
c
in
u'Uu'
:
if
kind
in
(
'u'
,
''
):
chrval
=
int
(
systr
[
2
:],
16
)
if
chrval
>
1114111
:
# sys.maxunicode:
s
.
error
(
"Invalid unicode escape '%s'"
%
systr
,
pos
=
pos
)
if
len
(
systr
)
in
(
6
,
10
):
chrval
=
int
(
systr
[
2
:],
16
)
if
chrval
>
1114111
:
# sys.maxunicode:
s
.
error
(
"Invalid unicode escape '%s'"
%
systr
)
else
:
s
.
error
(
"Invalid unicode escape '%s'"
%
systr
)
else
:
# unicode escapes in
plain
byte strings are not unescaped
# unicode escapes in byte strings are not unescaped
chrval
=
None
chars
.
append_uescape
(
chrval
,
systr
)
else
:
...
...
tests/errors/invalid_hex_escape0.pyx
0 → 100644
View file @
4242799c
'
\
x
'
_ERRORS = '''
2:1: Invalid hex escape '
\
x
'
'''
tests/errors/invalid_hex_escape1.pyx
0 → 100644
View file @
4242799c
'
\
x
1
'
_ERRORS
=
'''
2:1: Invalid hex escape '
\
x
'
'''
tests/errors/invalid_uescape.pyx
0 → 100644
View file @
4242799c
u'
\
uXYZ
'
_ERRORS = '''
2:2: Invalid unicode escape '
\
u'
'''
tests/errors/invalid_uescape0.pyx
0 → 100644
View file @
4242799c
u'
\
u
'
_ERRORS = '''
2:2: Invalid unicode escape '
\
u'
'''
tests/errors/invalid_uescape2.pyx
0 → 100644
View file @
4242799c
u'
\
u
12
'
_ERRORS
=
'''
2:2: Invalid unicode escape '
\
u
'
'''
tests/run/strliterals.pyx
View file @
4242799c
...
...
@@ -125,6 +125,13 @@ __doc__ = ur"""
>>> len(uresc)
9
>>> bytes_uescape
b'\\u1234\\U12345678\\u\\u1\\u12\\uX'
>>> bytes_uescape == b'\\u1234\\U12345678\\u\\u1\\u12\\uX'
True
>>> len(bytes_uescape)
28
>>> newlines == "Aaa\n"
True
...
...
@@ -165,6 +172,8 @@ sresc = r'\12\'\"\\'
bresc
=
br'\12\'\"\\'
uresc
=
ur'\12\'\"\\'
bytes_uescape
=
b'
\
u1234
\
U12345678
\
u
\
u1
\
u
12
\
uX
'
newlines = "Aaa
\
n
"
# T640, long literals with escapes
...
...
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