machine file: Fix parenthesized expressions
Extends 79ed2415e9
. Thanks @bruchar1 for the test case; I got
absolutely lost trying to figure out where to add one.
This commit is contained in:
parent
fbc744e6c6
commit
7700618181
|
@ -1097,6 +1097,8 @@ class MachineFileParser():
|
|||
return node.value
|
||||
elif isinstance(node, mparser.NumberNode):
|
||||
return node.value
|
||||
elif isinstance(node, mparser.ParenthesizedNode):
|
||||
return self._evaluate_statement(node.inner)
|
||||
elif isinstance(node, mparser.ArrayNode):
|
||||
# TODO: This is where recursive types would come in handy
|
||||
return [self._evaluate_statement(arg) for arg in node.args.arguments]
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
[properties]
|
||||
astring = 'mystring'
|
||||
anarray = ['one', 'two']
|
||||
anarray = ['one', 'two']
|
||||
withparentheses = ('anotherstring') # Ensure parentheses can be parsed
|
Loading…
Reference in New Issue