diff options
| author | Eli Schwartz <eschwartz@archlinux.org> | 2023-03-01 23:09:48 -0500 |
|---|---|---|
| committer | Eli Schwartz <eschwartz@archlinux.org> | 2023-03-01 23:36:31 -0500 |
| commit | 314382d6ff06d1fb59118492cbd5a65fd3c58e5c (patch) | |
| tree | b613b55db0811e2a3755e0290606690b7c508ced /mesonbuild/interpreterbase | |
| parent | 878c1604e6348f98602bbdd16d92fc63ed15ebea (diff) | |
| download | meson-314382d6ff06d1fb59118492cbd5a65fd3c58e5c.tar.gz | |
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')
| -rw-r--r-- | mesonbuild/interpreterbase/interpreterbase.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/mesonbuild/interpreterbase/interpreterbase.py b/mesonbuild/interpreterbase/interpreterbase.py index 666045fe4..61b3f905e 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 |
