Commit 8a8a9cc2 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Fix reporting of coordinates in "for loop" warnings

parent 7fb91f44
......@@ -142,6 +142,9 @@ The background pattern was downloaded from www.subtlepatterns.com
Changelog
=========
1.5.20 (11/2016)
- Fix wrongly formatted error reporting in FOR loops
1.5.19 (11/2016)
- Fix integer cast in Ada
......
......@@ -2016,7 +2016,7 @@ def composite_state(root, parent=None, context=None):
LOG.debug('Procedure context is undefined')
inner_proc = []
# Gather the list of states defined in the composite state
# and map a list of transitionsi to each state
# and map a list of transitions to each state
comp.mapping = {name: [] for name in get_state_list(root)}
inner_composite, states, floatings, starts = [], [], [], []
for child in root.getChildren():
......@@ -4233,8 +4233,12 @@ def for_loop(root, context):
forloop['transition'], err, warn = transition(
child, parent=for_loop, context=context)
errors.extend(err)
warnings.extend(warn)
# if the transition contains tasks or other constructs that are
# normally inside a graphical symbol, the errors and warnings will
# contain coordinates. Remove them, they will be replaced by those
# of the TASK symbol that contains the for loop
errors.extend(e[0] if type(e) is list else e for e in err)
warnings.extend(w[0] if type(w) is list else w for w in warn)
else:
warnings.append('Unsupported child type in FOR body' +
str(child.type))
......
......@@ -138,7 +138,7 @@ except ImportError:
__all__ = ['opengeode', 'SDL_Scene', 'SDL_View', 'parse']
__version__ = '1.5.19'
__version__ = '1.5.20'
if hasattr(sys, 'frozen'):
# Detect if we are running on Windows (py2exe-generated)
......
......@@ -99,7 +99,7 @@ my_tree(h) := {{cost 5, son g}};
CALL findpath(a, g, my_tree, res);
/* CIF PROCEDURECALL (89, 474), (201, 35) */
CALL writeln('best cost:', res!cost);
/* CIF NEXTSTATE (155, 524), (70, 35) */
/* CIF NEXTSTATE (155, 529), (70, 35) */
NEXTSTATE wait;
/* CIF STATE (296, 231), (70, 35) */
STATE wait;
......
Supports Markdown
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