Documentation ¶
Index ¶
- Constants
- Variables
- type Ast
- type AstError
- type BinaryExpr
- type Expr
- type FuncExpr
- type GoBackend
- type IdentExpr
- type KeyValExpr
- type LiteralExpr
- type Node
- type ObjectLiteralExpr
- type Parser
- type ParserError
- type RegexOptions
- type Regexl
- type SelectStmt
- type Stmt
- type Token
- type TokenPos
- type TokenType
Constants ¶
View Source
const (
AST_INVALID_INDEX = -1
)
Variables ¶
View Source
var ( PrintTokens bool PrintAstJson bool PrintAstTree bool )
@TODO: remove or make something nicer Debug options
Functions ¶
This section is empty.
Types ¶
type BinaryExpr ¶
func (*BinaryExpr) EndPos ¶
func (e *BinaryExpr) EndPos() TokenPos
func (*BinaryExpr) StartPos ¶
func (e *BinaryExpr) StartPos() TokenPos
type FuncExpr ¶
type GoBackend ¶
type GoBackend struct {
Opts RegexOptions
}
GoBackend produces valid Go regex strings, based on the rules here: https://pkg.golang.ir/regexp/syntax
func (*GoBackend) ApplyOptionsToRegexString ¶
type KeyValExpr ¶
func (*KeyValExpr) EndPos ¶
func (e *KeyValExpr) EndPos() TokenPos
func (*KeyValExpr) StartPos ¶
func (e *KeyValExpr) StartPos() TokenPos
type LiteralExpr ¶
type LiteralExpr struct { Pos TokenPos Type TokenType // Value depends on the type, so it can contain a numeric, string etc Value string }
func (*LiteralExpr) EndPos ¶
func (e *LiteralExpr) EndPos() TokenPos
func (*LiteralExpr) StartPos ¶
func (e *LiteralExpr) StartPos() TokenPos
type Node ¶
type Node interface { // StartPos is the position of the first byte of the first character making up this node StartPos() TokenPos // EndPos is the position of the first byte of the first character that doesn't belong to this node. // This means EndPos is +1 of the last character, so it acts in the same way len() does EndPos() TokenPos }
type ObjectLiteralExpr ¶
type ObjectLiteralExpr struct { OpenCurly TokenPos CloseCurly TokenPos KeyVals []KeyValExpr }
func (*ObjectLiteralExpr) EndPos ¶
func (e *ObjectLiteralExpr) EndPos() TokenPos
func (*ObjectLiteralExpr) StartPos ¶
func (e *ObjectLiteralExpr) StartPos() TokenPos
type Parser ¶
type Parser struct {
Query string
}
func (*Parser) GetNextRuneByByteIndex ¶
func (*Parser) ValidateTokens ¶
type ParserError ¶
func (*ParserError) Error ¶
func (te *ParserError) Error() string
type RegexOptions ¶
type Regexl ¶
func (*Regexl) Compile ¶
Compile tries to compile the query within this Regexl object and then sets Regexl.CompiledRegexp. Regexl.CompiledRegexp is only set if no error is found, otherwise the error is returned and Regexl.CompiledRegexp is unchanged.
func (*Regexl) MustCompile ¶
MustCompile compiles the query within this regexl object by calling Regexl.Compile and panics if an error is thrown
type SelectStmt ¶
func (*SelectStmt) EndPos ¶
func (s *SelectStmt) EndPos() TokenPos
func (*SelectStmt) StartPos ¶
func (s *SelectStmt) StartPos() TokenPos
type TokenType ¶
type TokenType int
const ( TokenType_Unknown TokenType = iota TokenType_Space TokenType_String // TokenType_Single_Quote TokenType_Int TokenType_Float TokenType_Operator TokenType_OpenBracket TokenType_CloseBracket TokenType_OpenCurlyBracket TokenType_CloseCurlyBracket TokenType_Colon TokenType_Comma TokenType_Bool TokenType_Plus TokenType_Comment TokenType_Object_Param TokenType_Function_Name TokenType_Keyword )
func (TokenType) MarshalText ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.