Skip to main content

Crate oxc_span

Crate oxc_span 

Source
Expand description

Source positions and related helper functions.

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

Modules§

ident
Identifier string type with precomputed hash.

Macros§

format_compact_str
Creates a CompactStr using interpolation of runtime expressions.
format_ident
Creates an Ident using interpolation of runtime expressions.
format_str
Creates a Str using interpolation of runtime expressions.

Structs§

CompactStr
Lifetimeless version of Str which owns its own string data allocation.
Ident
An identifier string for oxc_allocator with a precomputed hash.
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.
Str
An inlinable string for oxc_allocator.
UnknownExtension
Error returned by SourceType::from_path and SourceType::from_extension when the file extension is not found or recognized.

Enums§

FileExtension
Valid file extension.
Language
JavaScript or TypeScript
LanguageVariant
JSX for JavaScript and TypeScript
ModuleKind
Script or Module

Constants§

SPAN
An empty span.
STR_MAX_INLINE_LEN
Maximum length for inline string, which can be created with CompactStr::new_const.
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.

Functions§

best_match
Returns the closest candidate to needle within threshold, or None.
min_edit_distance
Returns the Levenshtein edit distance between a and b.

Type Aliases§

ArenaIdentHashMap
Arena-allocated hash map keyed by Ident, using precomputed ident hash.
IdentHashMap
Hash map keyed by Ident, using precomputed ident hash.
IdentHashSet
Hash set of Ident, using precomputed ident hash.