Documentation
¶
Index ¶
- Constants
- func Accept(tokens []byte, token byte) (pos int)
- func AcceptTokens(remains, someTokens []byte) (pos int)
- func AcceptTokenss(tokens []byte, someTokenss [][]byte) (pos int)
- func BytesShowLength(bytes []byte) int
- func EscapeMarkers(tokens []byte) []byte
- func EscapeProtyleMarkers(tokens []byte) []byte
- func IsASCIILetter(token byte) bool
- func IsASCIILetterNum(token byte) bool
- func IsASCIILetterNumHyphen(token byte) bool
- func IsASCIILetterNums(tokens []byte) bool
- func IsASCIIPunct(token byte) bool
- func IsBackslashEscapePunct(tokens []byte, pos int) bool
- func IsBlank(tokens []byte) bool
- func IsBlankLine(tokens []byte) bool
- func IsCommonInlineMarker(token byte) bool
- func IsControl(token byte) bool
- func IsDigit(token byte) bool
- func IsHexDigit(token byte) bool
- func IsMarker(token byte) bool
- func IsProtyleInlineMarker(token byte) bool
- func IsUnicodeWhitespace(r rune) bool
- func IsWhitespace(token byte) bool
- func Peek(tokens []byte, pos int) byte
- func RepeatBackslashBeforePipe(content string) string
- func ReplaceAll(tokens []byte, old, new byte) []byte
- func ReplaceNewlineSpace(tokens []byte) []byte
- func Split(tokens []byte, separator byte) (ret [][]byte)
- func SplitWhitespace(tokens []byte) (ret [][]byte)
- func SplitWithoutBackslashEscape(tokens []byte, separator byte) (ret [][]byte)
- func Spnl(tokens []byte) (ret bool, passed, remains []byte)
- func StatWhitespace(tokens []byte) (newlines, spaces, tabs int)
- func TokenToUpper(token byte) byte
- func Trim(tokens []byte) (leftWhitespaces, rightWhitespaces, remains []byte)
- func TrimLeft(tokens []byte) (whitespaces, remains []byte)
- func TrimRight(tokens []byte) (whitespaces, remains []byte)
- func TrimWhitespace(tokens []byte) (ret []byte)
- type Lexer
Constants ¶
View Source
const ( ItemBacktick = byte('`') ItemTilde = byte('~') ItemBang = byte('!') ItemCrosshatch = byte('#') ItemAsterisk = byte('*') ItemOpenParen = byte('(') ItemCloseParen = byte(')') ItemHyphen = byte('-') ItemUnderscore = byte('_') ItemPlus = byte('+') ItemEqual = byte('=') ItemTab = byte('\t') ItemOpenBracket = byte('[') ItemCloseBracket = byte(']') ItemDoublequote = byte('"') ItemSinglequote = byte('\'') ItemLess = byte('<') ItemGreater = byte('>') ItemSpace = byte(' ') ItemNewline = byte('\n') ItemCarriageReturn = byte('\r') ItemBackslash = byte('\\') ItemSlash = byte('/') ItemDot = byte('.') ItemColon = byte(':') ItemQuestion = byte('?') ItemAmpersand = byte('&') ItemSemicolon = byte(';') ItemPipe = byte('|') ItemDollar = byte('$') ItemCaret = byte('^') ItemOpenBrace = byte('{') ItemCloseBrace = byte('}') )
Variables ¶
This section is empty.
Functions ¶
func AcceptTokens ¶
func AcceptTokenss ¶
func BytesShowLength ¶
BytesShowLength 获取字节数组展示为 UTF8 字符串时的长度。
func EscapeMarkers ¶ added in v1.7.5
func EscapeProtyleMarkers ¶ added in v1.7.6
func IsASCIILetterNum ¶
IsASCIILetterNum 判断 token 是否是一个 ASCII 字母或数字。
func IsASCIILetterNumHyphen ¶
IsASCIILetterNumHyphen 判断 token 是否是一个 ASCII 字母、数字或者横线 -。
func IsASCIILetterNums ¶ added in v1.7.5
IsASCIILetterNums 判断 tokens 是否是 ASCII 字母或数字组成。
func IsBackslashEscapePunct ¶
IsBackslashEscapePunct 判断 Tokens 中 pos 所指的值是否是由反斜杠 \ 转义的 ASCII 标点符号。
func IsBlankLine ¶
func IsCommonInlineMarker ¶ added in v1.7.5
func IsProtyleInlineMarker ¶ added in v1.7.6
func IsUnicodeWhitespace ¶
IsUnicodeWhitespace 判断 token 是否是 Unicode 空白。
func RepeatBackslashBeforePipe ¶ added in v1.7.6
func ReplaceAll ¶
ReplaceAll 会将 Tokens 中的所有 old 使用 new 替换。
func ReplaceNewlineSpace ¶
ReplaceNewlineSpace 会将 Tokens 中的所有 "\n " 替换为 "\n"。
func SplitWhitespace ¶
func SplitWithoutBackslashEscape ¶
SplitWithoutBackslashEscape 使用 separator 作为分隔符将 Tokens 切分为多个子串,被反斜杠 \ 转义的字符不会计入切分。
func StatWhitespace ¶
func TrimWhitespace ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.