aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/ast
AgeCommit message (Collapse)AuthorFilesLines
2022-03-13Merge pull request #9339 from dcbaker/submit/structured_sourcesJussi Pakkanen2-1/+2
Structured Sources
2022-03-07treewide: string-quote the first argument to T.castEli Schwartz1-6/+8
Using future annotations, type annotations become strings at runtime and don't impact performance. This is not possible to do with T.cast though, because it is a function argument instead of an annotation. Quote the type argument everywhere in order to have the same effect as future annotations. This also allows linters to better detect in some cases that a given import is typing-only.
2022-03-07build: plumb structured sources into BuildTargetsDylan Baker1-1/+1
2022-03-07interpreter: add an implementation for structured_sourcesDylan Baker1-0/+1
2021-12-01add install_symlink functionPablo Correa Gómez1-0/+1
Allows installing symlinks directly from meson, which can become useful in multiple scenarios. Current main use is to help moving forward #9557
2021-10-08add install_emptydir functionEli Schwartz1-0/+1
This replaces the absolute hack of using ``` install_subdir('nonexisting', install_dir: 'share') ``` which requires you to make sure you don't accidentally or deliberately have a completely different directory with the same name in your source tree that is full of files you don't want installed. It also avoids splitting the name in two and listing them in the wrong order. You can also set the install mode of each directory component by listing them one at a time in order, and in fact create nested structures at all. Fixes #1604 Properly fixes #2904
2021-10-06interpreter: Holderify arrays and dictsDaniel Mensinger1-5/+14
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-25interpreter: Introduce StringHolderDaniel Mensinger1-1/+2
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: Introduce BooleanHolder for the bool primitiveDaniel Mensinger1-1/+2
2021-08-31interpreter: Add IntegerHolderDaniel Mensinger1-1/+2
2021-08-31pylint: turn on superflous-parensDylan Baker2-7/+7
We have a lot of these. Some of them are harmless, if unidiomatic, such as `if (condition)`, others are potentially dangerous `assert(...)`, as `assert(condtion)` works as expected, but `assert(condition, message)` will result in an assertion that never triggers, as what you're actually asserting is `bool(tuple[2])`, which will always be true.
2021-08-16Add unset_variable()Tristan Partin1-0/+1
This should be useful for helping to control variable scope within Meson. CMake has something similar for controlling scope.
2021-07-25ast: Add dummy "support" for fstrings in the ast packageDaniel Mensinger3-0/+14
2021-06-29fix: Always explicitly set encoding for text files (fixes #8263)Daniel Mensinger1-1/+1
2021-06-25Split compiler detection from EnvironmentDaniel Mensinger1-1/+2
This moves all the compiler detection logic into the new compilers.detect module. This dramatically reduces the size and complexity of Environment.
2021-06-18holders: Fix the remaining code to respect the holder changesDaniel Mensinger1-0/+9
2021-06-18interpreter: Add a new MesonInterpreterObject for non-elementary objectsDaniel Mensinger1-10/+20
2021-06-16Fix assert(not true) raising backtraceXavier Claessens1-1/+1
When no message is provided to assert(), it uses the ast printer to show the condition that failed. In this case the 'not' is the first string appended to the result, self.result[-1] would raise range error.
2021-03-16Add range() functionXavier Claessens1-0/+1
Fixes: #5026.
2021-03-06Refactor subdir visitation to track files instead of dirs.Jussi Pakkanen1-6/+7
2021-03-04mass rewrite of string formatting to use f-strings everywhereEli Schwartz1-2/+2
performed by running "pyupgrade --py36-plus" and committing the results
2021-01-04Use a single coredata dictionary for optionsDylan Baker1-2/+2
This patches takes the options work to it's logical conclusion: A single flat dictionary of OptionKey: UserOptions. This allows us to simplify a large number of cases, as we don't need to check if an option is in this dict or that one (or any of 5 or 6, actually).
2021-01-04move OptionKey to mesonlibDylan Baker1-2/+2
There's starting to be a lot of things including coredata that coredata needs to itself include. putting it in mesonlib makes more sense
2021-01-04use new optionkey.is_* methodsDylan Baker1-1/+1
2021-01-04use the OptionKey type for command line and machine filesDylan Baker1-3/+3
2020-10-16Refactor handling of machine file optionsXavier Claessens1-1/+1
It is much easier to not try to parse options into complicated structures until we actually collected all options: machine files, command line, project()'s default_options, environment.
2020-10-15intro: Add extra_files key to intro output (fixes #7310)Daniel Mensinger1-29/+39
2020-09-24ast/introspection: Fix typing violation due to untyped functionsDylan Baker1-7/+8
When we add type annotations to this in compilers this will break, unless we've already filtered out the non-string arguments.
2020-09-09Merge pull request #7657 from mensinda/moreTypingDylan Baker4-16/+25
typing: Strict type annotations
2020-09-09Merge pull request #7428 from jon-turney/introspector-add-languagesJussi Pakkanen1-12/+21
Handle add_languages(native:) in introspector
2020-09-09Implement add_languages(native:) in introspectorJon Turney1-2/+7
2020-09-08typing: fixup for #7708Daniel Mensinger1-1/+5
2020-09-08typing: fix LGTM bot errorDaniel Mensinger1-0/+4
2020-09-08typing: fix code reviewDaniel Mensinger1-1/+1
2020-09-08typing: more fixesDaniel Mensinger1-1/+2
2020-09-08typing: completely type astDaniel Mensinger3-7/+7
2020-09-08typing: refactor dict handlingDaniel Mensinger1-8/+8
2020-09-08IntrospectInterpreter: allow dictionaries with nonconstant keysPaolo Bonzini1-0/+10
Something like {a: foo} currently stymies the IntrospectionInterpreter and breaks introspection of the source directory. The fix is just to walk the keys and return a dummy dictionary. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-08Factor out an _add_languages() function in introspectorJon Turney1-11/+15
Factor out an _add_languages() function in introspector, rather than calling func_add_languages() with arguments crafted to fake an interpreter call.
2020-08-01Put machine file and cmd line parsing in EnvironmentDylan Baker1-1/+1
This creates a full set of option in environment that mirror those in coredata, this mirroring of the coredata structure is convenient because lookups int env (such as when initializing compilers) becomes a straight dict lookup, with no list iteration. It also means that all of the command line and machine files are read and stored in the correct order before they're ever accessed, simplifying the logic of using them.
2020-05-23ast: Handle NotNodeDaniel Mensinger1-0/+5
2020-05-23ast: Add AST JSON printerDaniel Mensinger3-4/+162
2020-03-19interpreterbase: Add warning when built-in object method has no kwargsXavier Claessens1-5/+6
2020-03-08Merge pull request #6736 from dcbaker/mesonlib-type-annotationsJussi Pakkanen1-2/+2
Mesonlib type annotations
2020-03-06ast: Implement dummy evaluate_notstatementDaniel Mensinger1-0/+5
2020-03-06ast: Do not resolve dict keysXavier Claessens1-1/+1
Fixes: #6748
2020-03-05mesonbuild/mesonlib: Add type annotationsDylan Baker1-2/+2
2020-03-02types: Remove redundant __init__() -> None annotationDaniel Mensinger5-8/+8
2020-03-02types: Use import typing as TDaniel Mensinger2-26/+26
2020-03-02review: Initial fixupDaniel Mensinger1-5/+5