Module sljs::ast

source · []
Expand description

JavaScript AST structures

A Program is the root of an AST. A Program contains a BlockStatement which is a sequence of Statements. A Statement is a wrapper for Stmt enum with some additional information. A Stmt enumerates every possible statement, e.g. VariableDeclaration, IfStatement, ExpressionStatement, etc.

ExpressionStatement is an Expression wrapped into a statement. An Expression is a wrapper for Expr enum that enumerates all possible expressions, e.g. CallExpression, MemberExpression, Identifier, AssignmentExpression, etc.

One of Expr variants is FunctionExpression that wraps a Function with its own BlockStatement body.

Re-exports

pub use self::expr::*;
pub use self::stmt::*;

Modules

AST builder DSL AST builder DSL

Expression, Expr, all expression structs AST definitions for JavaScript expressions.

Statement, Stmt, all statement structs AST definitions for JavaScript statements.

Structs

Represents a lexical bindings of a name. It might be a hoisted Function.

A binding to a hoisted Function.

A let/const binding.

LexicalContext collects lexical scope information for some static analysis.

Represents a complete top-level JS script.