Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsNameContinue ¶
func IsNameStart ¶
Types ¶
type T ¶
type T uint8
const ( TEndOfFile T = iota TAtKeyword TUnterminatedString TBadURL TCDC // "-->" TCDO // "<!--" TCloseBrace TCloseBracket TCloseParen TColon TComma TDelim TDelimAmpersand TDelimAsterisk TDelimBar TDelimCaret TDelimDollar TDelimDot TDelimEquals TDelimExclamation TDelimGreaterThan TDelimMinus TDelimPlus TDelimSlash TDelimTilde TDimension TFunction THash TIdent TNumber TOpenBrace TOpenBracket TOpenParen TPercentage TSemicolon TString TURL TWhitespace )
type Token ¶
type Token struct {
Range logger.Range // 8 bytes
UnitOffset uint16 // 2 bytes
Kind T // 1 byte
Flags TokenFlags // 1 byte
}
This token struct is designed to be memory-efficient. It just references a range in the input file instead of directly containing the substring of text since a range takes up less memory than a string.
func (Token) DecodedText ¶
type TokenFlags ¶ added in v0.17.11
type TokenFlags uint8
const ( IsID TokenFlags = 1 << iota DidWarnAboutSingleLineComment )
Click to show internal directories.
Click to hide internal directories.