mirror of
https://github.com/alecthomas/chroma.git
synced 2025-11-23 22:24:39 +02:00
Add new TokeniseOption EnsureLF (#336)
* Add new TokeniseOption EnsureLF ref #329 * Use efficient process suggested by @chmike
This commit is contained in:
7
lexer.go
7
lexer.go
@@ -6,7 +6,8 @@ import (
|
||||
|
||||
var (
|
||||
defaultOptions = &TokeniseOptions{
|
||||
State: "root",
|
||||
State: "root",
|
||||
EnsureLF: true,
|
||||
}
|
||||
)
|
||||
|
||||
@@ -80,6 +81,10 @@ type TokeniseOptions struct {
|
||||
State string
|
||||
// Nested tokenisation.
|
||||
Nested bool
|
||||
|
||||
// If true, all EOLs are converted into LF
|
||||
// by replacing CRLF and CR
|
||||
EnsureLF bool
|
||||
}
|
||||
|
||||
// A Lexer for tokenising source code.
|
||||
|
||||
Reference in New Issue
Block a user