-
-
Notifications
You must be signed in to change notification settings - Fork 932
Closed
Labels
A-astArea - ASTArea - AST
Description
At present we only have #[visited_node] attrs on types which are visited.
We will also need to add an attribute to all types which are part of AST but are not visited, for:
Currently:
#[visited_node]
enum Expression<'a> { /* ... */ }I propose:
#[ast(visit)]
enum Expression<'a> { /* ... */ }or:
#[ast]
#[visit]
enum Expression<'a> { /* ... */ }Types which are part of AST, but which are not visited would omit the visit part e.g.:
#[ast]
pub enum FunctionType { /* ... */ }Bikeshedding
We could call the attr something other than #[ast]. I considered #[ast_node] but:
- That name will be familiar to some from SWC, and I don't think we should use it because these attrs do something very different - they're no-op markers for codegen, rather than macros generating a huge amount of trait impls and other code.
- Some of these types (e.g.
FunctionType) are not AST nodes per se.
The common factor between all these types is that they're part of the AST, so #[ast] seems descriptive.
But I'm not at all set on that name, if someone has a better suggestion.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-astArea - ASTArea - AST
Type
Fields
Give feedbackPriority
None yet