Inconsistent CIF multi-assignment syntax between edges and functions
I was playing with multi-assignment and found inconsistent requirements in literal tuple syntax requirements:
controllable c;
uncontrollable u;
func list[2] int funk(list[2] int v):
(v[0], v[1]) := (5, 6);
v[0], v[1] := 5, 6;
return v;
end
automaton x:
disc list[2] int v;
location a:
initial;
edge c do (v[0], v[1]) := (5, 6) goto b;
// edge c do v[0], v[1] := 5, 6 goto b;
location b:
edge u goto a;
end
This file is accepted, note that an edge requires parentheses while inside a function they are optional. Also, the pretty-printer removes the parentheses in the function.
While this is all very understandable from an implementation point of view, for a user it can be confusing to have more than one syntax for the same concept. Even if users would want to have a single notation by adding parentheses themselves, the parentheses don't survive any transformation.
The cleanest solution is to always need parentheses around literal tuples. That however may be less than easy to accomplish.
EDIT: Typo fix.