Modules§
Structs§
- Source emitted based on the emit options.
- Source emitted based on the emit options.
- An implementation of swc’s
Comments
that implementsSync
to support being used in multi-threaded code. This implementation is immutable and should you need mutability you may create a copy by converting it to an swcSingleThreadedComments
. - Parsing diagnostic.
- Parameters for parsing.
- A parsed source containing an AST, comments, and possibly tokens.
- Implements a configuration trait for source maps that reflects the logic to embed sources in the source map or not.
- Swc unfortunately uses
BytePos(0)
as a magic value. This means that we can’t have byte positions of nodes line up with the text. To get around this, we have created our ownSourcePos
wrapper that hides the underlying swc byte position so it can’t be used incorrectly. - Stores the source text along with other data such as where all the lines occur in the text.
- A special source pos that indicates the source start which functions can use as a parameter type in order to ensure someone doesn’t provide the wrong position.
- Options which can be adjusted when transpiling a module.
Enums§
- Holds whether the
ParsedSource
was cloned or consumed (owned) during transpilation. This is useful for logging in the CLI when transpilation occurs when aParsedSource
is cloned, as it’s a performance issue.
Constants§
- Ecmascript version used for lexing and parsing.
Traits§
- A Module or Script node.
- Adds source position helper methods for swc types that implement
swc_common::Spanned
.
Functions§
- Applies the text changes to the given source text.
- Emits the program as a string of JavaScript code, possibly with the passed comments, and optionally also a source map.
- Low level function for transpiling a program.
- Gets the default
Syntax
used bydeno_ast
for the provided media type. - Given the source text and media type, tokenizes the provided text to a collection of tokens and comments.
- Parses the provided information to a module.
- Parses a module with post processing (see docs on
parse_program_with_post_process
). - Parses the provided information attempting to figure out if the provided text is for a script or a module.
- Parses the provided information as a program with the option of providing some post-processing to the result.
- Parses the provided information to a script.
- Parses a script with post processing (see docs on
parse_program_with_post_process
).
Type Aliases§
- A 1-indexed line and column type which should be used for display purposes only (ex. in diagnostics).
- A 0-indexed line and column type.