mirror of
https://github.com/alecthomas/chroma.git
synced 2025-12-05 23:08:23 +02:00
refactor: Iterator -> iter.Seq[Token]
This commit is contained in:
@@ -3,6 +3,7 @@ package chroma
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"iter"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
@@ -491,7 +492,7 @@ func (r *RegexLexer) needRules() error {
|
||||
}
|
||||
|
||||
// Tokenise text using lexer, returning an iterator.
|
||||
func (r *RegexLexer) Tokenise(options *TokeniseOptions, text string) (Iterator, error) {
|
||||
func (r *RegexLexer) Tokenise(options *TokeniseOptions, text string) (iter.Seq[Token], error) {
|
||||
err := r.needRules()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user