summaryrefslogtreecommitdiffstats
path: root/parser.y
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-08-17 19:50:49 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-08-17 19:50:49 -0700
commit49fa1df6a448459279cfcaa98f26f9d0d584a8ff (patch)
tree47527fdc50ec03908c33607566ed14571fe36af2 /parser.y
parentb5bcecee77e513b656973476dd7b76be9038b097 (diff)
downloadtxr-49fa1df6a448459279cfcaa98f26f9d0d584a8ff.tar.gz
txr-49fa1df6a448459279cfcaa98f26f9d0d584a8ff.tar.bz2
txr-49fa1df6a448459279cfcaa98f26f9d0d584a8ff.zip
parser: fix byacc regression related to hash-semi.
The "byacc_fool" rule needed a small update when in November 2016 it became involved in newly introduced #; (hash semicolon) syntax for commenting out. The problem is that when a top-level nested list expression is followed by #; then a byacc-generated parser throws a syntax error. This is because the byacc_fool production only generates a n_expr, or empty. Thus only those symbols are allowed which may begin a n_expr. The hash-semicolon token isn't one of them. * parser.y (byacc_fool): Add a production rule which generates a HASH_SEMI. Thus HASH_SEMI is now one of the terminals that may legally follow any sentential form that matches a byacc_fool rule after it.
Diffstat (limited to 'parser.y')
-rw-r--r--parser.y1
1 files changed, 1 insertions, 0 deletions
diff --git a/parser.y b/parser.y
index 92f223d4..95c8969b 100644
--- a/parser.y
+++ b/parser.y
@@ -221,6 +221,7 @@ hash_semi_or_i_expr : HASH_SEMI { parser->circ_suppress = 1; }
/* Hack needed for Berkeley Yacc */
byacc_fool : n_expr { internal_error("notreached"); }
+ | HASH_SEMI { internal_error("notreached"); }
| { internal_error("notreached"); }
;