summaryrefslogtreecommitdiffstats
path: root/parser.y
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-08-22 06:10:11 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-08-22 06:10:11 -0700
commita9a7efc1790c6ebe663107fbf10c8b72cd76b91b (patch)
treeec9b5bbe81513adeef3328623266dacadc14d5c5 /parser.y
parent5edadcdff0d80ceb5639dc31bbe7c2b43a1d2782 (diff)
downloadtxr-a9a7efc1790c6ebe663107fbf10c8b72cd76b91b.tar.gz
txr-a9a7efc1790c6ebe663107fbf10c8b72cd76b91b.tar.bz2
txr-a9a7efc1790c6ebe663107fbf10c8b72cd76b91b.zip
parser: bugfix: empty buf literal problem.
* parser.y (buflit): Fix neglect to call end_of_buflit in the empty buffer literal case, which precipitates syntax errors when an empty buffer literal #b'' is embedded in other syntax.
Diffstat (limited to 'parser.y')
-rw-r--r--parser.y3
1 files changed, 2 insertions, 1 deletions
diff --git a/parser.y b/parser.y
index 95c8969b..265e4e30 100644
--- a/parser.y
+++ b/parser.y
@@ -1220,7 +1220,8 @@ wordsqlit : '`' { $$ = nil; }
$$ = rlcp(cons(qword, $3), $1); }
;
-buflit : HASH_B_QUOTE '\'' { $$ = make_buf(zero, nil, nil); }
+buflit : HASH_B_QUOTE '\'' { $$ = make_buf(zero, nil, nil);
+ end_of_buflit(scnr); }
| HASH_B_QUOTE buflit_items '\'' { val len = length($2);
val bytes = nreverse($2);
val buf = make_buf(len, nil, nil);