summaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorCharles Brunet <charles.brunet@optelgroup.com>2024-05-22 09:22:19 -0400
committerEli Schwartz <eschwartz93@gmail.com>2024-06-19 00:07:01 -0400
commitbef2fbf75bcea180affc19ebba280708109247a2 (patch)
treefb69d4fc74b843ddc0322dcd986c3926f6d32229 /mesonbuild
parent9f4253164aad64297b7d8c001d953217582b2196 (diff)
downloadmeson-bef2fbf75bcea180affc19ebba280708109247a2.tar.gz
Fix crash in meson format
There was a case where a trailing comma was missing a whitespaces attribute Fixes #13242
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/mformat.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/mesonbuild/mformat.py b/mesonbuild/mformat.py
index 68c9a1f8f..5e3701931 100644
--- a/mesonbuild/mformat.py
+++ b/mesonbuild/mformat.py
@@ -626,6 +626,7 @@ class ArgumentFormatter(FullAstVisitor):
if need_comma and not has_trailing_comma:
comma = mparser.SymbolNode(mparser.Token('comma', node.filename, 0, 0, 0, (0, 0), ','))
comma.condition_level = node.condition_level
+ comma.whitespaces = mparser.WhitespaceNode(mparser.Token('whitespace', node.filename, 0, 0, 0, (0, 0), ''))
node.commas.append(comma)
elif has_trailing_comma and not need_comma:
node.commas.pop(-1)