aboutsummaryrefslogtreecommitdiff
path: root/spec/lexer_test.go
diff options
context:
space:
mode:
authorRyo Nihei <nihei.dev@gmail.com>2021-06-20 18:39:38 +0900
committerRyo Nihei <nihei.dev@gmail.com>2021-06-20 18:46:13 +0900
commit8993406a8ebe8c0a01d5081dc4afcf819e3160d4 (patch)
tree8940654c0bbc1e200908cafe83813fe7765a5229 /spec/lexer_test.go
parentAdd syntax of comments (diff)
downloadcotia-8993406a8ebe8c0a01d5081dc4afcf819e3160d4.tar.gz
cotia-8993406a8ebe8c0a01d5081dc4afcf819e3160d4.tar.xz
Add syntax of modifiers and actions
Currently, a mode modifier and push/pop actions are available. The modifier and the actions make sense in only lexical specifications.
Diffstat (limited to 'spec/lexer_test.go')
-rw-r--r--spec/lexer_test.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/spec/lexer_test.go b/spec/lexer_test.go
index 484ad30..af586f2 100644
--- a/spec/lexer_test.go
+++ b/spec/lexer_test.go
@@ -14,13 +14,15 @@ func TestLexer_Run(t *testing.T) {
}{
{
caption: "the lexer can recognize all kinds of tokens",
- src: `id"terminal":|;`,
+ src: `id"terminal":|;@#`,
tokens: []*token{
newIDToken("id"),
newTerminalPatternToken("terminal"),
newSymbolToken(tokenKindColon),
newSymbolToken(tokenKindOr),
newSymbolToken(tokenKindSemicolon),
+ newSymbolToken(tokenKindModifierMarker),
+ newSymbolToken(tokenKindActionLeader),
newEOFToken(),
},
},