diff options
Diffstat (limited to 'doc/subexes.txt')
-rw-r--r-- | doc/subexes.txt | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/doc/subexes.txt b/doc/subexes.txt index decf30eef..54304f033 100644 --- a/doc/subexes.txt +++ b/doc/subexes.txt @@ -1,11 +1,11 @@ Substitution Expressions (subex) ================================ -A *subex* (*Substitution Expression*) represents an advanted string +A *subex* (*Substitution Expression*) represents an advanced string substitution. In contrast to a `regex`:idx: which deals with string analysis, a *subex* deals with string synthesis. -Thanks to its conditional construct ``$[0|1|2|else]`` it supports +Thanks to its conditional construct ``$[0|1|2|else]`` it supports `internationalization`:idx: of format string literals quite well. @@ -37,7 +37,7 @@ Notation meaning ``$[zero|one|def]1`` use ``X = parseInt(arg[1])`` to determine which branch to use. If ``X == 0`` the 'zero' branch is selected, if ``X == 1`` the 'one' branch is - selected, etc. Otherwise the 'def' branch is + selected, etc. Otherwise the 'def' branch is selected. ``$x`` is interpreted in branches too. If a branch needs to contain ``|``, ``]`` put them in single quotes. To produce a verbatim single @@ -50,12 +50,12 @@ Examples .. code-block:: nim subex"$1($', '{2..})" % ["f", "a", "b", "c"] == "f(a, b, c)" - + subex"$1 $[files|file|files]{1} copied" % ["1"] == "1 file copied" - + subex"$['''|'|''''|']']#" % "0" == "'|" - + subex("type\n TEnum = enum\n $', '40c'\n '{..}") % [ "fieldNameA", "fieldNameB", "fieldNameC", "fieldNameD"] - + |