parser

package
v1.14.3 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: MIT Imports: 7 Imported by: 67

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(tokens token.Tokens, mode Mode, opts ...Option) (*ast.File, error)

Parse parse from token instances, and returns ast.File

func ParseBytes

func ParseBytes(bytes []byte, mode Mode, opts ...Option) (*ast.File, error)

ParseBytes parse from byte slice, and returns ast.File

func ParseFile

func ParseFile(filename string, mode Mode, opts ...Option) (*ast.File, error)

Parse parse from filename, and returns ast.File

Types

type Mode

type Mode uint
const (
	ParseComments Mode = 1 << iota // parse comments and add them to AST
)

type Option added in v1.14.0

type Option func(p *parser)

Option represents parser's option.

func AllowDuplicateMapKey added in v1.14.0

func AllowDuplicateMapKey() Option

AllowDuplicateMapKey allow the use of keys with the same name in the same map, but by default, this is not permitted.

Jump to

Keyboard shortcuts

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