diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2019-08-18 11:47:03 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2019-08-18 11:47:03 -0700 |
commit | 564fd080c753f20ce16c321c6ff94ae28a468df4 (patch) | |
tree | 1cd8738c011a6ffec77fa1f157001d6dd88f615d /parser.y | |
parent | f35b7f1f7df5b61ab54674f88c1eea1ffbe6b908 (diff) | |
download | txr-564fd080c753f20ce16c321c6ff94ae28a468df4.tar.gz txr-564fd080c753f20ce16c321c6ff94ae28a468df4.tar.bz2 txr-564fd080c753f20ce16c321c6ff94ae28a468df4.zip |
parser: rename circ_suppress flag.
* parser.h (struct parser): eof flag changed to unsigned char.
circ_suppress flag renamed to ignore, changed to unsigned char
and relocated next to eof to compact together.
* parser.c (parser_circ_ref): Follow rename.
* parser.y (hash_semi_or_n_expr, hash_semi_or_i_expr, n_exprs,
parse): Likewise.
Diffstat (limited to 'parser.y')
-rw-r--r-- | parser.y | 26 |
1 files changed, 13 insertions, 13 deletions
@@ -198,21 +198,21 @@ spec : clauses_opt { parser->syntax_tree = $1; } ; -hash_semi_or_n_expr : HASH_SEMI { parser->circ_suppress = 1; } - n_expr { parser->circ_suppress = 0; +hash_semi_or_n_expr : HASH_SEMI { parser->ignore = 1; } + n_expr { parser->ignore = 0; $$ = nao; } - | HASH_SEMI '.' { parser->circ_suppress = 1; } - n_expr { parser->circ_suppress = 0; + | HASH_SEMI '.' { parser->ignore = 1; } + n_expr { parser->ignore = 0; $$ = nao; } | n_expr { $$ = $1; } | '.' n_expr { $$ = uref_helper(parser, $2); } ; -hash_semi_or_i_expr : HASH_SEMI { parser->circ_suppress = 1; } - i_expr { parser->circ_suppress = 0; +hash_semi_or_i_expr : HASH_SEMI { parser->ignore = 1; } + i_expr { parser->ignore = 0; $$ = nao; } - | HASH_SEMI '.' { parser->circ_suppress = 1; } - i_expr { parser->circ_suppress = 0; + | HASH_SEMI '.' { parser->ignore = 1; } + i_expr { parser->ignore = 0; $$ = nao; } | i_expr { $$ = $1; } | '.' i_expr { $$ = uref_helper(parser, $2); } @@ -910,11 +910,11 @@ n_exprs : r_exprs { val term_atom = pop(&$1); r_exprs : n_expr { val exprs = cons($1, nil); rlc(exprs, $1); $$ = rlc(cons(unique_s, exprs), exprs); } - | HASH_SEMI { parser->circ_suppress = 1; } - n_expr { parser->circ_suppress = 0; + | HASH_SEMI { parser->ignore = 1; } + n_expr { parser->ignore = 0; $$ = cons(unique_s, nil); } - | r_exprs HASH_SEMI { parser->circ_suppress = 1; } - n_expr { parser->circ_suppress = 0; + | r_exprs HASH_SEMI { parser->ignore = 1; } + n_expr { parser->ignore = 0; $$ = $1; } | r_exprs n_expr { uses_or2; val term_atom_cons = $1; @@ -1882,10 +1882,10 @@ int parse(parser_t *parser, val name, enum prime_parser prim) parser->errors = 0; parser->eof = 0; + parser->ignore = 0; parser->prepared_msg = nil; parser->circ_ref_hash = nil; parser->circ_count = 0; - parser->circ_suppress = 0; parser->syntax_tree = nil; parser->quasi_level = 0; |