Module rslint_parser::ast[][src]

Expand description

AST definitions for converting untyped syntax nodes into typed AST nodes.

Every field of every AST node is optional, this is to allow the parser to recover from any error and produce an ast from any source code. If you don’t want to account for optionals for everything, you can use …

Macros

A simple macro for making assign, binop, or unary operators

Structs

An iterator over SyntaxNode children of a particular AST type.

A type signifying any type (Any)

A type signifying a JavaScript bigint (big integer) (bigint)

A type signifying a boolean (boolean)

A TypeScript const assertion either as foo as const or <const>foo

A type represented by a literal value

A type which allows the creation of new types from existing ones by mapping over property types.

An optional readonly modifier applied to mapped types

A type signifying a function never returns (never)

A type signifying a JavaScript null value (null)

A type signifying a number (number)

A type signifying a JavaScript Object, any non-primitive (object)

A parenthesized type

A type guard which performs a runtime check to guarantee the type of something in a scope

A full path to a type from a namespace. e.g. foo.bar or foo.bar.baz

A type signifying a JavaScript string (string)

A type signifying a JavaScript Symbol (symbol)

A type signifying JavaScript’s this

A type with a fixed number of elements with known types

An individual tuple element, this could be a rest element and could be named: e.g. number, foo: number, ...number, or ...foo: number

A reference to a type which may or may not have type arguments. e.g. Foo, Foo<Bar>, Foo<Bar, Baz>

A type signifying a JavaScript undefined value (undefined)

A type signifying an unknown type (Unknown)

A type signifying no type (void)

Enums

A binary operation applied to two expressions

The beginning to a For or For..in statement which can either be a variable declaration or an expression

Either a statement or a declaration such as a function

Either a single type reference or a fully qualified path

A TypeScript type

Traits

The main trait to go from untyped SyntaxNode to a typed ast. The conversion itself has zero runtime cost: ast and syntax nodes have exactly the same representation: a pointer to the tree root and a pointer to the node itself.

Like AstNode, but wraps tokens rather than interior nodes.