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
8bd0a1d0
Commit
8bd0a1d0
authored
Nov 07, 2016
by
Maxime Perrotin
Browse files
Cast integers at the right place
parent
e4e62f2d
Changes
3
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
8bd0a1d0
...
...
@@ -142,6 +142,9 @@ The background pattern was downloaded from www.subtlepatterns.com
Changelog
=========
1.
5.19 (11/2016)
-
Fix integer cast in Ada
1.
5.18 (11/2016)
-
Fix parsing of ASN.1 constants that use an annonymous inner type
...
...
opengeode/AdaGenerator.py
View file @
8bd0a1d0
...
...
@@ -1367,7 +1367,10 @@ def _prim_call(prim):
range_str
=
u
"{}'Length"
.
format
(
param_str
)
else
:
range_str
=
u
"{}.Length"
.
format
(
param_str
)
ada_string
+=
(
'Integer({})'
.
format
(
range_str
))
#ada_string += ('Integer({})'.format(range_str))
# I removed the cast here, because it is not the right place
# length fields are already Integers, no?
ada_string
+=
range_str
elif
ident
==
'present'
:
# User wants to know what CHOICE element is present
exp
=
params
[
0
]
...
...
@@ -1606,6 +1609,9 @@ def _equality(expr):
basic
=
lbty
.
kind
in
(
'IntegerType'
,
'Integer32Type'
,
'BooleanType'
,
'EnumeratedType'
,
'ChoiceEnumeratedType'
)
if
basic
:
if
lbty
.
kind
==
'IntegerType'
:
# Cast right side to make sure it is the same integer type as left
right_str
=
'{}({})'
.
format
(
actual_type
,
right_str
)
ada_string
=
u
'({left} {op} {right})'
.
format
(
left
=
left_str
,
op
=
expr
.
operand
,
right
=
right_str
)
else
:
...
...
opengeode/opengeode.py
View file @
8bd0a1d0
...
...
@@ -138,7 +138,7 @@ except ImportError:
__all__
=
[
'opengeode'
,
'SDL_Scene'
,
'SDL_View'
,
'parse'
]
__version__
=
'1.5.1
8
'
__version__
=
'1.5.1
9
'
if
hasattr
(
sys
,
'frozen'
):
# Detect if we are running on Windows (py2exe-generated)
...
...
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