From 3739780b0e0a62f0c088d9413deb9d7bdfbe6700 Mon Sep 17 00:00:00 2001 From: Laurin-Luis Lehning <65224843+e820@users.noreply.github.com> Date: Sun, 7 Mar 2021 22:54:19 +0100 Subject: Add syntax documentation with tentative version target --- docs/markdown/Syntax.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/markdown/Syntax.md b/docs/markdown/Syntax.md index 5579855..e85c2cd 100644 --- a/docs/markdown/Syntax.md +++ b/docs/markdown/Syntax.md @@ -181,6 +181,22 @@ res = template.format('text', 1, true) As can be seen, the formatting works by replacing placeholders of type `@number@` with the corresponding argument. +*(Added 0.58)* + +Format strings can be used as a non-positional alternative to the +string formatting functionality described above. + +```meson +n = 10 +m = 'hi' + +s = f'int: @n@, string: @m@' +# s now has the value 'int: 10, string: hi' +``` + +Currently only identity-expressions are supported inside of format +strings. + ### String methods Strings also support a number of other methods that return transformed -- cgit v1.1