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
c6d8607a
Commit
c6d8607a
authored
Dec 05, 2010
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
string literal parsing
parent
fb0c4369
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
16 deletions
+16
-16
Cython/Build/Dependencies.py
Cython/Build/Dependencies.py
+16
-16
No files found.
Cython/Build/Dependencies.py
View file @
c6d8607a
...
@@ -161,23 +161,8 @@ def strip_string_literals(code, prefix='__Pyx_L'):
...
@@ -161,23 +161,8 @@ def strip_string_literals(code, prefix='__Pyx_L'):
q
=
min
(
single_q
,
double_q
)
q
=
min
(
single_q
,
double_q
)
if
q
==
-
1
:
q
=
max
(
single_q
,
double_q
)
if
q
==
-
1
:
q
=
max
(
single_q
,
double_q
)
# Process comment.
if
-
1
<
hash_mark
and
(
hash_mark
<
q
or
q
==
-
1
):
end
=
code
.
find
(
'
\
n
'
,
hash_mark
)
if
end
==
-
1
:
end
=
None
new_code
.
append
(
code
[
start
:
hash_mark
+
1
])
counter
+=
1
label
=
"%s%s"
%
(
prefix
,
counter
)
literals
[
label
]
=
code
[
hash_mark
+
1
:
end
]
new_code
.
append
(
label
)
if
end
is
None
:
break
q
=
end
start
=
q
# We're done.
# We're done.
elif
q
==
-
1
:
if
q
==
-
1
and
hash_mark
==
-
1
:
new_code
.
append
(
code
[
start
:])
new_code
.
append
(
code
[
start
:])
break
break
...
@@ -200,6 +185,21 @@ def strip_string_literals(code, prefix='__Pyx_L'):
...
@@ -200,6 +185,21 @@ def strip_string_literals(code, prefix='__Pyx_L'):
start
=
q
start
=
q
else
:
else
:
q
+=
1
q
+=
1
# Process comment.
elif
-
1
!=
hash_mark
and
(
hash_mark
<
q
or
q
==
-
1
):
end
=
code
.
find
(
'
\
n
'
,
hash_mark
)
if
end
==
-
1
:
end
=
None
new_code
.
append
(
code
[
start
:
hash_mark
+
1
])
counter
+=
1
label
=
"%s%s"
%
(
prefix
,
counter
)
literals
[
label
]
=
code
[
hash_mark
+
1
:
end
]
new_code
.
append
(
label
)
if
end
is
None
:
break
q
=
end
start
=
q
# Open the quote.
# Open the quote.
else
:
else
:
...
...
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