parser

package
v0.0.3-a08 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2022 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 ParseAnnotation

func ParseAnnotation(p ParseStream, ident *ast.VariableIdentifier,
	annotationFunctionType token.AnnotationFunctionType, precedingComments *ast.MultilineComment) (ast.Expression, parerr.ParseError)

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 bool) tokenize.TokenError

func ShowSourceCode

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

Types

type ParseStream

type ParseStream interface {
	AddWarning(parserError parerr.ParseError)
	Warnings() []parerr.ParseError
	// 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) AddWarning added in v0.0.2

func (p *ParseStreamImpl) AddWarning(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)

func (*ParseStreamImpl) Warnings added in v0.0.2

func (p *ParseStreamImpl) Warnings() []parerr.ParseError

type Parser

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

func NewParser

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

func (*Parser) AddError added in v0.0.2

func (p *Parser) AddError(parseError 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
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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