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
9c8e3240
Commit
9c8e3240
authored
Feb 23, 2013
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
delete unused LongNode class
parent
d7da7092
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
36 deletions
+2
-36
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+1
-32
Cython/Compiler/Optimize.py
Cython/Compiler/Optimize.py
+1
-4
No files found.
Cython/Compiler/ExprNodes.py
View file @
9c8e3240
...
@@ -1248,37 +1248,6 @@ class IdentifierStringNode(StringNode):
...
@@ -1248,37 +1248,6 @@ class IdentifierStringNode(StringNode):
is_identifier
=
True
is_identifier
=
True
class
LongNode
(
AtomicExprNode
):
# Python long integer literal
#
# value string
type
=
py_object_type
def
calculate_constant_result
(
self
):
self
.
constant_result
=
Utils
.
str_to_number
(
self
.
value
)
def
compile_time_value
(
self
,
denv
):
return
Utils
.
str_to_number
(
self
.
value
)
def
analyse_types
(
self
,
env
):
self
.
is_temp
=
1
return
self
def
may_be_none
(
self
):
return
False
gil_message
=
"Constructing Python long int"
def
generate_result_code
(
self
,
code
):
code
.
putln
(
'%s = PyLong_FromString((char *)"%s", 0, 0); %s'
%
(
self
.
result
(),
self
.
value
,
code
.
error_goto_if_null
(
self
.
result
(),
self
.
pos
)))
code
.
put_gotref
(
self
.
py_result
())
class
ImagNode
(
AtomicExprNode
):
class
ImagNode
(
AtomicExprNode
):
# Imaginary number literal
# Imaginary number literal
#
#
...
@@ -2597,7 +2566,7 @@ class IndexNode(ExprNode):
...
@@ -2597,7 +2566,7 @@ class IndexNode(ExprNode):
return
py_object_type
return
py_object_type
index_type
=
self
.
index
.
infer_type
(
env
)
index_type
=
self
.
index
.
infer_type
(
env
)
if
index_type
and
index_type
.
is_int
or
isinstance
(
self
.
index
,
(
IntNode
,
LongNode
)
):
if
index_type
and
index_type
.
is_int
or
isinstance
(
self
.
index
,
IntNode
):
# indexing!
# indexing!
if
base_type
is
unicode_type
:
if
base_type
is
unicode_type
:
# Py_UCS4 will automatically coerce to a unicode string
# Py_UCS4 will automatically coerce to a unicode string
...
...
Cython/Compiler/Optimize.py
View file @
9c8e3240
...
@@ -2992,7 +2992,7 @@ class ConstantFolding(Visitor.VisitorTransform, SkipDeclarations):
...
@@ -2992,7 +2992,7 @@ class ConstantFolding(Visitor.VisitorTransform, SkipDeclarations):
traceback
.
print_exc
(
file
=
sys
.
stdout
)
traceback
.
print_exc
(
file
=
sys
.
stdout
)
NODE_TYPE_ORDER
=
[
ExprNodes
.
CharNode
,
ExprNodes
.
IntNode
,
NODE_TYPE_ORDER
=
[
ExprNodes
.
CharNode
,
ExprNodes
.
IntNode
,
ExprNodes
.
LongNode
,
ExprNodes
.
FloatNode
]
ExprNodes
.
FloatNode
]
def
_widest_node_class
(
self
,
*
nodes
):
def
_widest_node_class
(
self
,
*
nodes
):
try
:
try
:
...
@@ -3032,9 +3032,6 @@ class ConstantFolding(Visitor.VisitorTransform, SkipDeclarations):
...
@@ -3032,9 +3032,6 @@ class ConstantFolding(Visitor.VisitorTransform, SkipDeclarations):
value
=
'-'
+
value
value
=
'-'
+
value
return
value
return
value
if
isinstance
(
node
.
operand
,
ExprNodes
.
LongNode
):
return
ExprNodes
.
LongNode
(
node
.
pos
,
value
=
_negate
(
node
.
operand
.
value
),
constant_result
=
node
.
constant_result
)
if
isinstance
(
node
.
operand
,
ExprNodes
.
FloatNode
):
if
isinstance
(
node
.
operand
,
ExprNodes
.
FloatNode
):
# this is a safe operation
# this is a safe operation
return
ExprNodes
.
FloatNode
(
node
.
pos
,
value
=
_negate
(
node
.
operand
.
value
),
return
ExprNodes
.
FloatNode
(
node
.
pos
,
value
=
_negate
(
node
.
operand
.
value
),
...
...
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