diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2014-03-15 12:50:30 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2014-03-15 12:50:30 -0700 |
commit | 122b39ad1a2404987157f78ff39a23a4ebb9bbad (patch) | |
tree | cd169fff6ee804115c907862e847890814e08335 | |
parent | a8b0e36b1760e51a8a3a25d4e22a325e407ef3d4 (diff) | |
download | txr-122b39ad1a2404987157f78ff39a23a4ebb9bbad.tar.gz txr-122b39ad1a2404987157f78ff39a23a4ebb9bbad.tar.bz2 txr-122b39ad1a2404987157f78ff39a23a4ebb9bbad.zip |
* parser.y (text): Allow the EMPTY token (the @(empty) syntax)
to be a text.
* txr.1: Documented @(empty).
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | parser.y | 2 | ||||
-rw-r--r-- | txr.1 | 6 |
3 files changed, 14 insertions, 1 deletions
@@ -1,3 +1,10 @@ +2014-03-15 Kaz Kylheku <kaz@kylheku.com> + + * parser.y (text): Allow the EMPTY token (the @(empty) syntax) + to be a text. + + * txr.1: Documented @(empty). + 2014-03-14 Kaz Kylheku <kaz@kylheku.com> * parser.l (regex_parse, lisp_parse): Fix neglected handling of @@ -334,7 +334,6 @@ else_clause_opt : ELSE newl | { $$ = nil; } ; - line : elems_opt '\n' { $$ = $1; } ; @@ -363,6 +362,7 @@ text : TEXT { $$ = rl(string_own($1), num(lineno)); } | regex { $$ = cons(regex_compile(rest($1), nil), rest($1)); rl($$, num(lineno)); } + | EMPTY { $$ = null_string; } ; texts : text %prec LOW { $$ = rlcp(cons($1, nil), $1); } @@ -1315,6 +1315,12 @@ which translates to a combination of @(cases) and @(require) Multiple clauses are applied to the same input. The one whose effect persists is the one which maximizes or minimizes the length of a particular variable. +.IP @(empty) +The @(empty) directive matches the empty string. It is useful in certain +situations, such as expressing an empty match in a directive that doesn't +accept an empty clause. The @(empty) syntax has another meaning in +@(output) clauses, in conjunctio with @(repeat). + .IP "@(define NAME ( ARGUMENTS ...))" Introduces a function. Functions are discussed in the FUNCTIONS section below. |