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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
a80790de
Commit
a80790de
authored
Mar 14, 2010
by
Craig Citro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make multiple '--directive's on command line cumulative
parent
0f02f513
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
Cython/Compiler/CmdLine.py
Cython/Compiler/CmdLine.py
+3
-1
Cython/Compiler/Options.py
Cython/Compiler/Options.py
+6
-2
No files found.
Cython/Compiler/CmdLine.py
View file @
a80790de
...
@@ -116,7 +116,9 @@ def parse_command_line(args):
...
@@ -116,7 +116,9 @@ def parse_command_line(args):
options
.
emit_linenums
=
True
options
.
emit_linenums
=
True
elif
option
in
(
"-X"
,
"--directive"
):
elif
option
in
(
"-X"
,
"--directive"
):
try
:
try
:
options
.
compiler_directives
=
Options
.
parse_directive_list
(
pop_arg
(),
relaxed_bool
=
True
)
options
.
compiler_directives
=
Options
.
parse_directive_list
(
pop_arg
(),
relaxed_bool
=
True
,
current_settings
=
options
.
compiler_directives
)
except
ValueError
,
e
:
except
ValueError
,
e
:
sys
.
stderr
.
write
(
"Error in compiler directive: %s
\
n
"
%
e
.
args
[
0
])
sys
.
stderr
.
write
(
"Error in compiler directive: %s
\
n
"
%
e
.
args
[
0
])
sys
.
exit
(
1
)
sys
.
exit
(
1
)
...
...
Cython/Compiler/Options.py
View file @
a80790de
...
@@ -129,7 +129,8 @@ def parse_directive_value(name, value, relaxed_bool=False):
...
@@ -129,7 +129,8 @@ def parse_directive_value(name, value, relaxed_bool=False):
else
:
else
:
assert
False
assert
False
def
parse_directive_list
(
s
,
relaxed_bool
=
False
,
ignore_unknown
=
False
):
def
parse_directive_list
(
s
,
relaxed_bool
=
False
,
ignore_unknown
=
False
,
current_settings
=
None
):
"""
"""
Parses a comma-separated list of pragma options. Whitespace
Parses a comma-separated list of pragma options. Whitespace
is not considered.
is not considered.
...
@@ -152,7 +153,10 @@ def parse_directive_list(s, relaxed_bool=False, ignore_unknown=False):
...
@@ -152,7 +153,10 @@ def parse_directive_list(s, relaxed_bool=False, ignore_unknown=False):
...
...
ValueError: Unknown option: "unknown"
ValueError: Unknown option: "unknown"
"""
"""
if
current_settings
is
None
:
result
=
{}
result
=
{}
else
:
result
=
current_settings
for
item
in
s
.
split
(
','
):
for
item
in
s
.
split
(
','
):
item
=
item
.
strip
()
item
=
item
.
strip
()
if
not
item
:
continue
if
not
item
:
continue
...
...
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