summaryrefslogtreecommitdiffstats
path: root/parser.y
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2018-05-22 20:03:13 -0700
committerKaz Kylheku <kaz@kylheku.com>2018-05-22 20:03:13 -0700
commit42afde14b0e59de2e0f938806323dad9e2e5ed06 (patch)
tree3d00929c93994345382cc10dae674704cd5ef11a /parser.y
parenta580c45de5a825165f46d95206d9ac3c2c52fcd6 (diff)
downloadtxr-42afde14b0e59de2e0f938806323dad9e2e5ed06.tar.gz
txr-42afde14b0e59de2e0f938806323dad9e2e5ed06.tar.bz2
txr-42afde14b0e59de2e0f938806323dad9e2e5ed06.zip
txr: support variable in postive match.
In the @{var mod} syntax in the pattern language, allow mod to be a variable which contains a regex or integer, not just an integer or regex literal. * match.c (h_var): Check for modifier being a variable, and resolve it. * parser.y (modifiers): Allow a SYMTOK phrase. * txr.1: Documented.
Diffstat (limited to 'parser.y')
-rw-r--r--parser.y1
1 files changed, 1 insertions, 0 deletions
diff --git a/parser.y b/parser.y
index abc12d1c..a64d489b 100644
--- a/parser.y
+++ b/parser.y
@@ -788,6 +788,7 @@ modifiers : NUMBER { $$ = cons($1, nil); }
rlc($$, $1); }
| compound { $$ = rlc(cons(expand_meta($1, nil),
nil), $1); }
+ | SYMTOK { $$ = cons(symhlpr($1, nil), nil); }
;
o_var : SYMTOK { val expr = symhlpr($1, nil);