diff options
author | Ryo Nihei <nihei.dev@gmail.com> | 2022-05-07 20:41:33 +0900 |
---|---|---|
committer | Ryo Nihei <nihei.dev@gmail.com> | 2022-05-10 23:14:41 +0900 |
commit | 3eb0e88f911386a4e6eca991c1471070596c5554 (patch) | |
tree | 4c3ea445a804d781b846739d70392ceb1353ea6d /spec/lexer_test.go | |
parent | Make #prec directive change only precedence and not associativity (diff) | |
download | cotia-3eb0e88f911386a4e6eca991c1471070596c5554.tar.gz cotia-3eb0e88f911386a4e6eca991c1471070596c5554.tar.xz |
Change syntax for top-level directives
%name changes to:
#name example;
%left and %right change to:
#prec (
#left a b
#right c d
);
Diffstat (limited to 'spec/lexer_test.go')
-rw-r--r-- | spec/lexer_test.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/spec/lexer_test.go b/spec/lexer_test.go index 4fab8db..621eff5 100644 --- a/spec/lexer_test.go +++ b/spec/lexer_test.go @@ -36,7 +36,7 @@ func TestLexer_Run(t *testing.T) { }{ { caption: "the lexer can recognize all kinds of tokens", - src: `id"terminal"'string':|;@...#%`, + src: `id"terminal"'string':|;@...#()`, tokens: []*token{ idTok("id"), termPatTok("terminal"), @@ -47,7 +47,8 @@ func TestLexer_Run(t *testing.T) { symTok(tokenKindLabelMarker), symTok(tokenKindExpantion), symTok(tokenKindDirectiveMarker), - symTok(tokenKindMetaDataMarker), + symTok(tokenKindLParen), + symTok(tokenKindRParen), newEOFToken(), }, }, |