1mod cmp;
6mod edit_distance;
7#[cfg(feature = "serialize")]
8mod serialize;
9mod source_type;
10mod span;
11
12pub use cmp::ContentEq;
13pub use edit_distance::{best_match, min_edit_distance};
14use oxc_str::{CompactStr, Ident, Str};
15pub use source_type::{
16 FileExtension, Language, LanguageVariant, ModuleKind, SourceType, UnknownExtension,
17 VALID_EXTENSIONS,
18};
19pub use span::{GetSpan, GetSpanMut, SPAN, Span};
20
21#[cfg(debug_assertions)]
23use span::I32Dummy;
24
25mod generated {
26 #[cfg(debug_assertions)]
27 mod assert_layouts;
28 mod derive_dummy;
29 #[cfg(feature = "serialize")]
30 mod derive_estree;
31}
32
33#[doc(hidden)]
34pub mod __internal {
35 pub use compact_str::format_compact;
37 pub use oxc_allocator::StringBuilder as ArenaStringBuilder;
39}
40
41use std::ops::Index;
43
44impl ContentEq for Str<'_> {
45 #[inline]
46 fn content_eq(&self, other: &Self) -> bool {
47 self == other
48 }
49}
50
51impl ContentEq for Ident<'_> {
52 #[inline]
53 fn content_eq(&self, other: &Self) -> bool {
54 self == other
55 }
56}
57
58impl Index<Span> for CompactStr {
59 type Output = str;
60
61 fn index(&self, index: Span) -> &Self::Output {
62 &self.as_str()[index.start as usize..index.end as usize]
63 }
64}