aboutsummaryrefslogtreecommitdiff
path: root/driver
diff options
context:
space:
mode:
authorRyo Nihei <nihei.dev@gmail.com>2021-05-07 23:27:58 +0900
committerRyo Nihei <nihei.dev@gmail.com>2021-05-07 23:27:58 +0900
commit8682098aa9034af1b796c7e9bca9fd24b3226ccf (patch)
treee67d1728ec7d001bd6ee9578ca2f30a59930ef93 /driver
parentAdd transition table compressor (diff)
downloadtre-8682098aa9034af1b796c7e9bca9fd24b3226ccf.tar.gz
tre-8682098aa9034af1b796c7e9bca9fd24b3226ccf.tar.xz
Change type of acceping_states to slice
Diffstat (limited to 'driver')
-rw-r--r--driver/lexer.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/driver/lexer.go b/driver/lexer.go
index 485bfd9..7886720 100644
--- a/driver/lexer.go
+++ b/driver/lexer.go
@@ -264,8 +264,8 @@ func (l *lexer) next() (*Token, error) {
return newInvalidToken(mode, modeName, newByteSequence(buf)), nil
}
state = nextState
- id, ok := spec.DFA.AcceptingStates[state]
- if ok {
+ id := spec.DFA.AcceptingStates[state]
+ if id != 0 {
tok = newToken(mode, modeName, id, spec.Kinds[id].String(), newByteSequence(buf))
unfixedBufLen = 0
}