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
d80c2c4c
Commit
d80c2c4c
authored
Jul 07, 2011
by
Mark Florisson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass failing tests and adapt for control flow
parent
b8d99c33
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
24 deletions
+18
-24
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+17
-5
Cython/Compiler/Parsing.pxd
Cython/Compiler/Parsing.pxd
+1
-1
Cython/Compiler/Parsing.py
Cython/Compiler/Parsing.py
+0
-18
No files found.
Cython/Compiler/Nodes.py
View file @
d80c2c4c
...
...
@@ -1041,7 +1041,8 @@ class CVarDefNode(StatNode):
if
self
.
directive_locals
:
error
(
self
.
pos
,
"Decorators can only be followed by functions"
)
self
.
entry
=
dest_scope
.
declare_var
(
name
,
type
,
declarator
.
pos
,
cname
=
cname
,
visibility
=
visibility
,
api
=
self
.
api
,
is_cdef
=
1
)
cname
=
cname
,
visibility
=
visibility
,
in_pxd
=
self
.
in_pxd
,
api
=
self
.
api
,
is_cdef
=
1
)
class
CStructOrUnionDefNode
(
StatNode
):
...
...
@@ -2208,7 +2209,15 @@ class FusedCFuncDefNode(StatListNode):
else
:
if_
=
'elif'
tup
=
(
if_
,
i
,
py_type_name
,
len
(
seen_fused_types
)
-
1
,
# in the case of long, unicode or bytes we need to instance
# check for long_, unicode_, bytes_ (long = long is no longer
# valid code with control flow analysis)
instance_check_py_type_name
=
py_type_name
if
py_type_name
in
(
'long'
,
'unicode'
,
'bytes'
):
instance_check_py_type_name
+=
'_'
tup
=
(
if_
,
i
,
instance_check_py_type_name
,
len
(
seen_fused_types
)
-
1
,
specialized_type
.
typeof_name
())
body_stmts
.
append
(
" %s isinstance(args[%d], %s): "
...
...
@@ -2228,10 +2237,13 @@ def __pyx_fused_cpdef(signatures, args):
import sys
if sys.version_info >= (3, 0):
long = int
unicode = str
long_ = int
unicode_ = str
bytes_ = bytes
else:
bytes = str
long_ = long
unicode_ = unicode
bytes_ = str
dest_sig = [None] * len(args)
...
...
Cython/Compiler/Parsing.pxd
View file @
d80c2c4c
...
...
@@ -160,11 +160,11 @@ cdef p_c_enum_definition(PyrexScanner s, pos, ctx)
cdef
p_c_enum_line
(
PyrexScanner
s
,
ctx
,
list
items
)
cdef
p_c_enum_item
(
PyrexScanner
s
,
ctx
,
list
items
)
cdef
p_c_struct_or_union_definition
(
PyrexScanner
s
,
pos
,
ctx
)
cdef
p_fused_definition
(
PyrexScanner
s
,
pos
,
ctx
)
cdef
p_visibility
(
PyrexScanner
s
,
prev_visibility
)
cdef
p_c_modifiers
(
PyrexScanner
s
)
cdef
p_c_func_or_var_declaration
(
PyrexScanner
s
,
pos
,
ctx
)
cdef
p_ctypedef_statement
(
PyrexScanner
s
,
ctx
)
cdef
p_typelist
(
PyrexScanner
s
)
cdef
p_decorators
(
PyrexScanner
s
)
cdef
p_def_statement
(
PyrexScanner
s
,
list
decorators
=
*
)
cpdef
p_varargslist
(
PyrexScanner
s
,
terminator
=*
,
bint
annotated
=
*
)
...
...
Cython/Compiler/Parsing.py
View file @
d80c2c4c
...
...
@@ -2650,24 +2650,6 @@ def p_c_func_or_var_declaration(s, pos, ctx):
overridable
=
ctx
.
overridable
)
return
result
#def p_typelist(s):
# """
# parse a list of basic c types as part of a function call, like
# cython.fused_type(int, long, double)
# """
# types = []
# pos = s.position()
#
# while s.sy == 'IDENT':
# types.append(p_c_base_type(s))
# if s.sy != ',':
# if s.sy != ')':
# s.expect(',')
# break
# s.next()
#
# return Nodes.FusedTypeNode(pos, types=types)
def
p_ctypedef_statement
(
s
,
ctx
):
# s.sy == 'ctypedef'
pos
=
s
.
position
()
...
...
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