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
324f8f14
Commit
324f8f14
authored
Nov 07, 2016
by
Maxime Perrotin
Browse files
Let the parser fix empty string types
parent
ddba2fa6
Changes
1
Show whitespace changes
Inline
Side-by-side
opengeode/ogParser.py
View file @
324f8f14
...
...
@@ -1806,11 +1806,14 @@ def primary(root, context):
# and also in value notation of SEQUENCEs that have no fields
prim
=
ogAST
.
PrimEmptyString
()
prim
.
value
=
[]
prim
.
exprType
=
type
(
'PrES'
,
(
object
,),
{
'kind'
:
'SequenceOfType'
,
'Min'
:
'0'
,
'Max'
:
'0'
})
prim
.
exprType
=
UNKNOWN_TYPE
# Let fix_expression_type resolve this type
# prim.exprType = type('PrES', (object,), {
# 'kind': 'SequenceOfType',
# 'Min': '0',
# 'Max': '0',
# 'type': UNKNOWN_TYPE
# })
elif
root
.
type
==
lexer
.
CHOICE
:
prim
=
ogAST
.
PrimChoiceItem
()
choice
=
root
.
getChild
(
0
).
toString
()
...
...
@@ -1826,7 +1829,7 @@ def primary(root, context):
if
elem
.
type
==
lexer
.
ID
:
field_name
=
elem
.
text
else
:
prim
.
value
[
field_name
],
err
,
warn
=
(
expression
(
elem
,
context
)
)
prim
.
value
[
field_name
],
err
,
warn
=
expression
(
elem
,
context
)
errors
.
extend
(
err
)
warnings
.
extend
(
warn
)
prim
.
exprType
=
UNKNOWN_TYPE
...
...
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