aboutsummaryrefslogtreecommitdiff
path: root/driver/token_stream.go
diff options
context:
space:
mode:
authorRyo Nihei <nihei.dev@gmail.com>2022-11-05 20:32:53 +0900
committerRyo Nihei <nihei.dev@gmail.com>2022-11-06 02:18:35 +0900
commita0aa647770ac6458e9b4749c3efa38d56e2fe4fe (patch)
tree117c30b994b1624b19a9fae485c9802f2a8bcc72 /driver/token_stream.go
parentRemove anonymous symbol system (diff)
downloadurubu-a0aa647770ac6458e9b4749c3efa38d56e2fe4fe.tar.gz
urubu-a0aa647770ac6458e9b4749c3efa38d56e2fe4fe.tar.xz
Move the skip table from lexer-related data to parser-related data
Diffstat (limited to 'driver/token_stream.go')
-rw-r--r--driver/token_stream.go8
1 files changed, 0 insertions, 8 deletions
diff --git a/driver/token_stream.go b/driver/token_stream.go
index dd2c482..eaf56c6 100644
--- a/driver/token_stream.go
+++ b/driver/token_stream.go
@@ -9,7 +9,6 @@ import (
type vToken struct {
terminalID int
- skip bool
tok *mldriver.Token
}
@@ -29,10 +28,6 @@ func (t *vToken) Invalid() bool {
return t.tok.Invalid
}
-func (t *vToken) Skip() bool {
- return t.skip
-}
-
func (t *vToken) Position() (int, int) {
return t.tok.Row, t.tok.Col
}
@@ -40,7 +35,6 @@ func (t *vToken) Position() (int, int) {
type tokenStream struct {
lex *mldriver.Lexer
kindToTerminal []int
- skip []int
}
func NewTokenStream(g *spec.CompiledGrammar, src io.Reader) (TokenStream, error) {
@@ -52,7 +46,6 @@ func NewTokenStream(g *spec.CompiledGrammar, src io.Reader) (TokenStream, error)
return &tokenStream{
lex: lex,
kindToTerminal: g.LexicalSpecification.Maleeni.KindToTerminal,
- skip: g.LexicalSpecification.Maleeni.Skip,
}, nil
}
@@ -63,7 +56,6 @@ func (l *tokenStream) Next() (VToken, error) {
}
return &vToken{
terminalID: l.kindToTerminal[tok.KindID],
- skip: l.skip[tok.KindID] > 0,
tok: tok,
}, nil
}