Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
OpenGEODE
Commits
5917b885
Commit
5917b885
authored
Feb 08, 2018
by
Maxime Perrotin
Browse files
Fixes in type checkings
parent
722f1b37
Changes
2
Hide whitespace changes
Inline
Side-by-side
opengeode/AdaGenerator.py
View file @
5917b885
...
...
@@ -1862,6 +1862,7 @@ def _assign_expression(expr):
strings
=
[]
left_stmts
,
left_str
,
left_local
=
expression
(
expr
.
left
)
right_stmts
,
right_str
,
right_local
=
expression
(
expr
.
right
)
# If left side is a string/seqOf and right side is a substring, we must
# assign the .Data and .Length parts properly
basic_left
=
find_basic_type
(
expr
.
left
.
exprType
)
...
...
@@ -1893,6 +1894,10 @@ def _assign_expression(expr):
strings
.
append
(
u
"{lvar}.Length := {rlen};"
.
format
(
lvar
=
left_str
,
rlen
=
rlen
))
elif
basic_left
.
kind
.
startswith
(
'Integer'
):
print
'
\n
ASSIGN:'
,
expr
.
inputString
print
" Left type = "
,
type_name
(
find_basic_type
(
expr
.
left
.
exprType
))
print
" Right type = "
,
type_name
(
find_basic_type
(
expr
.
right
.
exprType
))
# Make sure that integers are cast to 64 bits
# It is possible that left and right are of different types
# (signed vs unsigned and/or 32bits vs 64 bits).
...
...
opengeode/ogParser.py
View file @
5917b885
...
...
@@ -4175,7 +4175,9 @@ def assign(root, context):
and
expr
.
right
.
value
[
0
]
in
(
'abs'
,
'length'
):
pass
else
:
expr
.
right
.
exprType
=
expr
.
left
.
exprType
basic_right
=
find_basic_type
(
expr
.
right
.
exprType
)
if
not
basic_right
.
kind
.
startswith
(
'Integer'
):
expr
.
right
.
exprType
=
expr
.
left
.
exprType
# XXX I don't understand why we don't set the type of right
# to the same value as left in case of ExprAppend
# Setting it - I did not see any place in the Ada backend where
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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