diff options
author | shirleyquirk <31934565+shirleyquirk@users.noreply.github.com> | 2021-04-12 06:32:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-12 07:32:37 +0200 |
commit | 0bc943ad54d707f93d47a6d52bf7d445c45388d8 (patch) | |
tree | a120cdc72b96e554d78e08c07ea56b963915904c /lib/pure/coro.nim | |
parent | cae183915490846a0ec7dbcd52b29a74c7c59f05 (diff) | |
download | Nim-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