diff options
author | Flow-It <Flow-It@users.noreply.github.com> | 2020-05-01 21:02:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-01 22:02:17 +0300 |
commit | a124624c0e18a44cd51e49d020b30393dbe8bc9d (patch) | |
tree | 06b719593cbef8e9f169c1c1204c7ae3974caebe /mesonbuild/build.py | |
parent | d7c24ccddd13b4b36d63df1908cfa886f9fb7324 (diff) | |
download | meson-a124624c0e18a44cd51e49d020b30393dbe8bc9d.zip meson-a124624c0e18a44cd51e49d020b30393dbe8bc9d.tar.gz meson-a124624c0e18a44cd51e49d020b30393dbe8bc9d.tar.bz2 |
Document formal Meson grammar [skip ci]
* WIP: Document formal Meson grammar
* Various little fixes [skip ci]
1) Add missing logical_not_expr
2) 'in' and 'not in' are valid relational operators at least for dicts
3) dictionary keys can be expressions, but kwarg names cannot
4) typo logical_end_expression -> logical_and_expression
5) Make jump statements only allowed inside an iteration statement
* Rework EBNF style [skip ci]
As there is no good order for the productions, just go alphabetically.
The EBNF style was changed to match the one the Python lark project
uses, that is colons for productions and terminals enclosed in double
quotes.
* Add missing production for unary operators [skip ci]
* Add production for multiline strings [skip ci]
* Properly define terminal symbols [skip ci]
Depending on the EBNF flavor, regex can be used to describe the terminal
symbols. Lark allows this, and as it was mentioned as a possible user of
this grammar, let's follow its flavor here. Most regexes used are easily
human-readable, and we can always add comments to more complicated ones.
* Small changes to which expressions can be used where [skip ci]
Let the grammar be very general. The type system then has to check, that
the used expression really evaluates to the correct type. Even if we
know today that assignment expressions always evaluate to None (and can
therefore only be used as a toplevel expression in an expression
statement), this needn't be the case forever. So this way, the grammar
stays stable even if such changes were made.
* Rework function argument list production [skip ci]
* Be more verbose for production names [skip ci]
Rename expr -> expression, stmt -> statement, op -> operator, program ->
build_definition. Also adjust some list productions.
* Add paragraph about syntax stability promises [skip ci]
Diffstat (limited to 'mesonbuild/build.py')
0 files changed, 0 insertions, 0 deletions