parser

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// These are arranged such that ESNext is the default zero value and such
	// that earlier releases are less than later releases
	ES2015 = -6
	ES2016 = -5
	ES2017 = -4
	ES2018 = -3
	ES2019 = -2
	ES2020 = -1
	ESNext = 0
)

Variables

This section is empty.

Functions

func ModuleExportsAST

func ModuleExportsAST(log logging.Log, source logging.Source, options ParseOptions, expr ast.Expr) ast.AST

func Parse

func Parse(log logging.Log, source logging.Source, options ParseOptions) (result ast.AST, ok bool)

func ParseJSON added in v0.1.7

func ParseJSON(log logging.Log, source logging.Source) (result ast.Expr, ok bool)

Types

type DefineFunc added in v0.1.13

type DefineFunc func(DefineHelper) ast.E

type DefineHelper added in v0.1.13

type DefineHelper interface {
	FindSymbol(name string) ast.Ref
}

type JSXOptions

type JSXOptions struct {
	Parse    bool
	Factory  []string
	Fragment []string
}

type LanguageTarget

type LanguageTarget int8

type ParseOptions

type ParseOptions struct {
	// true: imports are scanned and bundled along with the file
	// false: imports are left alone and the file is passed through as-is
	IsBundling bool

	Defines              map[string]DefineFunc
	MangleSyntax         bool
	KeepSingleExpression bool
	OmitWarnings         bool
	TS                   TypeScriptOptions
	JSX                  JSXOptions
	Target               LanguageTarget
}

type TypeScriptOptions

type TypeScriptOptions struct {
	Parse bool
}

Jump to

Keyboard shortcuts

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