parser

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2024 License: MIT Imports: 11 Imported by: 1

Documentation

Index

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

This section is empty.

Types

type ParseError

type ParseError struct {
	Token   token.Token
	Message string
}

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 New

func New(l *lexer.Lexer) *Parser

func (*Parser) ParseExpression added in v1.0.0

func (p *Parser) ParseExpression(precedence int) (ast.Expression, error)

Expose global function to be called externally

func (*Parser) ParseSnippetVCL added in v0.9.3

func (p *Parser) ParseSnippetVCL() ([]ast.Statement, error)

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) ParseVCL

func (p *Parser) ParseVCL() (*ast.VCL, error)

Jump to

Keyboard shortcuts

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