diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2014-10-15 19:05:43 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2014-10-15 19:05:43 -0700 |
commit | 8eb4688b095bbdadfa05d0b853df662ac653e3d5 (patch) | |
tree | cfd3e5f2be60de09793cea305ad4a68f1a4e5866 /txr.1 | |
parent | 8807a16fe3115e19ce4d65f1c8beb476494ccaec (diff) | |
download | txr-8eb4688b095bbdadfa05d0b853df662ac653e3d5.tar.gz txr-8eb4688b095bbdadfa05d0b853df662ac653e3d5.tar.bz2 txr-8eb4688b095bbdadfa05d0b853df662ac653e3d5.zip |
* match.c (subst_vars): Fix buggy rendering of TXR Lisp expressions
that evaluate to lists. For instance `@(list)` renders to the
string "nil", and `@(list 1 2)` renders as "(1 2)". The desired
behavior is "" and "1 2", respectively.
(do_output_line): In output directives, there is a similar problem.
A @(list) in the middle of an output block turns to nil, and
a @(list 1 2) renders in parentheses as (1 2). Furthermore,
there is the additional problem that no filtering is applied
to the interpolated value. These behaviors are subject to the
compatibility option, since they change the externally visible
behavior of TXR programs.
* txr.1: Document that empty lists in @(output) variable substitutions
turn into nothing. Document value of 100 for -C option, describing
the above issue.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -6731,6 +6731,7 @@ A list is converted to a string in a special way: the elements are individually converted to a string and then they are catenated together. The default separator string is a single space: an alternate separation can be specified as an argument in the brace substitution syntax. +Empty lists turn into an empty string. Lists may be output within .code @(repeat) @@ -25322,6 +25323,20 @@ can be emulated is \*(TX 97. Here are values which have a special meaning as arguments to the .code -C option, along with a description of what behaviors are affected: +.IP 99 +Up to \*(TX 99, the substitution of TXR Lisp expressions in +.code @(output) +directives and in the quasistrings of the pattern language +exhibited the buggy behavior that if the TXR Lisp expression +produced a list, the list was rendered as a parenthesized +representation, or the text +.code nil +in the empty list case. Moreover, in the +.code @(output) +case, the value of TXR Lisp expressions was not subject to filtering. +Starting with \*(TX 100, these issues +are fixed, making the the behavior is consistent with +the behavior of TXR Lisp quasiliterals. .IP 97 Up to \*(TX 97, the error exception symbols such as .code file-error |