Commit 20aea56d authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Complete "rename_everything" functions

parent 9fb7b05b
......@@ -1393,12 +1393,12 @@ def _task_forloop(task, **kwargs):
else:
# Step is not directly supported in Ada, we need to use 'while'
stmt.extend(['declare',
u'{it} : Integer := Integer({start});'
u'{it} : Asn1Int := {start};'
.format(it=loop['var'],
start=start_str),
'',
'begin',
u'while {it} < Integer({stop}) loop'
u'while {it} < {stop} loop'
.format(it=loop['var'], stop=stop_str)])
# Add iterator to the list of local variables
LOCAL_VAR.update({loop['var']: (loop['type'], None)})
......
......@@ -508,10 +508,19 @@ def _rename_expr(ast, from_name, to_name):
@rename_everything.register(ogAST.PrimIndex)
def _rename_index(ast, from_name, to_name):
''' Index of an array '''
rename_everything(ast.value[0], from_name, to_name)
for each in ast.value[1]['index']:
rename_everything(each, from_name, to_name)
@rename_everything.register(ogAST.PrimSubstring)
def _rename_substring(ast, from_name, to_name):
''' Substrings '''
rename_everything(ast.value[0], from_name, to_name)
for each in ast.value[1]['substring']:
rename_everything(each, from_name, to_name)
@rename_everything.register(ogAST.PrimVariable)
def _rename_path(ast, from_name, to_name):
''' Ultimate seek point for the renaming: primary path/variables '''
......
......@@ -43,8 +43,8 @@ endfor;
/* CIF PROCEDURECALL (609, 306), (129, 35) */
CALL writeln(result);
/* CIF TASK (596, 356), (155, 53) */
TASK for sep in a:
call writeln(sep);
TASK for sep2 in a:
call writeln(sep2);
endfor
/* CIF COMMENT (771, 365), (194, 38) */
COMMENT 'Test to check scope
......@@ -58,4 +58,4 @@ endfor
ENDSTATE;
ENDPROCESS og;
ENDBLOCK;
ENDSYSTEM;
\ No newline at end of file
ENDSYSTEM;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment