Documentation
¶
Index ¶
- type Token
- func (t Token) IsNumber(additionalRules ...map[rune]func(index int, r rune, val []rune) bool) bool
- func (t Token) Len() int
- func (t Token) Lower() string
- func (t Token) LowerFirst() string
- func (t Token) Split() []Token
- func (t Token) String() string
- func (t Token) Upper() string
- func (t Token) UpperFirst() string
- func (t Token) UpperFirstLowerRest() string
- func (t Token) Value() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Token ¶
type Token struct {
// contains filtered or unexported fields
}
Token contains a slice of runes representing the raw value and value in lowercase form.
This is used for the
func AppendRune ¶
AppendRune append the rune to the current token.
func FromString ¶
func (Token) IsNumber ¶
IsNumber reports true if the Token is considered a valid number based on the following rules:
- If the Token is composed only of numbers
- If the Token is prefixed with any of the following: + - . v V # and followed by a number
- Numbers may only be seperated by a single '.' and '.' may be the first rune or proceeded by a number, '+', or '-'
- A single 'e' or 'E' may only be used in the exponent portion of a number
- 'e' or 'E' may be followed
- ',' must be preceded by a number and followed by a number
- if additionalRules is not nil and the rune is present in the map, the result of the provided func overrides the rules above
func (Token) LowerFirst ¶
func (Token) Split ¶
Split returns the current token split into a slice of Tokens for each rune in the list.