mirror of
https://github.com/alecthomas/chroma.git
synced 2025-07-17 01:22:22 +02:00
Tokens by value (#187)
This results in about a 8% improvement in speed.
This commit is contained in:
committed by
Alec Thomas
parent
5a473179cf
commit
9c3abeae1d
@ -14,7 +14,7 @@ func TestNewlineAtEndOfFile(t *testing.T) {
|
||||
}))
|
||||
it, err := l.Tokenise(nil, `hello`)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, []*Token{{Keyword, "hello"}, {Whitespace, "\n"}}, it.Tokens())
|
||||
assert.Equal(t, []Token{{Keyword, "hello"}, {Whitespace, "\n"}}, it.Tokens())
|
||||
|
||||
l = Coalesce(MustNewLexer(nil, Rules{
|
||||
"root": {
|
||||
@ -23,5 +23,5 @@ func TestNewlineAtEndOfFile(t *testing.T) {
|
||||
}))
|
||||
it, err = l.Tokenise(nil, `hello`)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, []*Token{{Error, "hello"}}, it.Tokens())
|
||||
assert.Equal(t, []Token{{Error, "hello"}}, it.Tokens())
|
||||
}
|
||||
|
Reference in New Issue
Block a user