mirror of
https://github.com/alecthomas/chroma.git
synced 2025-11-23 22:24:39 +02:00
Pass *LexerState as context to emitters
Useful for accessing named capture groups and context set by `mutators` and other field and methods LexerState provides.
This commit is contained in:
committed by
Alec Thomas
parent
2cc8645d62
commit
225e1862d3
2
types.go
2
types.go
@@ -342,6 +342,6 @@ func (t TokenType) InSubCategory(other TokenType) bool {
|
||||
return t/100 == other/100
|
||||
}
|
||||
|
||||
func (t TokenType) Emit(groups []string, lexer Lexer) Iterator {
|
||||
func (t TokenType) Emit(groups []string, _ *LexerState) Iterator {
|
||||
return Literator(Token{Type: t, Value: groups[0]})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user