1
0
mirror of https://github.com/alecthomas/chroma.git synced 2025-07-01 00:35:06 +02:00

Document and add iterator panic recovery.

This commit is contained in:
Alec Thomas
2017-09-20 22:30:25 +10:00
parent cc0e4a59ab
commit e2d6abaa64
10 changed files with 75 additions and 27 deletions

View File

@ -267,6 +267,7 @@ func (r *RegexLexer) Tokenise(options *TokeniseOptions, text string) (Iterator,
options = defaultOptions
}
state := &LexerState{
Lexer: r,
Text: []rune(text),
Stack: []string{options.State},
Rules: r.rules,