Skip to main content

Module ast

Module ast 

Source
Expand description

JavaScript abstract syntax tree.

Every node here has a direct lowering in compiler.rs. JS is statement-oriented with brace-delimited blocks, so the tree separates Stmt (blocks of these form a program/function body) from Expr. Numbers are all IEEE-754 f64, matching JavaScript’s single number type.

Structs§

ClassMember
One member of a class body: a method, accessor, or field, on the instance or static side.
ClassNode
A class declaration/expression body.
Declarator
A single declarator inside a var/let/const.
Param
A formal parameter.
Stmt
A statement plus its 1-based source line.
SwitchCase
One case/default clause of a switch.

Enums§

BinOp
A binary operator (a <op> b). &&/||/?? are LogicalOp because they short-circuit and yield an operand value, not a coerced boolean.
DeclKind
The kind of a variable declaration.
Expr
A JavaScript expression.
FnBody
A function/arrow body: either a brace-delimited statement list or (arrow) a single expression whose value is returned.
LogicalOp
A short-circuiting logical operator.
MemberKind
The kind of a class member.
Prop
A property of an object literal.
StmtKind
A JavaScript statement.
UnOp
A unary prefix operator.
UpdateOp
The update (increment/decrement) operator, prefix or postfix.