diff options
| author | Tamás Bálint Misius <lbphacker@gmail.com> | 2023-12-22 21:02:58 +0100 |
|---|---|---|
| committer | Eli Schwartz <eschwartz93@gmail.com> | 2024-01-06 23:56:32 -0500 |
| commit | 7700618181249ec02ebe774d9c276d1c343b5dce (patch) | |
| tree | 1d3cf3e5aec9e46deb42d57552f03a05311f7920 | |
| parent | fbc744e6c6031f96cdbb89e5320d93188a18006c (diff) | |
| download | meson-7700618181249ec02ebe774d9c276d1c343b5dce.tar.gz | |
machine file: Fix parenthesized expressions
Extends 79ed2415e9a5. Thanks @bruchar1 for the test case; I got
absolutely lost trying to figure out where to add one.
| -rw-r--r-- | mesonbuild/coredata.py | 2 | ||||
| -rw-r--r-- | test cases/common/222 native prop/nativefile.ini | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py index 5f1c2fc0e..a6a14c8ab 100644 --- a/mesonbuild/coredata.py +++ b/mesonbuild/coredata.py @@ -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] diff --git a/test cases/common/222 native prop/nativefile.ini b/test cases/common/222 native prop/nativefile.ini index 03c1e0397..790b27cef 100644 --- a/test cases/common/222 native prop/nativefile.ini +++ b/test cases/common/222 native prop/nativefile.ini @@ -1,3 +1,4 @@ [properties] astring = 'mystring' -anarray = ['one', 'two']
\ No newline at end of file +anarray = ['one', 'two'] +withparentheses = ('anotherstring') # Ensure parentheses can be parsed
\ No newline at end of file |
