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
94b89da9
Commit
94b89da9
authored
Oct 15, 2008
by
Lisandro Dalcin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pyrex backport, accept ctypedef public api declarations
parent
d3c79c9b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
+15
-2
Cython/Compiler/Parsing.py
Cython/Compiler/Parsing.py
+5
-2
tests/compile/ctypedefpubapi.pyx
tests/compile/ctypedefpubapi.pyx
+10
-0
No files found.
Cython/Compiler/Parsing.py
View file @
94b89da9
...
...
@@ -1406,8 +1406,8 @@ def p_statement(s, ctx, first_statement = 0):
if
s
.
sy
==
'ctypedef'
:
if
ctx
.
level
not
in
(
'module'
,
'module_pxd'
):
s
.
error
(
"ctypedef statement not allowed here"
)
if
ctx
.
api
:
error
(
s
.
position
(),
"'api' not allowed with 'ctypedef'"
)
#
if ctx.api:
#
error(s.position(), "'api' not allowed with 'ctypedef'")
return
p_ctypedef_statement
(
s
,
ctx
)
elif
s
.
sy
==
'DEF'
:
return
p_DEF_statement
(
s
)
...
...
@@ -2166,7 +2166,10 @@ def p_ctypedef_statement(s, ctx):
pos
=
s
.
position
()
s
.
next
()
visibility
=
p_visibility
(
s
,
ctx
.
visibility
)
api
=
p_api
(
s
)
ctx
=
ctx
(
typedef_flag
=
1
,
visibility
=
visibility
)
if
api
:
ctx
.
api
=
1
if
s
.
sy
==
'class'
:
return
p_c_class_definition
(
s
,
pos
,
ctx
)
elif
s
.
sy
==
'IDENT'
and
s
.
systring
in
(
'struct'
,
'union'
,
'enum'
):
...
...
tests/compile/ctypedefpubapi.pyx
0 → 100644
View file @
94b89da9
ctypedef
public
api
class
Foo
[
type
PyFoo_Type
,
object
PyFooObject
]:
pass
cdef
api
:
ctypedef
public
class
Bar
[
type
PyBar_Type
,
object
PyBarObject
]:
pass
cdef
public
api
:
ctypedef
class
Baz
[
type
PyBaz_Type
,
object
PyBazObject
]:
pass
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