Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
OpenGEODE
Commits
32c80b7d
Commit
32c80b7d
authored
Jul 13, 2014
by
Maxime Perrotin
Browse files
Forloop minor fix
parent
9004acae
Changes
1
Hide whitespace changes
Inline
Side-by-side
AdaGenerator.py
View file @
32c80b7d
...
...
@@ -645,15 +645,15 @@ def _task_forloop(task):
if
loop
[
'range'
][
'step'
]
==
1
:
start_str
+=
'..'
stop_stmt
,
stop_str
,
stop_local
=
expression
(
loop
[
'range'
][
'stop'
])
if
unicode
.
isnumeric
(
stop_str
):
stop_str
=
unicode
(
int
(
stop_str
)
-
1
)
else
:
stop_str
=
u
'{} - 1'
.
format
(
stop_str
)
local_decl
.
extend
(
stop_local
)
stmt
.
extend
(
stop_stmt
)
#if isinstance(loop['range']['stop'], ogAST.PrimInteger):
# stop_str = 'Integer({})'.format(stop_str)
if
loop
[
'range'
][
'step'
]
==
1
:
if
unicode
.
isnumeric
(
stop_str
):
stop_str
=
unicode
(
int
(
stop_str
)
-
1
)
else
:
stop_str
=
u
'{} - 1'
.
format
(
stop_str
)
stmt
.
append
(
u
'for {it} in {start}{stop} loop'
.
format
(
it
=
loop
[
'var'
],
start
=
start_str
,
stop
=
stop_str
))
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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