1
0
mirror of https://github.com/alecthomas/chroma.git synced 2025-11-27 22:38:42 +02:00

Use pointers to tokens + support regex flags in importer.

This commit is contained in:
Alec Thomas
2017-06-05 10:29:50 +10:00
parent c64e5829b5
commit 1f47bd705c
10 changed files with 83 additions and 56 deletions

View File

@@ -182,6 +182,6 @@ func (t TokenType) InSubCategory(other TokenType) bool {
return t/100 == other/100
}
func (t TokenType) Emit(groups []string, lexer Lexer, out func(Token)) {
out(Token{Type: t, Value: groups[0]})
func (t TokenType) Emit(groups []string, lexer Lexer, out func(*Token)) {
out(&Token{Type: t, Value: groups[0]})
}