Documentation ¶
Index ¶
- Constants
- Variables
- func SwapLeadingInfix(from, to *ast.Meta)
- func SwapLeadingTrailing(from, to *ast.Meta)
- type CustomParser
- type ParseError
- func DuplicateCase(m *ast.Meta) *ParseError
- func EmptySwitch(m *ast.Meta) *ParseError
- func FinalFallthrough(m *ast.Meta) *ParseError
- func InvalidEscape(m *ast.Meta, msg string) *ParseError
- func MissingColon(m *ast.Meta) *ParseError
- func MissingSemicolon(m *ast.Meta) *ParseError
- func MultipleDefaults(m *ast.Meta) *ParseError
- func TypeConversionError(m *ast.Meta, tt string) *ParseError
- func UndefinedPrefix(m *ast.Meta) *ParseError
- func UnexpectedToken(m *ast.Meta, expects ...string) *ParseError
- type Parser
- func (p *Parser) CurToken() *ast.Meta
- func (p *Parser) CurTokenIs(t token.TokenType) bool
- func (p *Parser) ExpectPeek(t token.TokenType) bool
- func (p *Parser) NextToken()
- func (p *Parser) Parse() (ast.Statement, error)
- func (p *Parser) ParseAclCidr() (*ast.AclCidr, error)
- func (p *Parser) ParseAclDeclaration() (*ast.AclDeclaration, error)
- func (p *Parser) ParseAddStatement() (*ast.AddStatement, error)
- func (p *Parser) ParseAnotherIfStatement(keyword string) (*ast.IfStatement, error)
- func (p *Parser) ParseBackendDeclaration() (*ast.BackendDeclaration, error)
- func (p *Parser) ParseBackendProperty() (*ast.BackendProperty, error)
- func (p *Parser) ParseBlockStatement() (*ast.BlockStatement, error)
- func (p *Parser) ParseBoolean() *ast.Boolean
- func (p *Parser) ParseBreakStatement() (*ast.BreakStatement, error)
- func (p *Parser) ParseCallStatement() (*ast.CallStatement, error)
- func (p *Parser) ParseCaseStatement() (*ast.CaseStatement, error)
- func (p *Parser) ParseCustomToken() (ast.CustomStatement, error)
- func (p *Parser) ParseDeclareStatement() (*ast.DeclareStatement, error)
- func (p *Parser) ParseDirectorBackend() (ast.Expression, error)
- func (p *Parser) ParseDirectorDeclaration() (*ast.DirectorDeclaration, error)
- func (p *Parser) ParseDirectorProperty() (ast.Expression, error)
- func (p *Parser) ParseErrorStatement() (*ast.ErrorStatement, error)
- func (p *Parser) ParseEsiStatement() (*ast.EsiStatement, error)
- func (p *Parser) ParseExpression(precedence int) (ast.Expression, error)
- func (p *Parser) ParseFallthroughStatement() (*ast.FallthroughStatement, error)
- func (p *Parser) ParseFloat() (*ast.Float, error)
- func (p *Parser) ParseFunctionArgumentExpressions() ([]ast.Expression, error)
- func (p *Parser) ParseFunctionCall() (*ast.FunctionCallStatement, error)
- func (p *Parser) ParseFunctionCallExpression(fn ast.Expression) (ast.Expression, error)
- func (p *Parser) ParseGotoDestination() (*ast.GotoDestinationStatement, error)
- func (p *Parser) ParseGotoStatement() (*ast.GotoStatement, error)
- func (p *Parser) ParseGroupedExpression() (*ast.GroupedExpression, error)
- func (p *Parser) ParseIP() *ast.IP
- func (p *Parser) ParseIdent() *ast.Ident
- func (p *Parser) ParseIfExpression() (*ast.IfExpression, error)
- func (p *Parser) ParseIfStatement() (*ast.IfStatement, error)
- func (p *Parser) ParseImportStatement() (*ast.ImportStatement, error)
- func (p *Parser) ParseIncludeStatement() (ast.Statement, error)
- func (p *Parser) ParseInfixExpression(left ast.Expression) (ast.Expression, error)
- func (p *Parser) ParseInfixStringConcatExpression(left ast.Expression) (ast.Expression, error)
- func (p *Parser) ParseInteger() (*ast.Integer, error)
- func (p *Parser) ParseLogStatement() (*ast.LogStatement, error)
- func (p *Parser) ParsePenaltyboxDeclaration() (*ast.PenaltyboxDeclaration, error)
- func (p *Parser) ParsePostfixExpression(left ast.Expression) (ast.Expression, error)
- func (p *Parser) ParsePrefixExpression() (*ast.PrefixExpression, error)
- func (p *Parser) ParseRTime() (*ast.RTime, error)
- func (p *Parser) ParseRatecounterDeclaration() (*ast.RatecounterDeclaration, error)
- func (p *Parser) ParseRemoveStatement() (*ast.RemoveStatement, error)
- func (p *Parser) ParseRestartStatement() (*ast.RestartStatement, error)
- func (p *Parser) ParseReturnStatement() (*ast.ReturnStatement, error)
- func (p *Parser) ParseSetStatement() (*ast.SetStatement, error)
- func (p *Parser) ParseSnippetVCL() ([]ast.Statement, error)
- func (p *Parser) ParseStatement() (ast.Statement, error)
- func (p *Parser) ParseString() (*ast.String, error)
- func (p *Parser) ParseSubroutineDeclaration() (*ast.SubroutineDeclaration, error)
- func (p *Parser) ParseSwitchStatement() (*ast.SwitchStatement, error)
- func (p *Parser) ParseSyntheticBase64Statement() (*ast.SyntheticBase64Statement, error)
- func (p *Parser) ParseSyntheticStatement() (*ast.SyntheticStatement, error)
- func (p *Parser) ParseTableDeclaration() (*ast.TableDeclaration, error)
- func (p *Parser) ParseTableProperty() (*ast.TableProperty, error)
- func (p *Parser) ParseUnsetStatement() (*ast.UnsetStatement, error)
- func (p *Parser) ParseVCL() (*ast.VCL, error)
- func (p *Parser) PeekToken() *ast.Meta
- func (p *Parser) PeekTokenIs(t token.TokenType) bool
- func (p *Parser) PrevTokenIs(t token.TokenType) bool
- func (p *Parser) ReadPeek()
- func (p *Parser) Trailing() ast.Comments
- type ParserOption
Constants ¶
View Source
const ( LOWEST int = iota + 1 OR AND REGEX EQUALS LESS_GREATER CONCAT PREFIX POSTFIX CALL )
Reference: https://developer.fastly.com/reference/vcl/operators/
Variables ¶
View Source
var NULLbyte = errors.New("NULL")
Sentinel error for indicating the presence of a NULL byte or zero code point in an escape.
Functions ¶
func SwapLeadingInfix ¶ added in v1.7.0
func SwapLeadingTrailing ¶ added in v1.7.0
Comment control helper
Types ¶
type CustomParser ¶ added in v1.7.0
type CustomParser interface { Literal() string Parse(*Parser) (ast.CustomStatement, error) }
type ParseError ¶
func DuplicateCase ¶ added in v1.4.0
func DuplicateCase(m *ast.Meta) *ParseError
func EmptySwitch ¶ added in v1.4.0
func EmptySwitch(m *ast.Meta) *ParseError
func FinalFallthrough ¶ added in v1.4.0
func FinalFallthrough(m *ast.Meta) *ParseError
func InvalidEscape ¶ added in v1.5.0
func InvalidEscape(m *ast.Meta, msg string) *ParseError
func MissingColon ¶ added in v1.4.0
func MissingColon(m *ast.Meta) *ParseError
func MissingSemicolon ¶
func MissingSemicolon(m *ast.Meta) *ParseError
func MultipleDefaults ¶ added in v1.4.0
func MultipleDefaults(m *ast.Meta) *ParseError
func TypeConversionError ¶
func TypeConversionError(m *ast.Meta, tt string) *ParseError
func UndefinedPrefix ¶
func UndefinedPrefix(m *ast.Meta) *ParseError
func UnexpectedToken ¶
func UnexpectedToken(m *ast.Meta, expects ...string) *ParseError
func (*ParseError) Error ¶
func (e *ParseError) Error() string
func (*ParseError) ErrorToken ¶
func (e *ParseError) ErrorToken() token.Token
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
func (*Parser) ParseAclDeclaration ¶ added in v1.7.0
func (p *Parser) ParseAclDeclaration() (*ast.AclDeclaration, error)
func (*Parser) ParseAddStatement ¶ added in v1.7.0
func (p *Parser) ParseAddStatement() (*ast.AddStatement, error)
func (*Parser) ParseAnotherIfStatement ¶ added in v1.7.0
func (p *Parser) ParseAnotherIfStatement(keyword string) (*ast.IfStatement, error)
AnotherIfStatement is similar to IfStatement but is not culious about alternative.
func (*Parser) ParseBackendDeclaration ¶ added in v1.7.0
func (p *Parser) ParseBackendDeclaration() (*ast.BackendDeclaration, error)
func (*Parser) ParseBackendProperty ¶ added in v1.7.0
func (p *Parser) ParseBackendProperty() (*ast.BackendProperty, error)
func (*Parser) ParseBlockStatement ¶ added in v1.7.0
func (p *Parser) ParseBlockStatement() (*ast.BlockStatement, error)
func (*Parser) ParseBoolean ¶ added in v1.7.0
nolint: unparam
func (*Parser) ParseBreakStatement ¶ added in v1.7.0
func (p *Parser) ParseBreakStatement() (*ast.BreakStatement, error)
func (*Parser) ParseCallStatement ¶ added in v1.7.0
func (p *Parser) ParseCallStatement() (*ast.CallStatement, error)
func (*Parser) ParseCaseStatement ¶ added in v1.7.0
func (p *Parser) ParseCaseStatement() (*ast.CaseStatement, error)
func (*Parser) ParseCustomToken ¶ added in v1.7.0
func (p *Parser) ParseCustomToken() (ast.CustomStatement, error)
func (*Parser) ParseDeclareStatement ¶ added in v1.7.0
func (p *Parser) ParseDeclareStatement() (*ast.DeclareStatement, error)
func (*Parser) ParseDirectorBackend ¶ added in v1.7.0
func (p *Parser) ParseDirectorBackend() (ast.Expression, error)
func (*Parser) ParseDirectorDeclaration ¶ added in v1.7.0
func (p *Parser) ParseDirectorDeclaration() (*ast.DirectorDeclaration, error)
func (*Parser) ParseDirectorProperty ¶ added in v1.7.0
func (p *Parser) ParseDirectorProperty() (ast.Expression, error)
func (*Parser) ParseErrorStatement ¶ added in v1.7.0
func (p *Parser) ParseErrorStatement() (*ast.ErrorStatement, error)
func (*Parser) ParseEsiStatement ¶ added in v1.7.0
func (p *Parser) ParseEsiStatement() (*ast.EsiStatement, error)
func (*Parser) ParseExpression ¶ added in v1.0.0
func (p *Parser) ParseExpression(precedence int) (ast.Expression, error)
func (*Parser) ParseFallthroughStatement ¶ added in v1.7.0
func (p *Parser) ParseFallthroughStatement() (*ast.FallthroughStatement, error)
func (*Parser) ParseFunctionArgumentExpressions ¶ added in v1.7.0
func (p *Parser) ParseFunctionArgumentExpressions() ([]ast.Expression, error)
func (*Parser) ParseFunctionCall ¶ added in v1.7.0
func (p *Parser) ParseFunctionCall() (*ast.FunctionCallStatement, error)
func (*Parser) ParseFunctionCallExpression ¶ added in v1.7.0
func (p *Parser) ParseFunctionCallExpression(fn ast.Expression) (ast.Expression, error)
func (*Parser) ParseGotoDestination ¶ added in v1.7.0
func (p *Parser) ParseGotoDestination() (*ast.GotoDestinationStatement, error)
func (*Parser) ParseGotoStatement ¶ added in v1.7.0
func (p *Parser) ParseGotoStatement() (*ast.GotoStatement, error)
func (*Parser) ParseGroupedExpression ¶ added in v1.7.0
func (p *Parser) ParseGroupedExpression() (*ast.GroupedExpression, error)
func (*Parser) ParseIdent ¶ added in v1.7.0
func (*Parser) ParseIfExpression ¶ added in v1.7.0
func (p *Parser) ParseIfExpression() (*ast.IfExpression, error)
func (*Parser) ParseIfStatement ¶ added in v1.7.0
func (p *Parser) ParseIfStatement() (*ast.IfStatement, error)
func (*Parser) ParseImportStatement ¶ added in v1.7.0
func (p *Parser) ParseImportStatement() (*ast.ImportStatement, error)
func (*Parser) ParseIncludeStatement ¶ added in v1.7.0
func (*Parser) ParseInfixExpression ¶ added in v1.7.0
func (p *Parser) ParseInfixExpression(left ast.Expression) (ast.Expression, error)
func (*Parser) ParseInfixStringConcatExpression ¶ added in v1.7.0
func (p *Parser) ParseInfixStringConcatExpression(left ast.Expression) (ast.Expression, error)
func (*Parser) ParseLogStatement ¶ added in v1.7.0
func (p *Parser) ParseLogStatement() (*ast.LogStatement, error)
func (*Parser) ParsePenaltyboxDeclaration ¶ added in v1.7.0
func (p *Parser) ParsePenaltyboxDeclaration() (*ast.PenaltyboxDeclaration, error)
func (*Parser) ParsePostfixExpression ¶ added in v1.7.0
func (p *Parser) ParsePostfixExpression(left ast.Expression) (ast.Expression, error)
func (*Parser) ParsePrefixExpression ¶ added in v1.7.0
func (p *Parser) ParsePrefixExpression() (*ast.PrefixExpression, error)
func (*Parser) ParseRatecounterDeclaration ¶ added in v1.7.0
func (p *Parser) ParseRatecounterDeclaration() (*ast.RatecounterDeclaration, error)
func (*Parser) ParseRemoveStatement ¶ added in v1.7.0
func (p *Parser) ParseRemoveStatement() (*ast.RemoveStatement, error)
func (*Parser) ParseRestartStatement ¶ added in v1.7.0
func (p *Parser) ParseRestartStatement() (*ast.RestartStatement, error)
func (*Parser) ParseReturnStatement ¶ added in v1.7.0
func (p *Parser) ParseReturnStatement() (*ast.ReturnStatement, error)
func (*Parser) ParseSetStatement ¶ added in v1.7.0
func (p *Parser) ParseSetStatement() (*ast.SetStatement, error)
func (*Parser) ParseSnippetVCL ¶ added in v0.9.3
ParseSnippetVCL is used for snippet parsing. VCL snippet is a piece of vcl code so we should Parse like BlockStatement inside, and returns slice of statement.
func (*Parser) ParseStatement ¶ added in v1.7.0
func (*Parser) ParseSubroutineDeclaration ¶ added in v1.7.0
func (p *Parser) ParseSubroutineDeclaration() (*ast.SubroutineDeclaration, error)
func (*Parser) ParseSwitchStatement ¶ added in v1.7.0
func (p *Parser) ParseSwitchStatement() (*ast.SwitchStatement, error)
func (*Parser) ParseSyntheticBase64Statement ¶ added in v1.7.0
func (p *Parser) ParseSyntheticBase64Statement() (*ast.SyntheticBase64Statement, error)
func (*Parser) ParseSyntheticStatement ¶ added in v1.7.0
func (p *Parser) ParseSyntheticStatement() (*ast.SyntheticStatement, error)
func (*Parser) ParseTableDeclaration ¶ added in v1.7.0
func (p *Parser) ParseTableDeclaration() (*ast.TableDeclaration, error)
func (*Parser) ParseTableProperty ¶ added in v1.7.0
func (p *Parser) ParseTableProperty() (*ast.TableProperty, error)
func (*Parser) ParseUnsetStatement ¶ added in v1.7.0
func (p *Parser) ParseUnsetStatement() (*ast.UnsetStatement, error)
type ParserOption ¶ added in v1.7.0
type ParserOption func(p *Parser)
func WithCustomParser ¶ added in v1.7.0
func WithCustomParser(cps ...CustomParser) ParserOption
Click to show internal directories.
Click to hide internal directories.