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
9db14a42
Commit
9db14a42
authored
Mar 08, 2019
by
gsamain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cypdef keyword in parsing
parent
ccdee500
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
10 deletions
+5
-10
Cython/Compiler/Parsing.py
Cython/Compiler/Parsing.py
+5
-10
No files found.
Cython/Compiler/Parsing.py
View file @
9db14a42
...
...
@@ -2239,7 +2239,7 @@ def p_statement(s, ctx, first_statement = 0):
s
.
error
(
'decorator not allowed here'
)
s
.
level
=
ctx
.
level
decorators
=
p_decorators
(
s
)
if
not
ctx
.
allow_struct_enum_decorator
and
s
.
sy
not
in
(
'def'
,
'cdef'
,
'cpdef'
,
'c
cdef'
,
'c
lass'
):
if
not
ctx
.
allow_struct_enum_decorator
and
s
.
sy
not
in
(
'def'
,
'cdef'
,
'cpdef'
,
'class'
):
if
s
.
sy
==
'IDENT'
and
s
.
systring
==
'async'
:
pass
# handled below
else
:
...
...
@@ -2253,12 +2253,6 @@ def p_statement(s, ctx, first_statement = 0):
if
s
.
sy
==
'cdef'
:
cdef_flag
=
1
s
.
next
()
elif
s
.
sy
==
'ccdef'
:
cdef_flag
=
1
nogil_flag
=
1
s
.
next
()
if
s
.
systring
not
in
(
"class"
,
"cppclass"
):
s
.
error
(
'ccdef statement only allowed for extension type or cppclass'
)
elif
s
.
sy
==
'cpdef'
:
s
.
level
=
ctx
.
level
cdef_flag
=
1
...
...
@@ -3086,7 +3080,7 @@ def p_cdef_statement(s, ctx):
if
ctx
.
overridable
:
error
(
pos
,
"Extension types cannot be declared cpdef"
)
return
p_c_class_definition
(
s
,
pos
,
ctx
)
elif
s
.
sy
==
'IDENT'
and
s
.
systring
==
'cppclass'
:
elif
s
.
sy
==
'IDENT'
and
s
.
systring
in
(
'cppclass'
,
'cypclass'
)
:
return
p_cpp_class_definition
(
s
,
pos
,
ctx
)
elif
s
.
sy
==
'IDENT'
and
s
.
systring
in
struct_enum_union
:
if
ctx
.
level
not
in
(
'module'
,
'module_pxd'
):
...
...
@@ -3756,7 +3750,8 @@ def p_template_definition(s):
return
name
,
required
def
p_cpp_class_definition
(
s
,
pos
,
ctx
):
# s.sy == 'cppclass'
# s.sy in ('cppclass', 'cypclass')
cypclass
=
s
.
systring
==
'cypclass'
s
.
next
()
module_path
=
[]
class_name
=
p_ident
(
s
)
...
...
@@ -3813,7 +3808,7 @@ def p_cpp_class_definition(s, pos, ctx):
visibility
=
ctx
.
visibility
,
in_pxd
=
ctx
.
level
==
'module_pxd'
,
attributes
=
attributes
,
templates
=
templates
,
cypclass
=
nogil
)
templates
=
templates
,
cypclass
=
cypclass
)
def
p_cpp_class_attribute
(
s
,
ctx
):
decorators
=
None
...
...
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