parser

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2025 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ReferencePragmaSpec = &ast.PragmaSpecification{
	Args: []ast.PragmaArgumentSpecification{
		{Name: "types", Optional: false, CaptureSpan: true},
		{Name: "lib", Optional: false, CaptureSpan: true},
		{Name: "path", Optional: false, CaptureSpan: true},
		{Name: "no-default-lib", Optional: false, CaptureSpan: true},
		{Name: "resolution-mode", Optional: false, CaptureSpan: true},
		{Name: "preserve", Optional: false, CaptureSpan: true},
	},
	Kind: ast.PragmaKindTripleSlashXML,
}

Functions

func ParseJSONText

func ParseJSONText(fileName string, path tspath.Path, sourceText string) *ast.SourceFile

func ParseSourceFile

func ParseSourceFile(fileName string, path tspath.Path, sourceText string, languageVersion core.ScriptTarget, jsdocParsingMode scanner.JSDocParsingMode) *ast.SourceFile

Types

type NamedArgRegEx

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

type ParseFlags

type ParseFlags uint32
const (
	ParseFlagsNone                   ParseFlags = 0
	ParseFlagsYield                  ParseFlags = 1 << 0
	ParseFlagsAwait                  ParseFlags = 1 << 1
	ParseFlagsType                   ParseFlags = 1 << 2
	ParseFlagsIgnoreMissingOpenBrace ParseFlags = 1 << 4
	ParseFlagsJSDoc                  ParseFlags = 1 << 5
)

type Parser

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

type ParserState

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

type ParsingContext

type ParsingContext int
const (
	PCSourceElements           ParsingContext = iota // Elements in source file
	PCBlockStatements                                // Statements in block
	PCSwitchClauses                                  // Clauses in switch statement
	PCSwitchClauseStatements                         // Statements in switch clause
	PCTypeMembers                                    // Members in interface or type literal
	PCClassMembers                                   // Members in class declaration
	PCEnumMembers                                    // Members in enum declaration
	PCHeritageClauseElement                          // Elements in a heritage clause
	PCVariableDeclarations                           // Variable declarations in variable statement
	PCObjectBindingElements                          // Binding elements in object binding list
	PCArrayBindingElements                           // Binding elements in array binding list
	PCArgumentExpressions                            // Expressions in argument list
	PCObjectLiteralMembers                           // Members in object literal
	PCJsxAttributes                                  // Attributes in jsx element
	PCJsxChildren                                    // Things between opening and closing JSX tags
	PCArrayLiteralMembers                            // Members in array literal
	PCParameters                                     // Parameters in parameter list
	PCJSDocParameters                                // JSDoc parameters in parameter list of JSDoc function type
	PCRestProperties                                 // Property names in a rest type list
	PCTypeParameters                                 // Type parameters in type parameter list
	PCTypeArguments                                  // Type arguments in type argument list
	PCTupleElementTypes                              // Element types in tuple element type list
	PCHeritageClauses                                // Heritage clauses for a class or interface declaration.
	PCImportOrExportSpecifiers                       // Named import clause's import specifier list
	PCImportAttributes                               // Import attributes
	PCJSDocComment                                   // Parsing via JSDocParser
	PCCount                                          // Number of parsing contexts
)

type ParsingContexts

type ParsingContexts int

Jump to

Keyboard shortcuts

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