aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/interpreterbase/interpreterbase.py
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2023-03-01 23:09:48 -0500
committerEli Schwartz <eschwartz@archlinux.org>2023-03-01 23:36:31 -0500
commit314382d6ff06d1fb59118492cbd5a65fd3c58e5c (patch)
treeb613b55db0811e2a3755e0290606690b7c508ced /mesonbuild/interpreterbase/interpreterbase.py
parent878c1604e6348f98602bbdd16d92fc63ed15ebea (diff)
downloadmeson-314382d6ff06d1fb59118492cbd5a65fd3c58e5c.zip
meson-314382d6ff06d1fb59118492cbd5a65fd3c58e5c.tar.gz
meson-314382d6ff06d1fb59118492cbd5a65fd3c58e5c.tar.bz2
handle meson_version after parsing but before invalid project() kwargs
If we add new kwargs to a function invoked on the first line, we also need to validate the meson_version before erroring out due to unknown kwargs. Even if the AST was successfully built. Amusingly, we also get to improve the error message a bit. By passing the AST node instead of an interpreter node, we get not just line numbers, but also column offsets of the issueful meson_version. That broke the stdout of another failing test; adapt it.
Diffstat (limited to 'mesonbuild/interpreterbase/interpreterbase.py')
-rw-r--r--mesonbuild/interpreterbase/interpreterbase.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/mesonbuild/interpreterbase/interpreterbase.py b/mesonbuild/interpreterbase/interpreterbase.py
index 666045f..61b3f90 100644
--- a/mesonbuild/interpreterbase/interpreterbase.py
+++ b/mesonbuild/interpreterbase/interpreterbase.py
@@ -117,6 +117,7 @@ class InterpreterBase:
assert isinstance(code, str)
try:
self.ast = mparser.Parser(code, mesonfile).parse()
+ self.handle_meson_version_from_ast()
except mparser.ParseException as me:
me.file = mesonfile
# try to detect parser errors from new syntax added by future