parser

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ColorAtom

func ColorAtom(atomType dtype.Atom, indentation int, inside bool, colorer coloring.Colorer)

func ColorType

func ColorType(dType dtype.Type, indentation int, inside bool, colorer coloring.Colorer)

func ColorTypeWithAtom

func ColorTypeWithAtom(dType dtype.Type, indentation int, inside bool, colorer coloring.Colorer)

func ColorTypesWithAtom

func ColorTypesWithAtom(dTypes []dtype.Type, indentation int, inside bool, colorer coloring.Colorer)

func IsCompileErr added in v0.0.5

func IsCompileErr(parseError error) bool

func IsCompileError added in v0.0.5

func IsCompileError(parseError parerr.ParseError) bool

func ParseLiteralOrConstant added in v0.0.4

func ParseLiteralOrConstant(p ParseStream, indentation int) (ast.Expression, parerr.ParseError)

func ParseScopedOrNormalVariable added in v0.0.4

func ParseScopedOrNormalVariable(p ParseStream) (ast.ScopedOrNormalVariableIdentifier, parerr.ParseError)

func ShowError

func ShowError(tokenizer *tokenize.Tokenizer, filename string, parserError parerr.ParseError,
	verbose verbosity.Verbosity, errorAsWarning ReportAsSeverity) tokenize.TokenError

func ShowSourceCode

func ShowSourceCode(tokenizer *tokenize.Tokenizer, highlightLine int,
	highlightColumn int, posLength token.SourceFileReference) error

Types

type ParseStream

type ParseStream interface {
	// contains filtered or unexported methods
}

type ParseStreamImpl

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

func NewParseStreamImpl

func NewParseStreamImpl(parser ParserInterface, tokenizer *tokenize.Tokenizer, enforceStyle bool) *ParseStreamImpl

func (*ParseStreamImpl) AddError added in v0.0.2

func (p *ParseStreamImpl) AddError(parseError parerr.ParseError)

func (*ParseStreamImpl) Errors added in v0.0.2

func (p *ParseStreamImpl) Errors() parerr.ParseError

func (*ParseStreamImpl) SkipToNextLineWithSameOrLowerIndent added in v0.0.2

func (p *ParseStreamImpl) SkipToNextLineWithSameOrLowerIndent(indentation int) (int, tokenize.TokenError)

type Parser

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

func NewParser

func NewParser(tokenizer *tokenize.Tokenizer, enforceStyle bool) *Parser

func (*Parser) Errors added in v0.0.4

func (p *Parser) Errors() parerr.ParseError

func (*Parser) Nodes

func (p *Parser) Nodes() []ast.Node

func (*Parser) Parse

func (p *Parser) Parse() (*ast.SourceFile, parerr.ParseError)

func (*Parser) ParseExpression

func (p *Parser) ParseExpression() (*ast.SourceFile, parerr.ParseError)

type ParserInterface

type ParserInterface interface {
	// contains filtered or unexported methods
}

type Precedence

type Precedence int
const (
	NONE Precedence = iota
	LOWEST
	UPDATE
	ASSIGN
	PIPE
	ANDOR
	EQUALS
	LESSGREATER
	SUM
	PRODUCT
	PREFIX
	HIGHEST
)

type ReportAsSeverity added in v0.0.4

type ReportAsSeverity uint8
const (
	ReportAsSeverityNote ReportAsSeverity = iota
	ReportAsSeverityInfo
	ReportAsSeverityWarning
	ReportAsSeverityError
)

func HighestSeverity added in v0.0.5

func HighestSeverity(err error) ReportAsSeverity

func ShowAsError added in v0.0.4

func ShowAsError(tokenizer *tokenize.Tokenizer, parserError parerr.ParseError) ReportAsSeverity

func ShowWarningOrError added in v0.0.4

func ShowWarningOrError(tokenizer *tokenize.Tokenizer, parserError parerr.ParseError) ReportAsSeverity

func TypeOfWarning added in v0.0.5

func TypeOfWarning(parserError parerr.ParseError) ReportAsSeverity

func TypeOfWarningRecursive added in v0.0.9

func TypeOfWarningRecursive(parserError error) ReportAsSeverity

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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