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
d1d79cda
Commit
d1d79cda
authored
Jun 07, 2008
by
Dag Sverre Seljebotn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initialize unassigned node child attributes to None, clean up ExprNode
parent
c5d8303c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
10 deletions
+9
-10
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+4
-9
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+5
-1
No files found.
Cython/Compiler/ExprNodes.py
View file @
d1d79cda
...
...
@@ -168,16 +168,9 @@ class ExprNode(Node):
saved_subexpr_nodes
=
None
is_temp
=
0
def
get_child_attrs
(
self
):
return
self
.
subexprs
child_attrs
=
property
(
fget
=
get_child_attrs
)
def
get_child_attrs
(
self
):
"""Automatically provide the contents of subexprs as children, unless child_attr
has been declared. See Nodes.Node.get_child_accessors."""
if
self
.
child_attrs
is
not
None
:
return
self
.
child_attrs
elif
self
.
subexprs
is
not
None
:
return
self
.
subexprs
child_attrs
=
property
(
fget
=
get_child_attrs
)
def
not_implemented
(
self
,
method_name
):
print_call_chain
(
method_name
,
"not implemented"
)
###
...
...
@@ -3289,6 +3282,8 @@ class CondExprNode(ExprNode):
# false_val ExprNode
temp_bool
=
None
true_val
=
None
false_val
=
None
subexprs
=
[
'test'
,
'true_val'
,
'false_val'
]
...
...
Cython/Compiler/Nodes.py
View file @
d1d79cda
...
...
@@ -2217,6 +2217,7 @@ class CascadedAssignmentNode(AssignmentNode):
# coerced_rhs_list [ExprNode] RHS coerced to type of each LHS
child_attrs
=
[
"lhs_list"
,
"rhs"
,
"coerced_rhs_list"
]
coerced_rhs_list
=
None
def
analyse_declarations
(
self
,
env
):
for
lhs
in
self
.
lhs_list
:
...
...
@@ -2353,6 +2354,7 @@ class InPlaceAssignmentNode(AssignmentNode):
# (it must be a NameNode, AttributeNode, or IndexNode).
child_attrs
=
[
"lhs"
,
"rhs"
,
"dup"
]
dup
=
None
def
analyse_declarations
(
self
,
env
):
self
.
lhs
.
analyse_target_declaration
(
env
)
...
...
@@ -2987,6 +2989,7 @@ class ForInStatNode(LoopNode, StatNode):
# item NextNode used internally
child_attrs
=
[
"target"
,
"iterator"
,
"body"
,
"else_clause"
,
"item"
]
item
=
None
def
analyse_declarations
(
self
,
env
):
self
.
target
.
analyse_target_declaration
(
env
)
...
...
@@ -3103,7 +3106,7 @@ class ForFromStatNode(LoopNode, StatNode):
# is_py_target bool
# loopvar_name string
# py_loopvar_node PyTempNode or None
child_attrs
=
[
"target"
,
"bound1"
,
"bound2"
,
"step"
,
"body"
,
"else_clause"
,
"py_loopvar_node"
]
child_attrs
=
[
"target"
,
"bound1"
,
"bound2"
,
"step"
,
"body"
,
"else_clause"
]
def
analyse_declarations
(
self
,
env
):
self
.
target
.
analyse_target_declaration
(
env
)
...
...
@@ -3317,6 +3320,7 @@ class ExceptClauseNode(Node):
# exc_vars (string * 3) local exception variables
child_attrs
=
[
"pattern"
,
"target"
,
"body"
,
"exc_value"
]
exc_value
=
None
def
analyse_declarations
(
self
,
env
):
if
self
.
target
:
...
...
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