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