Commit 004e0c17 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Fix Ada backend missing parenthesis

parent 30e8928a
...@@ -1451,9 +1451,9 @@ def _decision(dec): ...@@ -1451,9 +1451,9 @@ def _decision(dec):
exp = u'tmp{idx} {op} {ans}'.format(idx=dec.tmpVar, exp = u'tmp{idx} {op} {ans}'.format(idx=dec.tmpVar,
op=a.openRangeOp.operand, ans=ans_str) op=a.openRangeOp.operand, ans=ans_str)
else: else:
exp = u'{q} {op} {ans}'.format(q=q_str, exp = u'({q}) {op} {ans}'.format(q=q_str,
op=a.openRangeOp.operand, op=a.openRangeOp.operand,
ans=ans_str) ans=ans_str)
code.append(sep + exp + ' then') code.append(sep + exp + ' then')
if a.transition: if a.transition:
stmt, tr_decl = generate(a.transition) stmt, tr_decl = generate(a.transition)
......
...@@ -2148,6 +2148,7 @@ def sdl_equals(a_val, b_val, asn1ty, ctx): ...@@ -2148,6 +2148,7 @@ def sdl_equals(a_val, b_val, asn1ty, ctx):
b_val = sdl_sequenceof(b_val, ctx) b_val = sdl_sequenceof(b_val, ctx)
# XXX add isinstance(b_val, SDLAppend) and SDLSubstring, no? # XXX add isinstance(b_val, SDLAppend) and SDLSubstring, no?
# Also in _equals a_val should also be evaluated against special types
try: try:
type_name = asn1ty.ReferencedTypeName.replace('-', '_').lower() type_name = asn1ty.ReferencedTypeName.replace('-', '_').lower()
......
...@@ -41,7 +41,18 @@ endfor'; ...@@ -41,7 +41,18 @@ endfor';
TASK variable := variable(0,2); TASK variable := variable(0,2);
/* CIF PROCEDURECALL (361, 794), (259, 35) */ /* CIF PROCEDURECALL (361, 794), (259, 35) */
CALL writeln(variable(0, 2)); CALL writeln(variable(0, 2));
/* CIF NEXTSTATE (456, 844), (70, 35) */ /* CIF DECISION (380, 844), (221, 50) */
DECISION variable // variable = 'HopHop';
/* CIF ANSWER (371, 914), (70, 23) */
(true):
/* CIF PROCEDURECALL (347, 952), (117, 35) */
CALL writeln('OK');
/* CIF ANSWER (543, 914), (70, 23) */
(false):
/* CIF PROCEDURECALL (474, 952), (207, 35) */
CALL writeln(variable // variable);
ENDDECISION;
/* CIF NEXTSTATE (455, 1002), (70, 35) */
NEXTSTATE wait; NEXTSTATE wait;
/* CIF STATE (272, 359), (70, 35) */ /* CIF STATE (272, 359), (70, 35) */
STATE wait; STATE wait;
......
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