-
-
Notifications
You must be signed in to change notification settings - Fork 503
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ast_tools): generate mapping of trait name to crate in `oxc_ast_…
…macros`
- Loading branch information
1 parent
344d6e1
commit 2f55d91
Showing
11 changed files
with
103 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Auto-generated code, DO NOT EDIT DIRECTLY! | ||
// To edit this generated file you have to edit `tasks/ast_tools/src/main.rs` | ||
|
||
use proc_macro2::TokenStream; | ||
use quote::quote; | ||
|
||
pub fn get_trait_crate_and_generics(trait_name: &str) -> (TokenStream, TokenStream) { | ||
match trait_name { | ||
"CloneIn" => (quote!(::oxc_allocator::CloneIn), quote!(< 'static >)), | ||
"GetAddress" => (quote!(::oxc_allocator::GetAddress), TokenStream::new()), | ||
"GetSpan" => (quote!(::oxc_span::GetSpan), TokenStream::new()), | ||
"GetSpanMut" => (quote!(::oxc_span::GetSpanMut), TokenStream::new()), | ||
"ContentEq" => (quote!(::oxc_span::ContentEq), TokenStream::new()), | ||
"ESTree" => (quote!(::oxc_estree::ESTree), TokenStream::new()), | ||
_ => panic!("Invalid derive trait(generate_derive): {trait_name}"), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters