Expand description
Source positions and related helper functions.
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.
- Compact
Str - Lifetimeless version of [
Atom<'_>
] which owns its own string data allocation. - Source
Type - Source Type for JavaScript vs TypeScript / Script vs Module / JSX
- Span
- A range in text, represented by a zero-indexed start and end offset.
- Unknown
Extension - Error returned by
SourceType::from_path
andSourceType::from_extension
when the file extension is not found or recognized.
Enums§
- Language
- JavaScript or TypeScript
- Language
Variant - JSX for JavaScript and TypeScript
- Module
Kind - 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§
- Content
Eq - 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.
- GetSpan
Mut - Get mutable ref to span for an AST node.