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
dbf0e770
Commit
dbf0e770
authored
Nov 08, 2010
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
better function names in parser, declare new functions as C functions in Parsing.pxd
parent
a750a1ce
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
8 deletions
+10
-8
Cython/Compiler/Parsing.pxd
Cython/Compiler/Parsing.pxd
+2
-0
Cython/Compiler/Parsing.py
Cython/Compiler/Parsing.py
+8
-8
No files found.
Cython/Compiler/Parsing.pxd
View file @
dbf0e770
...
@@ -35,6 +35,8 @@ cpdef p_yield_statement(PyrexScanner s)
...
@@ -35,6 +35,8 @@ cpdef p_yield_statement(PyrexScanner s)
cpdef
p_power
(
PyrexScanner
s
)
cpdef
p_power
(
PyrexScanner
s
)
cpdef
p_new_expr
(
PyrexScanner
s
)
cpdef
p_new_expr
(
PyrexScanner
s
)
cpdef
p_trailer
(
PyrexScanner
s
,
node1
)
cpdef
p_trailer
(
PyrexScanner
s
,
node1
)
cpdef
p_call_parse_args
(
PyrexScanner
s
,
bint
allow_genexp
=
*
)
cpdef
p_call_build_packed_args
(
pos
,
positional_args
,
keyword_args
,
star_arg
)
cpdef
p_call
(
PyrexScanner
s
,
function
)
cpdef
p_call
(
PyrexScanner
s
,
function
)
cpdef
p_index
(
PyrexScanner
s
,
base
)
cpdef
p_index
(
PyrexScanner
s
,
base
)
cpdef
p_subscript_list
(
PyrexScanner
s
)
cpdef
p_subscript_list
(
PyrexScanner
s
)
...
...
Cython/Compiler/Parsing.py
View file @
dbf0e770
...
@@ -381,7 +381,7 @@ def p_trailer(s, node1):
...
@@ -381,7 +381,7 @@ def p_trailer(s, node1):
# arglist: argument (',' argument)* [',']
# arglist: argument (',' argument)* [',']
# argument: [test '='] test # Really [keyword '='] test
# argument: [test '='] test # Really [keyword '='] test
def
p_call_parse
(
s
):
def
p_call_parse
_args
(
s
,
allow_genexp
=
True
):
# s.sy == '('
# s.sy == '('
pos
=
s
.
position
()
pos
=
s
.
position
()
s
.
next
()
s
.
next
()
...
@@ -430,7 +430,7 @@ def p_call_parse(s):
...
@@ -430,7 +430,7 @@ def p_call_parse(s):
s
.
expect
(
')'
)
s
.
expect
(
')'
)
return
positional_args
,
keyword_args
,
star_arg
,
starstar_arg
return
positional_args
,
keyword_args
,
star_arg
,
starstar_arg
def
p_call_
prepare_full
(
pos
,
positional_args
,
keyword_args
,
star_arg
):
def
p_call_
build_packed_args
(
pos
,
positional_args
,
keyword_args
,
star_arg
):
arg_tuple
=
None
arg_tuple
=
None
keyword_dict
=
None
keyword_dict
=
None
if
positional_args
or
not
star_arg
:
if
positional_args
or
not
star_arg
:
...
@@ -456,15 +456,15 @@ def p_call(s, function):
...
@@ -456,15 +456,15 @@ def p_call(s, function):
pos
=
s
.
position
()
pos
=
s
.
position
()
positional_args
,
keyword_args
,
star_arg
,
starstar_arg
=
\
positional_args
,
keyword_args
,
star_arg
,
starstar_arg
=
\
p_call_parse
(
s
)
p_call_parse
_args
(
s
)
if
not
(
keyword_args
or
star_arg
or
starstar_arg
):
if
not
(
keyword_args
or
star_arg
or
starstar_arg
):
return
ExprNodes
.
SimpleCallNode
(
pos
,
return
ExprNodes
.
SimpleCallNode
(
pos
,
function
=
function
,
function
=
function
,
args
=
positional_args
)
args
=
positional_args
)
else
:
else
:
arg_tuple
,
keyword_dict
=
p_call_
prepare_full
(
pos
,
arg_tuple
,
keyword_dict
=
p_call_
build_packed_args
(
positional_args
,
keyword_args
,
star_arg
)
pos
,
positional_args
,
keyword_args
,
star_arg
)
return
ExprNodes
.
GeneralCallNode
(
pos
,
return
ExprNodes
.
GeneralCallNode
(
pos
,
function
=
function
,
function
=
function
,
positional_args
=
arg_tuple
,
positional_args
=
arg_tuple
,
...
@@ -2626,9 +2626,9 @@ def p_class_statement(s, decorators):
...
@@ -2626,9 +2626,9 @@ def p_class_statement(s, decorators):
starstar_arg
=
None
starstar_arg
=
None
if
s
.
sy
==
'('
:
if
s
.
sy
==
'('
:
positional_args
,
keyword_args
,
star_arg
,
starstar_arg
=
\
positional_args
,
keyword_args
,
star_arg
,
starstar_arg
=
\
p_call_parse
(
s
)
p_call_parse
_args
(
s
,
allow_genexp
=
False
)
arg_tuple
,
keyword_dict
=
p_call_
prepare_full
(
pos
,
arg_tuple
,
keyword_dict
=
p_call_
build_packed_args
(
positional_args
,
keyword_args
,
star_arg
)
pos
,
positional_args
,
keyword_args
,
star_arg
)
if
arg_tuple
is
None
:
if
arg_tuple
is
None
:
# XXX: empty arg_tuple
# XXX: empty arg_tuple
arg_tuple
=
ExprNodes
.
TupleNode
(
pos
,
args
=
[])
arg_tuple
=
ExprNodes
.
TupleNode
(
pos
,
args
=
[])
...
...
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