Crate oxc_span

Source
Expand description

Source positions and related helper functions.

https://doc.rust-lang.org/beta/nightly-rustc/rustc_span

Macros§

format_atom
Creates an Atom using interpolation of runtime expressions.
format_compact_str
Creates a CompactStr using interpolation of runtime expressions.

Structs§

Atom
An inlinable string for oxc_allocator.
CompactStr
Lifetimeless version of [Atom<'_>] which owns its own string data allocation.
SourceType
Source Type for JavaScript vs TypeScript / Script vs Module / JSX
Span
A range in text, represented by a zero-indexed start and end offset.
UnknownExtension
Error returned by SourceType::from_path and SourceType::from_extension when the file extension is not found or recognized.

Enums§

Language
JavaScript or TypeScript
LanguageVariant
JSX for JavaScript and TypeScript
ModuleKind
Script or Module

Constants§

ATOM_MAX_INLINE_LEN
Maximum length for inline string, which can be created with CompactStr::new_const.
SPAN
An empty span.
VALID_EXTENSIONS
Valid file extensions.

Traits§

ContentEq
This trait works similarly to PartialEq but it gives the liberty of checking the equality of the content loosely.
GetSpan
Get the span for an AST node.
GetSpanMut
Get mutable ref to span for an AST node.