| Age | Commit message (Collapse) | Author |
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
This avoids creating a dictionary every time an arithmetic operator
is evaluated.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
|
|
|
this will allow transforming string types in the formater
|
|
|
|
|
|
In #02ff955, I used the word `columns` instead of `colons`, but the
meaning really was about the ':' symbol.
|
|
- Wrong types were used for MultilineStringNode and
FormatMultilineStringNode
- Simplify the `escape` method to avoid use of T.Cast
|
|
|
|
|
|
Other than one case that I think cannot be actually hit (or it would
fail).
|
|
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
|
|
this printer preserves all whitespaces and comments in original meson.build file. It will be useful for rewrite and potential auto-formatter
|
|
|
|
|
|
use separate Node for multiline strings
|
|
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/
```
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
The ternary returns True or False from an expression that returns True
or False: i.e. True if bool(value) else False.
|
|
|
|
|
|
|
|
|
|
|