Skip to content

Commit

Permalink
refactor(ast): move ModuleRecord to oxc_syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
Boshen committed Jul 3, 2023
1 parent 8fdb6b6 commit 17a73b1
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 8 deletions.
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion crates/oxc_ast/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ mod serialize;
pub mod ast;
mod ast_builder;
mod ast_kind;
pub mod module_record;
mod span;
pub mod syntax_directed_operations;
mod trivia;
Expand Down
3 changes: 2 additions & 1 deletion crates/oxc_semantic/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
use std::{cell::RefCell, rc::Rc};

#[allow(clippy::wildcard_imports)]
use oxc_ast::{ast::*, module_record::ModuleRecord, AstKind, Trivias, Visit};
use oxc_ast::{ast::*, AstKind, Trivias, Visit};
use oxc_diagnostics::Error;
use oxc_span::{Atom, SourceType, Span};
use oxc_syntax::module_record::ModuleRecord;
use rustc_hash::FxHashMap;

use crate::{
Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_semantic/src/checker/javascript.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#[allow(clippy::wildcard_imports)]
use oxc_ast::{
ast::*,
module_record::ExportLocalName,
syntax_directed_operations::{BoundNames, IsSimpleParameterList, PropName},
AstKind,
};
Expand All @@ -11,6 +10,7 @@ use oxc_diagnostics::{
};
use oxc_span::{Atom, GetSpan, ModuleKind, Span};
use oxc_syntax::{
module_record::ExportLocalName,
operator::{BinaryOperator, LogicalOperator, UnaryOperator},
NumberBase,
};
Expand Down
3 changes: 2 additions & 1 deletion crates/oxc_semantic/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ use std::rc::Rc;

pub use builder::{SemanticBuilder, SemanticBuilderReturn};
pub use jsdoc::{JSDoc, JSDocComment, JSDocTag};
use oxc_ast::{ast::IdentifierReference, module_record::ModuleRecord, AstKind, Trivias};
use oxc_ast::{ast::IdentifierReference, AstKind, Trivias};
use oxc_span::SourceType;
pub use oxc_syntax::{
module_record::ModuleRecord,
scope::{ScopeFlags, ScopeId},
symbol::{SymbolFlags, SymbolId},
};
Expand Down
4 changes: 3 additions & 1 deletion crates/oxc_semantic/src/module_record/builder.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#[allow(clippy::wildcard_imports)]
use oxc_ast::{ast::*, module_record::*, syntax_directed_operations::BoundNames};
use oxc_ast::{ast::*, syntax_directed_operations::BoundNames};
use oxc_span::{Atom, GetSpan, Span};
#[allow(clippy::wildcard_imports)]
use oxc_syntax::module_record::*;

#[derive(Debug, Default)]
pub struct ModuleRecordBuilder {
Expand Down
4 changes: 2 additions & 2 deletions crates/oxc_semantic/src/module_record/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ pub use builder::ModuleRecordBuilder;
#[cfg(test)]
mod module_record_tests {
use oxc_allocator::Allocator;
#[allow(clippy::wildcard_imports)]
use oxc_ast::module_record::*;
use oxc_parser::Parser;
use oxc_span::{SourceType, Span};
#[allow(clippy::wildcard_imports)]
use oxc_syntax::module_record::*;

use crate::SemanticBuilder;

Expand Down
5 changes: 4 additions & 1 deletion crates/oxc_syntax/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ default = []
serde = ["dep:serde"]

[dependencies]
oxc_index = { workspace = true }
oxc_span = { workspace = true }

unicode-id-start = { workspace = true }
serde = { workspace = true, features = ["derive"], optional = true }
oxc_index = { workspace = true }
bitflags = { workspace = true }
rustc-hash = { workspace = true }
1 change: 1 addition & 0 deletions crates/oxc_syntax/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//! Common code for JavaScript Syntax
pub mod identifier;
pub mod module_record;
pub mod operator;
pub mod precedence;
pub mod scope;
Expand Down
File renamed without changes.

0 comments on commit 17a73b1

Please sign in to comment.