token

package
v0.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NullBytes  []byte = []byte("null")
	FalseBytes []byte = []byte("false")
	TrueBytes  []byte = []byte("true")
)

Functions

func IsSymbolToken

func IsSymbolToken(t TokenType) bool

symbol token of json, these are the format token that need to use to construct the AST/ syntax checker double quotaion though is also symbol, it is value symbol, not json protocol symbol to hold the format

Types

type TokenType

type TokenType uint
const (
	// The token type is a string
	TOKEN_STRING TokenType = iota
	// The token type is a number
	TOKEN_NUMBER
	// The token type is a boolean
	TOKEN_BOOLEAN
	// The token type is a null
	TOKEN_NULL
	// The token type is a left brace
	TOKEN_LEFT_BRACE
	// The token type is a right brace
	TOKEN_RIGHT_BRACE
	// The token type is a left bracket
	TOKEN_LEFT_BRACKET
	// The token type is a right bracket
	TOKEN_RIGHT_BRACKET
	// The token type is a colon
	TOKEN_COLON
	// The token type is a comma
	TOKEN_COMMA
	// customize token type
	TOKEN_VARIABLE
	// variable in string, a string can have multiple variable
	TOKEN_STRING_WITH_VARIABLE
	TOKEN_SPACE
	// deciaml token
	TOKEN_NUMBER_DECIMAL
	//
	TOKEN_DOUBLE_QUOTATION
	//
	TOKEN_EXTEND_TAG_VALUE_FIELD

	TOKEN_UNKNOWN TokenType = 97
	TOKEN_DUMMY   TokenType = 98
	TOKEN_DROP    TokenType = 99
)

func GetTokenTypeByReflection

func GetTokenTypeByReflection(v reflect.Value) (TokenType, bool)

get the acutal token type underneath the reflect.Value, and return the indicator whether the value is wrapped by interface{}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL