diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2009-11-18 22:02:02 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2009-11-18 22:02:02 -0800 |
commit | 9eddf1e4e0482ca8db81fcc4411fadd01190476c (patch) | |
tree | 48b39075e79160429c39f7e98fbfe2e0d1a70deb | |
parent | e4edb9aff778c683d81892cca705013dbe5dcc58 (diff) | |
download | txr-9eddf1e4e0482ca8db81fcc4411fadd01190476c.tar.gz txr-9eddf1e4e0482ca8db81fcc4411fadd01190476c.tar.bz2 txr-9eddf1e4e0482ca8db81fcc4411fadd01190476c.zip |
* match.c (match_line, match_files): Fix broken behavior of collect
that doesn't match anything.
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | match.c | 8 |
2 files changed, 13 insertions, 7 deletions
@@ -1,6 +1,16 @@ 2009-11-18 Kaz Kylheku <kkylheku@gmail.com> - parser.l (yyerror): Total breakage: can't take auto_str of char * + * match.c (match_line, match_files): Fix broken behavior of collect + that doesn't match anything. It is not a failed match, as the + documentation makes perfectly clear. Collect/coll were introduced + in txr-006 and had the proper non-failing semantics. + However, in txr-015, during code restructuring, a bug crept in. + When changing to a different debugiging function, for some reason + I added the nil returns. + +2009-11-18 Kaz Kylheku <kkylheku@gmail.com> + + * parser.l (yyerror): Total breakage: can't take auto_str of char * string. (yyerrorf): Total breakage: arguments of wrong types. Detected by vformat as garbage. @@ -471,10 +471,8 @@ obj_t *match_line(obj_t *bindings, obj_t *specline, obj_t *dataline, } - if (!bindings_coll) { + if (!bindings_coll) debuglf(spec_lineno, lit("nothing was collected"), nao); - return nil; - } for (iter = bindings_coll; iter; iter = cdr(iter)) { obj_t *pair = car(iter); @@ -1289,10 +1287,8 @@ repeat_spec_same_data: return nil; } - if (!bindings_coll) { + if (!bindings_coll) debuglf(spec_linenum, lit("nothing was collected"), nao); - return nil; - } for (iter = bindings_coll; iter; iter = cdr(iter)) { obj_t *pair = car(iter); |