From d771fc7d0b45f8fa66f6570720fba73941de67cd Mon Sep 17 00:00:00 2001 From: Peter Lesslie Date: Fri, 15 Apr 2022 15:02:14 -0500 Subject: Add support for multiline f-strings + 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. --- .../markdown/snippets/support-multiline-fstring.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 docs/markdown/snippets/support-multiline-fstring.md (limited to 'docs/markdown/snippets') diff --git a/docs/markdown/snippets/support-multiline-fstring.md b/docs/markdown/snippets/support-multiline-fstring.md new file mode 100644 index 0000000..296a04e --- /dev/null +++ b/docs/markdown/snippets/support-multiline-fstring.md @@ -0,0 +1,22 @@ +## Added support for multiline fstrings + +Added support for multiline f-strings which use the same syntax as f-strings +for string substition. + +```meson +x = 'hello' +y = 'world' + +msg = f'''Sending a message... +"@x@ @y@" +''' +``` + +which produces: + +``` +Sending a message.... + +"hello world" + +``` -- cgit v1.1