1#![deny(clippy::all)]
30#![cfg_attr(docsrs, feature(doc_cfg))]
31#![cfg_attr(not(test), allow(unused))]
32
33use std::fmt::Debug;
34
35pub use ast_node::{ast_node, ast_serde, DeserializeEnum, Spanned};
36pub use from_variant::FromVariant;
37pub use swc_eq_ignore_macros::{EqIgnoreSpan, TypeEq};
38
39pub use self::{
40 eq::{EqIgnoreSpan, TypeEq},
41 errors::{SourceMapper, SourceMapperDyn},
42 pos::{
43 hygiene, BytePos, CharPos, FileName, Globals, Loc, LocWithOpt, Mark, MultiSpan, SourceFile,
44 SourceFileAndBytePos, SourceFileAndLine, Span, SpanLinesError, Spanned, SyntaxContext,
45 DUMMY_SP, GLOBALS, NO_EXPANSION,
46 },
47 source_map::{FileLines, FileLoader, FilePathMapping, SourceMap, SpanSnippetError},
48 syntax_pos::LineCol,
49};
50
51pub trait AstNode: Debug + PartialEq + Clone + Spanned {
53 const TYPE: &'static str;
54}
55
56pub mod cache;
57pub mod comments;
58mod eq;
59pub mod errors;
60pub mod input;
61pub mod iter;
62pub mod pass;
63pub mod plugin;
64mod pos;
65#[doc(hidden)]
66pub mod private;
67mod rustc_data_structures;
68pub mod serializer;
69pub mod source_map;
70pub mod sync;
71mod syntax_pos;
72pub mod util;
73
74#[cfg(all(not(debug_assertions), feature = "plugin-rt", feature = "plugin-mode"))]
75compile_error!("You can't enable `plugin-rt` and `plugin-mode` at the same time");
76
77#[cfg(feature = "rkyv-impl")]
83#[doc(hidden)]
84pub use self::syntax_pos::{
85 ArchivedBytePos, ArchivedCharPos, ArchivedFileName, ArchivedMultiSpan, ArchivedSourceFile,
86 ArchivedSourceFileAndBytePos, ArchivedSpan, ArchivedSpanLinesError, ArchivedSpanSnippetError,
87};