Files
ini/parser/lexer_runes.go
T
amery 5514583962 parser: WIP
Signed-off-by: Alejandro Mery <amery@jpi.io>
2023-08-30 18:57:09 +00:00

21 lines
564 B
Go

package parser
import "asciigoat.org/core/lexer"
var (
// IsNewLine tells if a rune represents a line break or the start of one
IsNewLine = lexer.NewIsIn("\n\r")
// IsSpace tells if a rune is considered whitespace by unicode
IsSpace = lexer.IsSpace
// IsNotNewLine tells if a rune is anything other than line breaks
IsNotNewLine = lexer.NewIsNot(IsNewLine)
// IsNotSpace tells if a rune is anything other than whitespace
IsNotSpace = lexer.NewIsNot(IsSpace)
IsCommentStart = lexer.NewIsIn(";#")
)
func IsSectionStart(r rune) bool {
return r == '['
}