parser

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: BSD-2-Clause Imports: 6 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Accept

func Accept[T node.Node](s *ParseState, nodeFunc node.NewNodeFunc[T]) T

func Error

func Error(s *ParseState, err error) error

func IsAnyKind

func IsAnyKind(t tokenize.Token, k ...tokenize.TokenKind) bool

func IsAnySpecial

func IsAnySpecial(t tokenize.Token, r ...rune) bool

func IsIdentifier

func IsIdentifier(t tokenize.Token, ignoreCase bool, pattern ...string) bool

func IsKeyword

func IsKeyword(t tokenize.Token, code node.KeywordCode) bool

func ParseIdentifier

func ParseIdentifier(s *ParseState) (node.IdentifierNode, error)

func ParseKeyword

func ParseKeyword(s *ParseState) (node.KeywordNode, error)

func ParsePath

func ParsePath(s *ParseState) (node.PathNode, error)

func ParseStructField

func ParseStructField(s *ParseState) (node.StructTypeFieldNode, error)

func ParseType

func ParseType(s *ParseState) (node.TypeNode, error)

func ParseTypeSize

func ParseTypeSize(s *ParseState) (node.TypeSizeNode, error)

Types

type ParseState

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

func NewParseState

func NewParseState(input []tokenize.Token) *ParseState

func (*ParseState) Child

func (s *ParseState) Child() *ParseState

func (*ParseState) Len

func (s *ParseState) Len() int

func (*ParseState) Move

func (s *ParseState) Move(offset int)

func (*ParseState) PeekAt

func (s *ParseState) PeekAt(offset int) tokenize.Token

func (*ParseState) SkipSpacesAndComments

func (s *ParseState) SkipSpacesAndComments()

Jump to

Keyboard shortcuts

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