summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAdela Vais <adela.vais99@gmail.com>2022-09-19 15:12:39 +0200
committerAkim Demaille <akim.demaille@gmail.com>2022-09-20 06:39:05 +0200
commitbe4528096ec05f0d58bd9ff53a293e1ec3193a85 (patch)
tree9f6ccb8cf8f463c0a324da625be76371fbaff155 /tests
parentc0258915474496874318f4767ba6ebcc1e9471f0 (diff)
downloadbison-be4528096ec05f0d58bd9ff53a293e1ec3193a85.tar.gz
d: fix interface syntax error
Fix syntax error regarding interface inheritance of the Lexer. It appeared when the `%code lexer` option was used. Reported by ledaniel2. <https://github.com/akimd/bison/issues/84> * data/skeletons/lalr1.d: Fix syntax. * tests/d.at: Test it.
Diffstat (limited to 'tests')
-rw-r--r--tests/d.at7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/d.at b/tests/d.at
index 6be53eef..347e868c 100644
--- a/tests/d.at
+++ b/tests/d.at
@@ -112,6 +112,13 @@ AT_CHECK_D_GREP([[class YYParser : BaseClass]])
AT_CHECK_D_MINIMAL([%define api.parser.extends {Interface}], [], [], [interface Interface {}])
AT_CHECK_D_GREP([[class YYParser : Interface]])
+AT_CHECK_D_MINIMAL([%code lexer
+{
+ Symbol yylex () {return Symbol();}
+ void yyerror (string s) {import std.stdio;writeln(s);}
+}], [], [], [])
+AT_CHECK_D_GREP([[private class YYLexer: Lexer]])
+
AT_CHECK_D_MINIMAL(
[%define api.parser.extends {BaseClass}
%define api.parser.implements {Interface}], [], [],