summaryrefslogtreecommitdiffstats
path: root/parser.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-11-07 20:16:14 -0800
committerKaz Kylheku <kaz@kylheku.com>2016-11-07 20:16:14 -0800
commit4af3611c835e9b6acb979987568f46ba86ef52e7 (patch)
treecf43610885a99da0944b7adeebccefd3815427dd /parser.c
parent1964f9aba361ae2a62be6829c0a95d91e930903c (diff)
downloadtxr-4af3611c835e9b6acb979987568f46ba86ef52e7.tar.gz
txr-4af3611c835e9b6acb979987568f46ba86ef52e7.tar.bz2
txr-4af3611c835e9b6acb979987568f46ba86ef52e7.zip
New #; syntax for erasing following object.
* parser.c (parser_circ_ref): Don't generate the circular reference if circular suppression is in effect. * parser.h (struct parser): New member, circ_suppress. We use this for suppressing the generation of circular #n# references in erased objects. * parser.l (grammar): Scan #; producing HASH_SEMI token. * parser.y (HASH_SEMI): New token. (hash_semis_n_expr, hash_semis_i_expr, ignored_i_exprs, ignored_n_exprs): New nonterminals, needed for supporting the use of #; in front of top-level forms. (spec): Use hash_semis_n_expr and hash_semis_i_expr instead of n_expr and i_expr. (r_expr): Support object erasure within nested syntax. (yybadtoken): Handle H_SEMI token. (parse): Initialize new circ_suppress member of parser struct to zero. * txr.1: Documented. * genvim.txr (txr_ign_par, txr_ign_bkt, txr_ign_par_interior, txr_ign_bkt_interior): New regions for colorizing erased objects (partial support). (txr_list, txr_bracket, txr_mlist, txr_mbrackets): Include erased objects by including regions txr_ign_par and txr_ign_bkt. * txr.vim, tl.vim: Regenerated.
Diffstat (limited to 'parser.c')
-rw-r--r--parser.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/parser.c b/parser.c
index 8817abe4..655ee8f1 100644
--- a/parser.c
+++ b/parser.c
@@ -375,7 +375,7 @@ val parser_circ_ref(parser_t *p, val num)
if (!obj)
yyerrorf(p->scanner, lit("dangling #~s# ref"), num, nao);
- if (obj == unique_s) {
+ if (obj == unique_s && !p->circ_suppress) {
p->circ_count++;
return cons(circref_s, cons(num, nil));
}