Commit Graph

9 Commits

Author SHA1 Message Date
overlookmotel bb8bde3e9c refactor(various): update macros to use expr fragment specifier (#11113)
Pure refactor. `expr_2021` fragment specifier was I assume introduced in these macros by a codemod when we updated to Rust 2024 edition. None of these macros are used with input where there's any difference between `expr_2021` and `expr`, so just use `expr`.
2025-05-18 10:26:51 +00:00
Boshen 1d81adac48 Rust Edition 2024 (#9289)
closes #9271

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-02-22 11:56:25 +08:00
Boshen 9f361819b9 refactor(rust): apply cllippy::nursery rules (#9232) 2025-02-20 01:51:04 +00:00
overlookmotel a5bdf322f3 refactor(ast_tools): re-vamp oxc_ast_tools (#8844)
Large refactor of `oxc_ast_tools`. This barely alters the generated code
which `oxc_ast_tools` produces, but it overhauls its internals
significantly.

Notable changes:

* Code and types are much simplified.
* Fully documented.
* `Schema` is the single source of truth for information about the AST.
Generators don't have to deal with the complicated `syn` types.
* `Vec`s, `Option`s, `Box`es, and primitive types have their own entries
in the schema.
* Co-locate logic for custom attributes (e.g. `#[visit]`) with the
generators which use those attributes.
* Helpers for parsing attributes, and other common actions.
* Fix logic for calculating type layouts, correctly calculating niches.
* Generation runs in parallel with `rayon`.

Overall intent is to make maintaining/modifying the existing generators,
and adding new ones, much easier. The complex logic of parsing types etc
is abstracted away into the "framework" of `oxc_ast_tools`, leaving the
generators themselves simpler to write and easier to reason about.
2025-02-03 12:08:40 +08:00
overlookmotel 3858221f45 refactor(global): sort imports (#7883)
Pure refactor. Re-order imports for clarity:

1. `std`
2. External crates
3. `oxc_*` crates
4. Current crate `use crate::...`
5. Super `use super::...`
6. Local modules

This order is from "furthest away" to "closest". This makes it clearer to see what is coming from where.

`cargo +nightly fmt` (#7877) did a lot of the work, but unfortunately `rustfmt` does not have an option to (a) put workspace crates in a separate block from external crates and (b) move `mod` statements to after `use` statements.
2024-12-14 15:07:21 +00:00
overlookmotel 7637aac21f style(ast_tools): reformat macro (#7884)
Fix indentation in macro definition.
2024-12-14 13:51:50 +00:00
Boshen 7fb9d47460 style(rust): cargo +nightly fmt (#7877) 2024-12-14 06:03:31 +00:00
overlookmotel 248ff18ddd refactor(ast_tools): output progress (#7076)
Flush `stdout` after writing progress.
2024-11-01 21:26:45 +00:00
overlookmotel 2b10e5cd52 refactor(ast_tools): move logger into separate module (#6952)
Reduce the amount of code in `main.rs` by moving logger functionality to a separate module.
2024-10-28 00:23:33 +00:00