From 090f4dee78f7a7239ebd515993412f9505001fa9 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 3 Oct 2014 07:34:44 -0700 Subject: * match.c (h_var): Fix regression introduced in 2014-08-11 commit. The incompleteness of that change broke the case of an unbound variable followed by a bound variable. The value of the second variable was still being wrapped in the old complicated representation before being pushed to the front of the spec. * txr.1: Replace bogus text which says that variables are not bound to regexes, and so regex matches from variable substitutions do not arise. This works fine after this change. --- txr.1 | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'txr.1') diff --git a/txr.1 b/txr.1 index c63ec922..db133137 100644 --- a/txr.1 +++ b/txr.1 @@ -1441,8 +1441,24 @@ seems to have dubious value). An unbound variable may be followed by one which is bound. The bound variable is replaced by the text which it denotes, and the logic proceeds -accordingly. Variables are never bound to regular expressions, so -the regular expression match does not arise in this case. +accordingly. + +It is possible for a variable to be bound to a regular expression. +If +.code x +is an unbound variable and +.code y +is bound to a regular expression +.codn RE , +then +.code @x@y +means +.codn @x@/RE/ . +A variable +.code v +can be bound to a regular expression using, for example, +.codn @(bind v #/RE/) . + The .code @* syntax for longest match is available. Example: -- cgit v1.2.3