summaryrefslogtreecommitdiff
path: root/docs/markdown/Syntax.md
AgeCommit message (Collapse)Author
2025-03-26docs: Clarify string building with absolute pathsPaul Caprioli
2023-09-11raw printerCharles Brunet
this printer preserves all whitespaces and comments in original meson.build file. It will be useful for rewrite and potential auto-formatter
2023-08-31Document that dicts can be indexed with []Bruce Merry
2023-07-28docs: clarify what str.split doesEli Schwartz
The wording was a bit confusing and misled at least one person into thinking it behaved like `str.replace('c', '')` operating on the entire line. Tweak the wording to be more precise and avoid this confusion.
2023-04-11fix various spelling issuesJosh Soref
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-03-02doc: remove unexisting operators from grammarCharles Brunet
2023-02-27documentation: there is no unary + operatorCharles Brunet
2022-11-02Document binary literals.Garrett D'Amore
2022-05-01Add support for multiline f-stringsPeter Lesslie
+ Extend the parser to recognize the multiline f-strings, which the documentation already implies will work. The syntax is like: ``` x = 'hello' y = 'world' msg = f'''This is a multiline string. Sending a message: '@x@ @y@' ''' ``` which produces: ``` This is a multiline string. Sending a message: 'hello world' ``` + Added some f-string tests cases to "62 string arithmetic" to exercise the new behavior.
2022-04-15Add note in docs that multiline f-strings are not supportedPeter Lesslie
Companion to https://github.com/mesonbuild/meson/pull/10284
2022-04-07docs: Document argument flatteningDaniel Mensinger
2021-10-10Fix typos discovered by codespellChristian Clauss
2021-10-03docs: Fix broken linksDaniel Mensinger
2021-10-03docs: Fixes found during the YAML conversion processDaniel Mensinger
2021-09-30doc: document string.strip() optional argument [skip ci]Stone Tickle
2021-09-25Remove helpers.check_stringlist()Daniel Mensinger
2021-08-31Make assignment a statement in Syntax.md (#9188) [skip-ci]jimman2003
* Make assignment a statement in Syntax force to change line 709 to something kind of non sensical * Applied code review changes
2021-04-28doc: update syntax description of immutabilityAlexander Lyashuk
"Stored by value" is more correct way to explain that example. Mutable vs immutable means that you cannot mutate the value (e.g. list vs tuple in Python), and the example shows that `var2` is actually mutable. Copying/storing a reference vs value is what what matters in the assignment, in Python `a=b` means `a` and `b` are references to the same list, while in meson `a=b` copies the value of `b` into `a`.
2021-04-06docs: document bool to_int and to_string methodsSimon Ser
This documents the bool methods to_int and to_string implemented in [1]. [1]: https://github.com/mesonbuild/meson/blob/a9e9b7c7501a3c8a5984a93879d1f309bf8c72aa/mesonbuild/interpreterbase.py#L1109
2021-03-10Some documentation language adjustments & improved error messagesLaurin-Luis Lehning
2021-03-10Yet another documentation updateLaurin-Luis Lehning
2021-03-10Add syntax documentation with tentative version targetLaurin-Luis Lehning
2021-03-09Add str.replace() methodTristan Partin
2021-01-30Rewrap long text lines in docs. [skip ci]Jussi Pakkanen
2021-01-23docs: Fix typo in Syntax.md [skip ci]Evgeny Ermakov
2020-10-22Syntax.md: Fix variable used in substring exampleDanilo Spinella
2020-09-21docs: Clarify what literal strings mean [skip ci]Nirbheek Chauhan
Someone on IRC was confused by this paragraph.
2020-07-20string: add substring methodStéphane Cerveau
This method aims to offer a simple way to 'substring' an existing string with start and end values.
2020-06-28syntax.md: document version_compare ambiguities [skip ci]Michael Hirsch, Ph.D
2020-06-28syntax.md: correct markdown heading syntax [skip ci]Michael Hirsch, Ph.D
2020-06-24docs: Document string path building with examplesNirbheek Chauhan
Also document that line continuation didn't work before 0.50. 90c9b868b20b11bb089fc5e0c634d5ed76fea0cb fixed it.
2020-05-01Document formal Meson grammar [skip ci]Flow-It
* 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]
2019-12-04dict: Fully evaluate keysXavier Claessens
The only restriction is keys must be string after evaluation. This fix various inconsistencies.
2019-09-03docs/syntax: fix typo in dict example [skip ci]Nirbheek Chauhan
2019-09-03docs/syntax: Document that dicts are unordered [skip ci]Nirbheek Chauhan
2019-07-26note that integers have .to_string() method [skip ci]Michael Hirsch, Ph.D
2019-05-22join_paths => / [skip ci]Michael Hirsch, Ph.D
2019-04-28consistent invalid escape sequence behaviourJon Turney
* docs: document unrecognized escape sequence behaviour [skip ci] Document that unrecognized escape sequence behaviour is like python, not C. * Don't try to decode invalid hex escape sequences Don't try to decode escape sequences which should contain a sequence of hex digits, but don't, throwing a python exception. These will treated literally instead. * Extend test case to cover invalid escape sequences
2018-12-19docs: Add warning about not using join_paths() with build targets [skip ci]Dylan Baker
This comes up now and again when people try do do something like: meson.build: ```meson my_sources = ['foo.c'] subdir('subdir') executable('foo', my_sources) ``` subdir/meson.build: ```meson my_sources += ['bar.c'] ```
2018-12-04Can specify keyword arguments with a dict.Jussi Pakkanen
2018-10-04Add documentation and release notes for 'in', 'continue' and 'break'Xavier Claessens
2018-09-20syntax guide: move logical ops section beside if statement [skip ci]Bruce Richardson
The "if" statement only covers a small set of the possible ways in which conditionals can be written, since it leaves the use of "and", "or" and "not" to the "Logical Operations" section. However, this is likely to be of interest to those reading about "if" statments, so move the "logical operations" section up to immediately follow it. This change also puts in the use of the "!=" operator in the example to widen the variety of combinations shown.
2018-06-06docs: Fix dictionary syntax [skip ci]Yudi Matsuzake
2018-05-23Document octal and binary integer literals in syntax.Filipe Brandenburger
Also add a release notes snippet for it.
2018-05-22dict: add since annotationsMathieu Duponchelle
2018-05-20dict: Document, add release snippetMathieu Duponchelle
2018-04-21Add more tests for multi-line strings and update docsNirbheek Chauhan
2018-04-17Complete python escape sequences aware stringsTim 'mithro' Ansell
Fixes #3169
2018-02-05Add support for hex int literals.Jussi Pakkanen
2017-11-19Fix literal backslash syntaxLucas Werkmeister
In CommonMark, there are no backslash escapes in code spans, so only two backslashes in the source document are necessary to produce two backslashes in the output document.