diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2012-01-06 20:37:10 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2012-01-06 20:37:10 -0800 |
commit | 21eb30046e3993ffaf61fcb050702aaeb688fb8c (patch) | |
tree | 84e9692a07665ba0484da4e6fed33a57bf1d6388 /txr.1 | |
parent | 8cdbb92688207d0d9f3bcd37279f89a2cbcdf7a3 (diff) | |
download | txr-21eb30046e3993ffaf61fcb050702aaeb688fb8c.tar.gz txr-21eb30046e3993ffaf61fcb050702aaeb688fb8c.tar.bz2 txr-21eb30046e3993ffaf61fcb050702aaeb688fb8c.zip |
* match.c (fuzz_s): New symbol variable.
(v_fuzz): New static function.
(syms_init): fuzz_s initialized.
(dir_tables_init): v_fuzz entered into v_directive_table.
* txr.1: Documented @(fuzz).
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -1129,6 +1129,10 @@ Treat the remainder of the input as one big string, and apply the following query line to that string. The newline characters (or custom separators) appear explicitly in that string. +.IP @(fuzz) +The fuzz directive, inspired by the patch utility, specifies a partial +match for some lines. + .IP @(some) Multiple clauses are each applied to the same input. Succeeds if at least one of the clauses matches the input. The bindings established by earlier @@ -1620,6 +1624,25 @@ Example: @(coll)@{token /[^:]*/}:@(end) @(end) +.SS The Fuzz Directive + +The fuzz directive allows for an imperfect match spanning a set number of +lines. It takes two arguments, both expressions that should evaluate +to integers: + + @(fuzz m n) + ... + +This expresses that over the next n query lines, the matching strictness +is relaxed a little bit. Only m out of those n lines have to match. +Afterward, the rest of the query follows normal, strict processing. + +In the degenerate situation that there are fewer than n query lines following +the fuzz directive, then m of them must succeed nevertheless. (If there +are fewer than m, then this is impossible.) + +.B TXR's + .SS The Some, All, None, Maybe, Cases and Choose directives These directives, called the parallel directives, combine multiple subqueries, |