Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
OpenGEODE
Commits
9e2326d2
Commit
9e2326d2
authored
Apr 18, 2021
by
Maxime Perrotin
Browse files
More type check
parent
84cbb9a6
Changes
2
Hide whitespace changes
Inline
Side-by-side
opengeode/AdaGenerator.py
View file @
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
...
...
opengeode/ogParser.py
View file @
9e2326d2
...
...
@@ -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"
)
else
:
#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"
)
break
else
:
# not found a duplicate definition -> Add an alias
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment