Crate dprint_swc_ecma_ast_view[−][src]
Re-exports
pub use swc_ecmascript::ast as swc_ast;
Structs
Array literal.
{key}
or {key = value}
Identifer used as a pattern.
Use when only block statements are allowed.
A byte offset. Keep this small (currently 32-bits), as AST contains a lot of them.
Class expression.
export * from 'mod'
export * as foo from 'src';
Function expression.
Common parts of function and method.
Ident with span.
e.g. import foo from 'mod.js'
e.g. local = foo, imported = None import { foo } from 'mod.js'
e.g. local = bar, imported = Some(foo) for import { foo as bar } from 'mod.js'
e.g. import * as foo from 'mod.js'
.
Represents a invalid node.
XML-based namespace syntax:
{key: value}
export { foo } from 'mod'
export { foo as bar } from 'mod'
Object literal.
EsTree RestElement
Spans represent a region of code, used for error reporting. Positions in
spans are absolute positions from the beginning of the source_map
, not
positions relative to SourceFile
s. Methods on the SourceMap
can be used
to relate spans back to the original source.
You must be careful if the span crosses more than one file - you will not be
able to use many of the functions on spans in source_map
and you cannot
assume that the length of the span = hi - lo
; there may be space in the
BytePos
range between files.
TypeScript’s own parser uses ExportAssignment for both export default
and
export =
. But for @babel/parser, export default
is an ExportDefaultDecl,
so a TsExportAssignment is always export =
.
typeof
operator
Enums
Used for obj
property of JSXMemberExpr
.
A Module or Script node.
THis enum determines how string literal should be printed.
namespace A.B { }
is a namespace named A
with another TsNamespaceDecl as
its body.