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
99130c77
Commit
99130c77
authored
Sep 17, 2020
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support operator definitions inside cpp class
parent
5f2a3e3f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
Cython/Compiler/Parsing.py
Cython/Compiler/Parsing.py
+2
-2
No files found.
Cython/Compiler/Parsing.py
View file @
99130c77
...
@@ -2928,7 +2928,7 @@ def p_c_simple_declarator(s, ctx, empty, is_type, cmethod_flag,
...
@@ -2928,7 +2928,7 @@ def p_c_simple_declarator(s, ctx, empty, is_type, cmethod_flag,
cname
=
None
cname
=
None
if
cname
is
None
and
ctx
.
namespace
is
not
None
and
nonempty
:
if
cname
is
None
and
ctx
.
namespace
is
not
None
and
nonempty
:
cname
=
ctx
.
namespace
+
"::"
+
name
cname
=
ctx
.
namespace
+
"::"
+
name
if
name
==
'operator'
and
ctx
.
visibility
==
'extern'
and
nonempty
:
if
name
==
'operator'
and
(
ctx
.
visibility
==
'extern'
or
ctx
.
level
==
'cpp_class'
)
and
nonempty
:
op
=
s
.
sy
op
=
s
.
sy
if
[
1
for
c
in
op
if
c
in
'+-*/<=>!%&|([^~,'
]:
if
[
1
for
c
in
op
if
c
in
'+-*/<=>!%&|([^~,'
]:
s
.
next
()
s
.
next
()
...
@@ -2957,7 +2957,7 @@ def p_c_simple_declarator(s, ctx, empty, is_type, cmethod_flag,
...
@@ -2957,7 +2957,7 @@ def p_c_simple_declarator(s, ctx, empty, is_type, cmethod_flag,
name
=
name
+
' '
+
op
name
=
name
+
' '
+
op
s
.
next
()
s
.
next
()
result
=
Nodes
.
CNameDeclaratorNode
(
pos
,
result
=
Nodes
.
CNameDeclaratorNode
(
pos
,
name
=
name
,
cname
=
cname
,
default
=
rhs
)
name
=
EncodedString
(
name
)
,
cname
=
cname
,
default
=
rhs
)
result
.
calling_convention
=
calling_convention
result
.
calling_convention
=
calling_convention
return
result
return
result
...
...
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