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: 0

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