mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 12:19:15 +00:00
refactor(ast_tools): rename oxc_ast_codegen to oxc_ast_tools. (#4846)
This PR renames the `oxc_ast_codegen` crate to `oxc_ast_tools`, It improves the readability and organization of the codebase by giving the crate a name that better reflects its purpose and contents. It also improves the error message in CI.
This commit is contained in:
parent
0a23610d9a
commit
8e8fcd0584
39 changed files with 31 additions and 31 deletions
2
.github/.generated_ast_watch_list.yml
vendored
2
.github/.generated_ast_watch_list.yml
vendored
|
|
@ -1,4 +1,4 @@
|
|||
# To edit this generated file you have to edit `tasks/ast_codegen/src/main.rs`
|
||||
# To edit this generated file you have to edit `tasks/ast_tools/src/main.rs`
|
||||
# Auto-generated code, DO NOT EDIT DIRECTLY!
|
||||
|
||||
src:
|
||||
|
|
|
|||
8
.github/workflows/ci.yml
vendored
8
.github/workflows/ci.yml
vendored
|
|
@ -280,12 +280,12 @@ jobs:
|
|||
if: steps.filter.outputs.src == 'true'
|
||||
with:
|
||||
components: rustfmt
|
||||
cache-key: codegen
|
||||
cache-key: ast_changes
|
||||
save-cache: ${{ github.ref_name == 'main' }}
|
||||
|
||||
- name: Check AST Changes
|
||||
if: steps.filter.outputs.src == 'true'
|
||||
run: |
|
||||
cargo run -p oxc_ast_codegen
|
||||
echo 'AST changes must be commited to the repo.'
|
||||
git diff --exit-code
|
||||
cargo run -p oxc_ast_tools
|
||||
git diff --exit-code ||
|
||||
echo 'AST changes caused the "generated" code to get outdated. Have you forgotten to run the `just ast` command and/or commit generated codes?'
|
||||
|
|
|
|||
20
Cargo.lock
generated
20
Cargo.lock
generated
|
|
@ -1475,7 +1475,16 @@ dependencies = [
|
|||
]
|
||||
|
||||
[[package]]
|
||||
name = "oxc_ast_codegen"
|
||||
name = "oxc_ast_macros"
|
||||
version = "0.24.2"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "oxc_ast_tools"
|
||||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"bpaf",
|
||||
|
|
@ -1491,15 +1500,6 @@ dependencies = [
|
|||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "oxc_ast_macros"
|
||||
version = "0.24.2"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "oxc_benchmark"
|
||||
version = "0.0.0"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// NB: `#[span]`, `#[scope(...)]` and `#[visit(...)]` do NOT do anything to the code.
|
||||
// They are purely markers for codegen used in
|
||||
// `tasks/ast_codegen` and `crates/oxc_traverse/scripts`. See docs in those crates.
|
||||
// `tasks/ast_tools` and `crates/oxc_traverse/scripts`. See docs in those crates.
|
||||
|
||||
// Silence erroneous warnings from Rust Analyser for `#[derive(Tsify)]`
|
||||
#![allow(non_snake_case)]
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
// NB: `#[span]`, `#[scope(...)]` and `#[visit(...)]` do NOT do anything to the code.
|
||||
// They are purely markers for codegen used in
|
||||
// `tasks/ast_codegen` and `crates/oxc_traverse/scripts`. See docs in those crates.
|
||||
// `tasks/ast_tools` and `crates/oxc_traverse/scripts`. See docs in those crates.
|
||||
|
||||
// Silence erroneous warnings from Rust Analyser for `#[derive(Tsify)]`
|
||||
#![allow(non_snake_case)]
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
// NB: `#[span]`, `#[scope(...)]` and `#[visit(...)]` do NOT do anything to the code.
|
||||
// They are purely markers for codegen used in
|
||||
// `tasks/ast_codegen` and `crates/oxc_traverse/scripts`. See docs in those crates.
|
||||
// `tasks/ast_tools` and `crates/oxc_traverse/scripts`. See docs in those crates.
|
||||
|
||||
// Silence erroneous warnings from Rust Analyser for `#[derive(Tsify)]`
|
||||
#![allow(non_snake_case)]
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
// NB: `#[span]`, `#[scope(...)]` and `#[visit(...)]` do NOT do anything to the code.
|
||||
// They are purely markers for codegen used in
|
||||
// `tasks/ast_codegen` and `crates/oxc_traverse/scripts`. See docs in those crates.
|
||||
// `tasks/ast_tools` and `crates/oxc_traverse/scripts`. See docs in those crates.
|
||||
|
||||
// Silence erroneous warnings from Rust Analyser for `#[derive(Tsify)]`
|
||||
#![allow(non_snake_case)]
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// Auto-generated code, DO NOT EDIT DIRECTLY!
|
||||
// To edit this generated file you have to edit `tasks/ast_codegen/src/generators/assert_layouts.rs`
|
||||
// To edit this generated file you have to edit `tasks/ast_tools/src/generators/assert_layouts.rs`
|
||||
|
||||
use std::mem::{align_of, offset_of, size_of};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// Auto-generated code, DO NOT EDIT DIRECTLY!
|
||||
// To edit this generated file you have to edit `tasks/ast_codegen/src/generators/ast_builder.rs`
|
||||
// To edit this generated file you have to edit `tasks/ast_tools/src/generators/ast_builder.rs`
|
||||
|
||||
#![allow(
|
||||
clippy::default_trait_access,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// Auto-generated code, DO NOT EDIT DIRECTLY!
|
||||
// To edit this generated file you have to edit `tasks/ast_codegen/src/generators/ast_kind.rs`
|
||||
// To edit this generated file you have to edit `tasks/ast_tools/src/generators/ast_kind.rs`
|
||||
|
||||
use oxc_span::{GetSpan, Span};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// Auto-generated code, DO NOT EDIT DIRECTLY!
|
||||
// To edit this generated file you have to edit `tasks/ast_codegen/src/generators/derive_clone_in.rs`
|
||||
// To edit this generated file you have to edit `tasks/ast_tools/src/generators/derive_clone_in.rs`
|
||||
|
||||
#![allow(clippy::default_trait_access)]
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// Auto-generated code, DO NOT EDIT DIRECTLY!
|
||||
// To edit this generated file you have to edit `tasks/ast_codegen/src/generators/derive_get_span.rs`
|
||||
// To edit this generated file you have to edit `tasks/ast_tools/src/generators/derive_get_span.rs`
|
||||
|
||||
#![allow(clippy::match_same_arms)]
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// Auto-generated code, DO NOT EDIT DIRECTLY!
|
||||
// To edit this generated file you have to edit `tasks/ast_codegen/src/generators/derive_get_span.rs`
|
||||
// To edit this generated file you have to edit `tasks/ast_tools/src/generators/derive_get_span.rs`
|
||||
|
||||
#![allow(clippy::match_same_arms)]
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// Auto-generated code, DO NOT EDIT DIRECTLY!
|
||||
// To edit this generated file you have to edit `tasks/ast_codegen/src/generators/visit.rs`
|
||||
// To edit this generated file you have to edit `tasks/ast_tools/src/generators/visit.rs`
|
||||
|
||||
//! Visitor Pattern
|
||||
//!
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// Auto-generated code, DO NOT EDIT DIRECTLY!
|
||||
// To edit this generated file you have to edit `tasks/ast_codegen/src/generators/visit.rs`
|
||||
// To edit this generated file you have to edit `tasks/ast_tools/src/generators/visit.rs`
|
||||
|
||||
//! Visitor Pattern
|
||||
//!
|
||||
|
|
|
|||
2
justfile
2
justfile
|
|
@ -174,5 +174,5 @@ website path:
|
|||
|
||||
# sync ast changes
|
||||
ast:
|
||||
cargo run -p oxc_ast_codegen
|
||||
cargo run -p oxc_ast_tools
|
||||
just check
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
[package]
|
||||
name = "oxc_ast_codegen"
|
||||
name = "oxc_ast_tools"
|
||||
version = "0.0.0"
|
||||
publish = false
|
||||
edition.workspace = true
|
||||
|
|
@ -9,7 +9,7 @@ license.workspace = true
|
|||
workspace = true
|
||||
|
||||
[[bin]]
|
||||
name = "oxc_ast_codegen"
|
||||
name = "oxc_ast_tools"
|
||||
test = false
|
||||
doctest = false
|
||||
|
||||
|
|
@ -17,7 +17,7 @@ use super::{define_pass, Pass};
|
|||
|
||||
/// We use compiler to infer 64bit type layouts.
|
||||
#[cfg(not(target_pointer_width = "64"))]
|
||||
compile_error!("`oxc_ast_codegen::calc_layout` only supports 64 architectures.");
|
||||
compile_error!("This module only supports 64bit architectures.");
|
||||
|
||||
type WellKnown = HashMap<&'static str, PlatformLayout>;
|
||||
|
||||
Loading…
Reference in a new issue