aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/ast/printer.py
AgeCommit message (Collapse)AuthorFilesLines
2023-09-11raw printerCharles Brunet1-0/+219
this printer preserves all whitespaces and comments in original meson.build file. It will be useful for rewrite and potential auto-formatter
2023-09-11parser: use IdNode for foreach varnamesCharles Brunet1-2/+2
2023-09-11parser: use IdNode for function name and assignment nameCharles Brunet1-8/+8
2023-09-11parser: preserve escape chars in stringsCharles Brunet1-1/+11
use separate Node for multiline strings
2023-08-11treewide: automatic rewriting of all comment-style type annotationsEli Schwartz1-6/+6
Performed using https://github.com/ilevkivskyi/com2ann This has no actual effect on the codebase as type checkers (still) support both and negligible effect on runtime performance since __future__ annotations ameliorates that. Technically, the bytecode would be bigger for non function-local annotations, of which we have many either way. So if it doesn't really matter, why do a large-scale refactor? Simple: because people keep wanting to, but it's getting nickle-and-dimed. If we're going to do this we might as well do it consistently in one shot, using tooling that guarantees repeatability and correctness. Repeat with: ``` com2ann mesonbuild/ ```
2023-02-28refactor a few subsystem-relative imports that imported the wrong locationEli Schwartz1-1/+1
Inside of mesonbuild.ast.* we can and should import from .foobar, rather than importing from .__init__'s re-exported version of that object. Failing to do so results in an extremely brittle codebase where simply changing the order of lines in __init__.py can result in ImportError.
2023-02-01treewide: add future annotations importEli Schwartz1-0/+1
2022-10-03pylint: enable unnecessary-comprehensionDylan Baker1-2/+1
2022-09-07Fixed string escaping in AstPrinterVolker Weißmann1-1/+5
2022-05-24ast: cmake: Generate line numbers while printing the AST for better debuggingDaniel Mensinger1-1/+30
2021-07-25ast: Add dummy "support" for fstrings in the ast packageDaniel Mensinger1-0/+7
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.
2020-05-23ast: Add AST JSON printerDaniel Mensinger1-1/+159
2020-03-02types: Remove redundant __init__() -> None annotationDaniel Mensinger1-1/+1
2020-03-02types: Annotate the AST visitorsDaniel Mensinger1-37/+34
2020-03-02types: Annotate mparser.pyDaniel Mensinger1-5/+2
This also fixes that the keys in ArgumentNode.kwargs are all of the type BaseNode now. Before this commit, it was possible that both strings and Nodes where used as keys.
2019-12-10assert(): Make message argument optionalXavier Claessens1-2/+5
2019-06-28ast: printer fix index node printingDaniel Mensinger1-1/+2
2019-04-25ast/printer: remove useless ternaryDylan Baker1-1/+1
The ternary returns True or False from an expression that returns True or False: i.e. True if bool(value) else False.
2019-01-24Fixed style issuesDaniel Mensinger1-14/+14
2019-01-22Can now rewrite filesDaniel Mensinger1-2/+14
2019-01-22AST post processingDaniel Mensinger1-64/+45
2019-01-22Added Ast printerDaniel Mensinger1-2/+190
2019-01-22Basic AST visitor patternDaniel Mensinger1-0/+22