mirror of
https://github.com/alecthomas/chroma.git
synced 2025-07-01 00:35:06 +02:00
Add support for Go templates.
These are exposed as go-text-template and go-html-template. Fixes #105.
This commit is contained in:
@ -195,7 +195,11 @@ func (l *LexerState) Iterator() *Token {
|
||||
if l.Lexer.trace {
|
||||
fmt.Fprintf(os.Stderr, "%s: pos=%d, text=%q\n", l.State, l.Pos, string(l.Text[l.Pos:]))
|
||||
}
|
||||
ruleIndex, rule, groups := matchRules(l.Text[l.Pos:], l.Rules[l.State])
|
||||
selectedRule, ok := l.Rules[l.State]
|
||||
if !ok {
|
||||
panic("unknown state " + l.State)
|
||||
}
|
||||
ruleIndex, rule, groups := matchRules(l.Text[l.Pos:], selectedRule)
|
||||
// No match.
|
||||
if groups == nil {
|
||||
l.Pos++
|
||||
|
Reference in New Issue
Block a user