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
ad9a2205
Commit
ad9a2205
authored
Jan 07, 2010
by
Craig Citro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
initalized -> initialized
parent
9ea6a398
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
10 deletions
+10
-10
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+6
-6
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+3
-3
Cython/Compiler/Symtab.py
Cython/Compiler/Symtab.py
+1
-1
No files found.
Cython/Compiler/ExprNodes.py
View file @
ad9a2205
...
@@ -1151,7 +1151,7 @@ class NameNode(AtomicExprNode):
...
@@ -1151,7 +1151,7 @@ class NameNode(AtomicExprNode):
else
:
else
:
type
=
py_object_type
type
=
py_object_type
self
.
entry
=
env
.
declare_var
(
self
.
name
,
type
,
self
.
pos
)
self
.
entry
=
env
.
declare_var
(
self
.
name
,
type
,
self
.
pos
)
env
.
control_flow
.
set_state
(
self
.
pos
,
(
self
.
name
,
'initalized'
),
True
)
env
.
control_flow
.
set_state
(
self
.
pos
,
(
self
.
name
,
'init
i
alized'
),
True
)
env
.
control_flow
.
set_state
(
self
.
pos
,
(
self
.
name
,
'source'
),
'assignment'
)
env
.
control_flow
.
set_state
(
self
.
pos
,
(
self
.
name
,
'source'
),
'assignment'
)
if
self
.
entry
.
is_declared_generic
:
if
self
.
entry
.
is_declared_generic
:
self
.
result_ctype
=
py_object_type
self
.
result_ctype
=
py_object_type
...
@@ -1294,13 +1294,13 @@ class NameNode(AtomicExprNode):
...
@@ -1294,13 +1294,13 @@ class NameNode(AtomicExprNode):
elif
entry
.
is_local
and
False
:
elif
entry
.
is_local
and
False
:
# control flow not good enough yet
# control flow not good enough yet
assigned
=
entry
.
scope
.
control_flow
.
get_state
((
entry
.
name
,
'initalized'
),
self
.
pos
)
assigned
=
entry
.
scope
.
control_flow
.
get_state
((
entry
.
name
,
'init
i
alized'
),
self
.
pos
)
if
assigned
is
False
:
if
assigned
is
False
:
error
(
self
.
pos
,
"local variable '%s' referenced before assignment"
%
entry
.
name
)
error
(
self
.
pos
,
"local variable '%s' referenced before assignment"
%
entry
.
name
)
elif
not
Options
.
init_local_none
and
assigned
is
None
:
elif
not
Options
.
init_local_none
and
assigned
is
None
:
code
.
putln
(
'if (%s == 0) { PyErr_SetString(PyExc_UnboundLocalError, "%s"); %s }'
%
code
.
putln
(
'if (%s == 0) { PyErr_SetString(PyExc_UnboundLocalError, "%s"); %s }'
%
(
entry
.
cname
,
entry
.
name
,
code
.
error_goto
(
self
.
pos
)))
(
entry
.
cname
,
entry
.
name
,
code
.
error_goto
(
self
.
pos
)))
entry
.
scope
.
control_flow
.
set_state
(
self
.
pos
,
(
entry
.
name
,
'initalized'
),
True
)
entry
.
scope
.
control_flow
.
set_state
(
self
.
pos
,
(
entry
.
name
,
'init
i
alized'
),
True
)
def
generate_assignment_code
(
self
,
rhs
,
code
):
def
generate_assignment_code
(
self
,
rhs
,
code
):
#print "NameNode.generate_assignment_code:", self.name ###
#print "NameNode.generate_assignment_code:", self.name ###
...
@@ -1364,10 +1364,10 @@ class NameNode(AtomicExprNode):
...
@@ -1364,10 +1364,10 @@ class NameNode(AtomicExprNode):
code
.
put_gotref
(
self
.
py_result
())
code
.
put_gotref
(
self
.
py_result
())
if
self
.
use_managed_ref
and
not
self
.
lhs_of_first_assignment
:
if
self
.
use_managed_ref
and
not
self
.
lhs_of_first_assignment
:
if
entry
.
is_local
and
not
Options
.
init_local_none
:
if
entry
.
is_local
and
not
Options
.
init_local_none
:
init
alized
=
entry
.
scope
.
control_flow
.
get_state
((
entry
.
name
,
'init
alized'
),
self
.
pos
)
init
ialized
=
entry
.
scope
.
control_flow
.
get_state
((
entry
.
name
,
'initi
alized'
),
self
.
pos
)
if
initalized
is
True
:
if
init
i
alized
is
True
:
code
.
put_decref
(
self
.
result
(),
self
.
ctype
())
code
.
put_decref
(
self
.
result
(),
self
.
ctype
())
elif
initalized
is
None
:
elif
init
i
alized
is
None
:
code
.
put_xdecref
(
self
.
result
(),
self
.
ctype
())
code
.
put_xdecref
(
self
.
result
(),
self
.
ctype
())
else
:
else
:
code
.
put_decref
(
self
.
result
(),
self
.
ctype
())
code
.
put_decref
(
self
.
result
(),
self
.
ctype
())
...
...
Cython/Compiler/Nodes.py
View file @
ad9a2205
...
@@ -1229,7 +1229,7 @@ class FuncDefNode(StatNode, BlockNode):
...
@@ -1229,7 +1229,7 @@ class FuncDefNode(StatNode, BlockNode):
code
.
put_label
(
code
.
return_from_error_cleanup_label
)
code
.
put_label
(
code
.
return_from_error_cleanup_label
)
if
not
Options
.
init_local_none
:
if
not
Options
.
init_local_none
:
for
entry
in
lenv
.
var_entries
:
for
entry
in
lenv
.
var_entries
:
if
lenv
.
control_flow
.
get_state
((
entry
.
name
,
'initalized'
))
is
not
True
:
if
lenv
.
control_flow
.
get_state
((
entry
.
name
,
'init
i
alized'
))
is
not
True
:
entry
.
xdecref_cleanup
=
1
entry
.
xdecref_cleanup
=
1
for
entry
in
lenv
.
var_entries
:
for
entry
in
lenv
.
var_entries
:
...
@@ -1875,7 +1875,7 @@ class DefNode(FuncDefNode):
...
@@ -1875,7 +1875,7 @@ class DefNode(FuncDefNode):
error
(
arg
.
pos
,
"Missing argument name"
)
error
(
arg
.
pos
,
"Missing argument name"
)
else
:
else
:
env
.
control_flow
.
set_state
((),
(
arg
.
name
,
'source'
),
'arg'
)
env
.
control_flow
.
set_state
((),
(
arg
.
name
,
'source'
),
'arg'
)
env
.
control_flow
.
set_state
((),
(
arg
.
name
,
'initalized'
),
True
)
env
.
control_flow
.
set_state
((),
(
arg
.
name
,
'init
i
alized'
),
True
)
if
arg
.
needs_conversion
:
if
arg
.
needs_conversion
:
arg
.
entry
=
env
.
declare_var
(
arg
.
name
,
arg
.
type
,
arg
.
pos
)
arg
.
entry
=
env
.
declare_var
(
arg
.
name
,
arg
.
type
,
arg
.
pos
)
if
arg
.
type
.
is_pyobject
:
if
arg
.
type
.
is_pyobject
:
...
@@ -1901,7 +1901,7 @@ class DefNode(FuncDefNode):
...
@@ -1901,7 +1901,7 @@ class DefNode(FuncDefNode):
entry
.
init_to_none
=
0
entry
.
init_to_none
=
0
entry
.
xdecref_cleanup
=
1
entry
.
xdecref_cleanup
=
1
arg
.
entry
=
entry
arg
.
entry
=
entry
env
.
control_flow
.
set_state
((),
(
arg
.
name
,
'initalized'
),
True
)
env
.
control_flow
.
set_state
((),
(
arg
.
name
,
'init
i
alized'
),
True
)
def
analyse_expressions
(
self
,
env
):
def
analyse_expressions
(
self
,
env
):
self
.
local_scope
.
directives
=
env
.
directives
self
.
local_scope
.
directives
=
env
.
directives
...
...
Cython/Compiler/Symtab.py
View file @
ad9a2205
...
@@ -428,7 +428,7 @@ class Scope(object):
...
@@ -428,7 +428,7 @@ class Scope(object):
cname = self.mangle(Naming.var_prefix, name)
cname = self.mangle(Naming.var_prefix, name)
entry = self.declare(name, cname, type, pos, visibility)
entry = self.declare(name, cname, type, pos, visibility)
entry.is_variable = 1
entry.is_variable = 1
self.control_flow.set_state((), (name, 'initalized'), False)
self.control_flow.set_state((), (name, 'init
i
alized'), False)
return entry
return entry
def declare_builtin(self, name, pos):
def declare_builtin(self, name, pos):
...
...
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