Files
Nim/lib/pure
shirleyquirk 0bc943ad54 followup strformat PR. backslash escapes, tests, docs (#17700)
* Allow use of colons inside fmt
allowing colons inside fmt by replacing the format specifier delimiter lets arbitrary nim code be run within fmt expressions.

Co-authored-by: flywind <xzsflywind@gmail.com>

* formatting,documentation,backslash escapes

Adding support for evaluating expressions by special-casing parentheses causes this regression: `&"""{ "(hello)" }"""` no longer parses.
In addition, code such as &"""{(if open: '(' else: ')')}""" wouldn't work.
To enable that, as well as the use of, e.g. Table constructors inside curlies, I've added backslash escapes.
This also means that if/for/etc statements, unparenthesized, will work, if the colons are escaped, but i've left that under-documented.

It's not exactly elegant having two types of escape, but I believe it's the least bad option.

* changelog
* added json strformat test
* pulled my thumb out and wrote a parser

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
Co-authored-by: flywind <xzsflywind@gmail.com>
2021-04-12 07:32:37 +02:00
..
2021-03-10 10:39:23 -08:00
2021-03-23 20:18:36 +01:00
2021-02-23 21:05:39 -08:00
2021-02-23 21:05:39 -08:00
2015-10-01 12:05:45 -07:00
2021-02-23 21:05:39 -08:00
2021-04-09 16:29:10 +02:00
2021-04-08 14:08:58 +02:00
2018-04-06 11:59:49 +02:00
2021-01-09 00:24:41 +01:00
2021-02-18 22:47:21 -08:00
2021-03-10 10:39:23 -08:00
2021-03-10 10:39:23 -08:00
2021-03-29 13:06:23 +02:00
2021-04-06 22:08:59 +02:00
2021-04-02 00:18:40 -07:00
2021-03-10 10:39:23 -08:00
2021-02-24 21:47:27 -08:00
2021-02-24 21:47:27 -08:00
2021-02-21 00:27:39 -08:00
2021-02-06 17:33:11 +01:00
2021-02-22 19:58:37 +01:00
2021-02-21 00:27:39 -08:00
2021-02-21 00:27:39 -08:00
2021-02-22 09:40:11 +01:00
2021-03-10 10:39:23 -08:00
2021-04-02 22:06:29 +02:00
2021-03-29 11:48:06 -07:00
2021-02-08 09:46:07 +01:00
2020-11-23 19:53:57 +01:00