summaryrefslogtreecommitdiff
path: root/mesonbuild/interpreterbase/__init__.py
AgeCommit message (Collapse)Author
2025-06-09AstInterpreter: Fix dead-code-crashVolker Weißmann
Without this commit, the rewriter and the static introspection tool crash if `meson.build` contains something like ```meson if false foo = not_defined endif ``` or ```meson if false message(not_defined) endif ``` While it could be argued, that you should not write stuff like this, this used to raise a `MesonBugException`, which we have to fix. Fixes #14667
2025-05-29rewriter: Replace assignments with cur_assignmentsVolker Weißmann
Replace the variable tracking of `AstInterpreter.assignments` with a slightly better variable tracking called `AstInterpreter.cur_assignments`. We now have a class `UnknownValue` for more explicit handling of situations that are too complex/impossible.
2024-10-01interpreterbase/decorators: delete now unused stringArgsDylan Baker
2023-12-13Use SPDX-License-Identifier consistentlyDylan Baker
This replaces all of the Apache blurbs at the start of each file with an `# SPDX-License-Identifier: Apache-2.0` string. It also fixes existing uses to be consistent in capitalization, and to be placed above any copyright notices. This removes nearly 3000 lines of boilerplate from the project (only python files), which no developer cares to look at. SPDX is in common use, particularly in the Linux kernel, and is the recommended format for Meson's own `project(license: )` field
2023-10-04Remove unused code in interpreterbaseTristan Partin
2023-08-02Unify message(), format() and fstring formattingXavier Claessens
Share a common function to convert objects to display strings for consistency. While at it, also add support for formatting user options.
2023-06-14add new FeatureBroken check class for annotating features that are really brokenEli Schwartz
This is useful for totally terrible stuff that we really dislike, but for some reason we are afraid to just use `mlog.deprecation()` and unconditionally tell people so. Apparently this is because it is totally absolutely vital that, when telling people something is so broken they should never ever ever use it no matter what, ever... we can't actually tell them that unless they bump the minimum version of Meson, because that's our standard way of introducing a **version number** to tell them when we first started warning about this. Sigh. We really want to warn people if they are doing totally broken stuff no matter what version of Meson they support, because it's not like fixing the thing that never worked is going to suddenly break old versions of meson. So. Here's some new functionality that always warns you, but also tells you when we started warning.
2023-03-01interpreter: Add testcase..endtestcase clause supportXavier Claessens
This is currently only enabled when running unit tests to facilitate writing failing unit tests. Fixes: #11394
2022-02-14FeatureNew: add mypy type annotations for subproject argEli Schwartz
Use a derived type when passing `subproject` around, so that mypy knows it's actually a SubProject, not a str. This means that passing anything other than a handle to the interpreter state's subproject attribute becomes a type violation, specifically when the order of the *four* different str arguments is typoed.
2021-10-06interpreter: Move RangeHolder out of interpreterbase to interpreterDaniel Mensinger
2021-10-06interpreter: Holderify arrays and dictsDaniel Mensinger
This is the final refactoring for extracting the bultin object logic out of Interpreterbase. I decided to do both arrays and dicts in one go since splitting it would have been a lot more confusing.
2021-09-25Remove helpers.check_stringlist()Daniel Mensinger
2021-09-25interpreter: Introduce StringHolderDaniel Mensinger
Another commit in my quest to rid InterpreterBase from all higher level object processing logic. Additionally, there is a a logic change here, since `str.join` now uses varargs and can now accept more than one argument (and supports list flattening).
2021-09-01interpreter: Remove permissive from _unholderDaniel Mensinger
2021-08-31interpreter: Add IntegerHolderDaniel Mensinger
2021-08-31interpreter: Introduce operators support for InterpreterObjectsDaniel Mensinger
2021-08-30Simplify get_callee_argsXavier Claessens
2021-07-02fix: get_variable default variables are not ObjectHolders (fixes #8936)Daniel Mensinger
2021-06-26refactor: Refactor BothLibraries logicDaniel Mensinger
This commit introduces a new type of `HoldableObject`: The `SecondLevelHolder`. The primary purpose of this class is to handle cases where two (or more) `HoldableObject`s are stored at the same time (with one default object). The best (and currently only) example here is the `BothLibraries` class.
2021-06-18holders: remove unholderDaniel Mensinger
2021-06-18holders: Ensure that InterpreterBase is the sole instance for (un)holderifyingDaniel Mensinger
2021-06-18interpreter: Add a new MesonInterpreterObject for non-elementary objectsDaniel Mensinger
2021-06-11interpreter: Split decorators from interpreterbase.pyDaniel Mensinger
2021-06-11interpreter: Split Disabler from interpreterbase.pyDaniel Mensinger
2021-06-11interpreter: Split base objects and helpers from interpreterbase.pyDaniel Mensinger
2021-06-11interpreter: Split exception calsses from interpreterbase.pyDaniel Mensinger
2021-06-11interpreter: Move interpreterbase.py into a new packageDaniel Mensinger