From bef2fbf75bcea180affc19ebba280708109247a2 Mon Sep 17 00:00:00 2001 From: Charles Brunet Date: Wed, 22 May 2024 09:22:19 -0400 Subject: Fix crash in meson format There was a case where a trailing comma was missing a whitespaces attribute Fixes #13242 --- mesonbuild/mformat.py | 1 + 1 file changed, 1 insertion(+) (limited to 'mesonbuild') 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) -- cgit v1.2.3