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
2ad83db6
Commit
2ad83db6
authored
Nov 26, 2019
by
Maxime Perrotin
Browse files
Fix parsing error
parent
316cfc4b
Changes
2
Hide whitespace changes
Inline
Side-by-side
opengeode/ogParser.py
View file @
2ad83db6
...
...
@@ -1235,16 +1235,19 @@ def fix_enumerated_and_choice(expr_enum, context):
warnings
=
[]
kind
=
find_basic_type
(
expr_enum
.
left
.
exprType
).
kind
if
kind
in
(
'EnumeratedType'
,
'StateEnumeratedType'
):
LOG
.
debug
(
"Fix raw enumerated type: "
+
expr_enum
.
right
.
inputString
)
prim
=
ogAST
.
PrimEnumeratedValue
(
primary
=
expr_enum
.
right
,
debugLine
=
lineno
())
try
:
warnings
.
extend
(
check_type_compatibility
(
prim
,
expr_enum
.
left
.
exprType
,
context
))
expr_enum
.
right
=
prim
expr_enum
.
right
.
exprType
=
expr_enum
.
left
.
exprType
except
(
UnboundLocalError
,
AttributeError
,
TypeError
):
pass
try
:
warnings
.
extend
(
check_type_compatibility
(
prim
,
expr_enum
.
left
.
exprType
,
context
))
expr_enum
.
right
=
prim
expr_enum
.
right
.
exprType
=
expr_enum
.
left
.
exprType
except
(
UnboundLocalError
,
AttributeError
,
TypeError
)
as
err
:
LOG
.
debug
(
"Failed: "
+
str
(
err
))
LOG
.
debug
(
traceback
.
format_exc
())
pass
return
warnings
...
...
@@ -1291,7 +1294,9 @@ def fix_expression_types(expr, context): # type: -> [warnings]
unknown
=
[
uk_expr
for
uk_expr
in
(
expr
.
right
,
expr
.
left
)
if
uk_expr
.
exprType
==
UNKNOWN_TYPE
]
if
unknown
:
#print traceback.print_stack()
LOG
.
debug
(
"right: "
+
expr
.
right
.
inputString
)
LOG
.
debug
(
"left: "
+
expr
.
left
.
inputString
)
#LOG.debug(traceback.print_stack())
raise
TypeError
(
'Cannot resolve type of "{}"'
.
format
(
unknown
[
0
].
inputString
))
...
...
@@ -2459,10 +2464,12 @@ def primary(root, context):
'type'
:
prim_elem
.
exprType
})
elif
root
.
type
==
lexer
.
STATE
:
LOG
.
debug
(
"Primary is state"
)
prim
=
ogAST
.
PrimStateReference
()
prim
.
exprType
=
ENUMERATED
(
)
prim
.
exprType
=
type
(
"StateEnumeratedType"
,
(
ENUMERATED
,),
{}
)
prim
.
exprType
.
kind
=
'StateEnumeratedType'
prim
.
exprType
.
EnumValues
=
{
value
:
type
(
''
,
(
object
,),
prim
.
exprType
.
EnumValues
=
{
value
:
type
(
''
,
(
object
,),
{
'EnumID'
:
value
})
for
value
in
context
.
mapping
.
keys
()}
else
:
...
...
tests/testsuite/test-iterators/Makefile
View file @
2ad83db6
include
../shared.mk
ROOT_MODEL
=
orchestrator.pr
OPENGEODE
=
opengeode
ARCH
:=
$(
shell
getconf LONG_BIT
)
all
:
test-ada test-llvm
...
...
@@ -34,7 +35,7 @@ test-qgen-gt-c:
test-ada
:
[
$(ARCH)
==
64
]
&&
EXTRAFLAG
=
"--target=x86_64-linux"
;
\
mkdir
-p
build
&&
cp
*
.pr
*
.asn model_checker.gpr properties build
&&
cd
build
&&
\
../../../../opengeode/opengeode.py
orchestrator.pr
--shared
&&
\
$(OPENGEODE)
orchestrator.pr
--shared
&&
\
mono
$(ASN1SCC)
-Ada
-typePrefix
asn1Scc
-equal
dataview-uniq.asn
&&
\
taste-properties
-d
-s
properties orchestrator.pr
&&
\
taste-asn1-iterators
*
.asn
&&
\
...
...
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