token

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: Apache-2.0 Imports: 3 Imported by: 6 modules, 4 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type Token

type Token int

Token represents a lexical token in a JSONPath expression.

const (
	ILLEGAL Token = iota
	STRING
	INTEGER
	FLOAT
	STRING_LITERAL
	TRUE
	FALSE
	NULL
	ROOT
	CURRENT
	WILDCARD
	RECURSIVE
	CHILD
	ARRAY_SLICE
	FILTER
	PAREN_LEFT
	PAREN_RIGHT
	BRACKET_LEFT
	BRACKET_RIGHT
	COMMA
	TILDE
	AND
	OR
	NOT
	EQ
	NE
	GT
	GE
	LT
	LE
	MATCHES
	FUNCTION
)

The list of tokens.

func (Token) String

func (tok Token) String() string

String returns the string representation of the token.

type TokenInfo

type TokenInfo struct {
	Token   Token
	Line    int
	Column  int
	Literal string
	Len     int
}

TokenInfo represents a token and its associated information.

type Tokenizer

type Tokenizer struct {
	// contains filtered or unexported fields
}

Tokenizer represents a JSONPath tokenizer.

func NewTokenizer

func NewTokenizer(input string) *Tokenizer

NewTokenizer creates a new JSONPath tokenizer for the given input string.

func (Tokenizer) ErrorString

func (t Tokenizer) ErrorString(target *TokenInfo, msg string) string

When there's an error in the tokenizer, this helps represent it.

func (Tokenizer) ErrorTokenString

func (t Tokenizer) ErrorTokenString(target *TokenInfo, msg string) string

When there's an error

func (*Tokenizer) Tokenize

func (t *Tokenizer) Tokenize() Tokens

Tokenize tokenizes the input string and returns a slice of TokenInfo.

type Tokens

type Tokens []TokenInfo

Tokens represents the list of tokens

func (Tokens) IsSimple

func (tok Tokens) IsSimple() bool

Jump to

Keyboard shortcuts

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