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
6f95dba7
Commit
6f95dba7
authored
Dec 06, 2009
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
keep ignoring unknown directives in directive comments
parent
2db8ba02
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
Cython/Compiler/Options.py
Cython/Compiler/Options.py
+5
-3
Cython/Compiler/Parsing.py
Cython/Compiler/Parsing.py
+2
-1
No files found.
Cython/Compiler/Options.py
View file @
6f95dba7
...
...
@@ -120,7 +120,7 @@ def parse_directive_value(name, value, relaxed_bool=False):
else
:
assert
False
def
parse_directive_list
(
s
,
relaxed_bool
=
False
):
def
parse_directive_list
(
s
,
relaxed_bool
=
False
,
ignore_unknown
=
False
):
"""
Parses a comma-seperated list of pragma options. Whitespace
is not considered.
...
...
@@ -151,6 +151,8 @@ def parse_directive_list(s, relaxed_bool=False):
name
,
value
=
[
s
.
strip
()
for
s
in
item
.
strip
().
split
(
'='
,
1
)
]
parsed_value
=
parse_directive_value
(
name
,
value
,
relaxed_bool
=
relaxed_bool
)
if
parsed_value
is
None
:
raise
ValueError
(
'Unknown option: "%s"'
%
name
)
result
[
name
]
=
parsed_value
if
not
ignore_unknown
:
raise
ValueError
(
'Unknown option: "%s"'
%
name
)
else
:
result
[
name
]
=
parsed_value
return
result
Cython/Compiler/Parsing.py
View file @
6f95dba7
...
...
@@ -2588,7 +2588,8 @@ def p_compiler_directive_comments(s):
if m:
directives = m.group(1).strip()
try:
result.update( Options.parse_directive_list(directives) )
result.update( Options.parse_directive_list(
directives, ignore_unknown=True) )
except ValueError, e:
s.error(e.args[0], fatal=False)
s.next()
...
...
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