Commit 2113f529 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Merge into feature_buster

parents c84fefa3 9e2326d2
......@@ -557,9 +557,8 @@ LD_LIBRARY_PATH=./lib:.:$LD_LIBRARY_PATH opengeode-simulator
# Test val, in principle there is a value but if the code targets
# generation of properties, the model may have been cleant up and
# in that case no value would be set..
if name.endswith(u'START') and name != u'START' and val:
process_level_decl.append(u'{name} : constant := {val};'
.format(name=name, val=str(val)))
if name.endswith('START') and name != 'START' and val:
process_level_decl.append(f'{name} : constant := {str(val)};')
# Declare start procedure for aggregate states XXX add in C generator
# should create one START per "via" clause, TODO later
......@@ -1739,17 +1739,22 @@ def io_expression(root, context):
# variable already defined, does it have the same type?
if type_name(sort) != type_name(ptype):
errors.append(f"Duplicate/incompatible definition"
f" of variable {param_name}")
f" of variable '{param_name}'")
elif var.lower() in context.aliases.keys():
# Check if already defined variable is an alias,
# and if so, if it points to the same element
_, alias_expr = context.aliases[var.lower()]
if alias_expr.inputString != param_expr.inputString:
errors.append(f"Parameter name {param_name} is"
" used in another context, but not "
errors.append(f"Parameter name '{param_name}' "
"is used in another context, but not "
f"pointing to the same content")
#print ("param/alias already defined")
# A variable shall not be declared for this
# implicit parameter, as it is actually pointing
# to the event.
errors.append("A variable declaration with the "
f"same name as parameter '{param_name}' "
"exists and shall be removed or renamed")
# not found a duplicate definition -> Add an alias
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