summary refs log tree commit diff stats
path: root/lib/pure/coro.nim
diff options
context:
space:
mode:
authorshirleyquirk <31934565+shirleyquirk@users.noreply.github.com>2021-04-12 06:32:37 +0100
committerGitHub <noreply@github.com>2021-04-12 07:32:37 +0200
commit0bc943ad54d707f93d47a6d52bf7d445c45388d8 (patch)
treea120cdc72b96e554d78e08c07ea56b963915904c /lib/pure/coro.nim
parentcae183915490846a0ec7dbcd52b29a74c7c59f05 (diff)
downloadNim-0bc943ad54d707f93d47a6d52bf7d445c45388d8.tar.gz
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>
Diffstat (limited to 'lib/pure/coro.nim')
0 files changed, 0 insertions, 0 deletions