Files
Nim/tests/stdlib
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
..
2020-12-27 14:45:57 +01:00
2020-10-29 18:12:14 +01:00
2020-10-30 09:55:21 +01:00
2020-09-21 12:21:05 +02:00
2020-11-13 16:15:13 +08:00
2020-12-28 14:13:21 +01:00
2020-11-05 14:00:49 +01:00
2021-03-23 10:49:02 +01:00
2020-03-23 15:47:10 +01:00
2021-01-07 19:16:26 +01:00
2020-12-28 14:13:21 +01:00
2020-04-03 09:03:13 +02:00
2020-12-28 14:13:21 +01:00
2021-01-05 20:51:51 +01:00
2020-12-28 14:13:21 +01:00
2020-12-28 14:13:21 +01:00
2021-03-26 13:05:51 +01:00
2021-01-29 15:14:19 +01:00
2021-03-24 08:16:41 +01:00
2021-04-06 16:21:58 +02:00
2021-03-23 08:33:09 +01:00
2020-12-28 14:13:21 +01:00
2020-12-29 13:27:08 +01:00
2020-11-23 19:53:57 +01:00
2020-12-27 14:45:57 +01:00
2020-12-27 14:45:57 +01:00
2019-05-16 21:06:04 +02:00
2021-01-15 18:56:38 -08:00
2020-11-24 19:06:41 +01:00
2017-05-04 22:25:29 +02:00
2020-12-28 14:13:21 +01:00
2020-12-28 14:13:21 +01:00
2020-12-28 14:13:21 +01:00
2021-01-22 19:51:11 +01:00
2021-02-12 17:13:39 +01:00
2021-02-06 17:33:11 +01:00
2020-10-18 12:57:13 -04:00
2021-02-22 19:58:37 +01:00
2020-12-28 14:13:21 +01:00
2021-04-10 09:49:01 +02:00
2021-03-08 10:39:39 +01:00
2020-11-24 19:06:41 +01:00
2020-11-13 08:11:00 +01:00
2018-12-11 21:23:21 +01:00
2020-11-24 19:06:41 +01:00
2020-11-24 19:06:41 +01:00
2020-12-28 14:13:21 +01:00
2020-12-28 14:13:21 +01:00
2021-02-09 13:04:36 +01:00
2020-12-28 14:13:21 +01:00
2020-12-28 14:13:21 +01:00
2021-04-09 11:51:51 +02:00
2020-07-12 03:31:03 -04:00
2020-12-28 14:13:21 +01:00
2020-11-24 19:06:41 +01:00
2021-03-29 11:48:06 -07:00
2020-10-18 12:57:13 -04:00
2018-04-30 11:16:56 +02:00
2020-12-28 14:13:21 +01:00
2021-04-06 16:21:58 +02:00