1
0
mirror of https://github.com/alecthomas/chroma.git synced 2025-11-23 22:24:39 +02:00

Add a bunch of automatically translated lexers.

This commit is contained in:
Alec Thomas
2017-06-04 22:18:35 +10:00
parent b30de35ff1
commit 5dedc6e45b
20 changed files with 749 additions and 214 deletions

View File

@@ -9,14 +9,14 @@ type coalescer struct {
Lexer
}
func (d *coalescer) Tokenise(text string, out func(Token)) error {
func (d *coalescer) Tokenise(options *TokeniseOptions, text string, out func(Token)) error {
var last *Token
defer func() {
if last != nil {
out(*last)
}
}()
return d.Lexer.Tokenise(text, func(token Token) {
return d.Lexer.Tokenise(options, text, func(token Token) {
if last == nil {
last = &token
} else {