diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2011-09-23 14:49:00 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2011-09-23 14:49:00 -0700 |
commit | d11481b8cd38d63d21d50fb1b7fc9c49a7f21c0d (patch) | |
tree | 7dae5806116bab644503c2b29b1f4c8824d52368 /match.c | |
parent | b8b81379badbe9f5d91a10e521ac2985b5da4979 (diff) | |
download | txr-d11481b8cd38d63d21d50fb1b7fc9c49a7f21c0d.tar.gz txr-d11481b8cd38d63d21d50fb1b7fc9c49a7f21c0d.tar.bz2 txr-d11481b8cd38d63d21d50fb1b7fc9c49a7f21c0d.zip |
* match.c, parser.y: Support for old output syntax removed.
Leading :nothrow with trailing material is an error now.
* txr.1: Updated. Made note of errors in pipes being asynchronous.
Diffstat (limited to 'match.c')
-rw-r--r-- | match.c | 32 |
1 files changed, 14 insertions, 18 deletions
@@ -1408,29 +1408,25 @@ repeat_spec_same_data: goto repeat_spec_same_data; } else if (sym == output_s) { val specs = second(first_spec); - val old_style_dest = third(first_spec); - val new_style_dest = fourth(first_spec); - val nt = nil; + val dest_spec = third(first_spec); + val nothrow = nil; val dest; fpip_t fp; - if (old_style_dest) { - dest = cat_str(subst_vars(old_style_dest, bindings), nil); + if (eq(first(dest_spec), nothrow_k)) { + if (rest(dest_spec)) + sem_error(spec_linenum, lit("material after :nothrow in output"), nao); + dest = string(L"-"); } else { - if (eq(first(new_style_dest), nothrow_k)) - push(nil, &new_style_dest); + val form = first(dest_spec); + val val = eval_form(form, bindings); - { - val form = first(new_style_dest); - val val = eval_form(form, bindings); - - if (!val) - sem_error(spec_linenum, - lit("output: unbound variable in form ~a"), form, nao); + if (!val) + sem_error(spec_linenum, + lit("output: unbound variable in form ~a"), form, nao); - nt = eq(second(new_style_dest), nothrow_k); - dest = or2(cdr(val), string(L"-")); - } + nothrow = eq(second(dest_spec), nothrow_k); + dest = or2(cdr(val), string(L"-")); } fp = (errno = 0, complex_open(dest, t)); @@ -1438,7 +1434,7 @@ repeat_spec_same_data: debugf(lit("opening data sink ~a"), dest, nao); if (complex_open_failed(fp)) { - if (nt) { + if (nothrow) { debugf(lit("could not open ~a: " "treating as failed match due to nothrow"), dest, nao); return nil; |