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
Gwenaël Samain
cython
Commits
06ed8931
Commit
06ed8931
authored
Oct 18, 2007
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix king1 - compile time == operator
parent
6478e87d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+5
-4
No files found.
Cython/Compiler/ExprNodes.py
View file @
06ed8931
...
...
@@ -2639,7 +2639,7 @@ class SizeofVarNode(SizeofNode):
compile_time_binary_operators
=
{
'<'
:
operator
.
lt
,
'<='
:
operator
.
le
,
'='
:
operator
.
eq
,
'=
=
'
:
operator
.
eq
,
'!='
:
operator
.
ne
,
'>='
:
operator
.
ge
,
'>'
:
operator
.
gt
,
...
...
@@ -2667,7 +2667,7 @@ def get_compile_time_binop(node):
if
not
func
:
error
(
node
.
pos
,
"Binary '%s' not supported in compile-time expression"
%
self
.
operator
)
%
node
.
operator
)
return
func
class
BinopNode
(
ExprNode
):
...
...
@@ -3109,11 +3109,12 @@ class CmpNode:
def
cascaded_compile_time_value
(
self
,
operand1
,
denv
):
func
=
get_compile_time_binop
(
self
)
operand2
=
self
.
operand
.
compile_time_value
(
denv
)
operand2
=
self
.
operand
2
.
compile_time_value
(
denv
)
try
:
result
=
func
(
operand1
,
operand2
)
except
Exception
,
e
:
self
.
compile_time_value_error
(
e
)
result
=
None
if
result
:
cascade
=
self
.
cascade
if
cascade
:
...
...
@@ -3221,7 +3222,7 @@ class PrimaryCmpNode(ExprNode, CmpNode):
cascade
=
None
def
compile_time_value
(
self
,
denv
):
operand1
=
self
.
operand
.
compile_time_value
(
denv
)
operand1
=
self
.
operand
1
.
compile_time_value
(
denv
)
return
self
.
cascaded_compile_time_value
(
operand1
,
denv
)
def
analyse_types
(
self
,
env
):
...
...
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