diff --git a/apps/oxlint/src-js/generated/type_ids.ts b/apps/oxlint/src-js/generated/type_ids.ts index a6eb439dff30f..42c1333fb18cd 100644 --- a/apps/oxlint/src-js/generated/type_ids.ts +++ b/apps/oxlint/src-js/generated/type_ids.ts @@ -1,7 +1,7 @@ // Auto-generated code, DO NOT EDIT DIRECTLY! // To edit this generated file you have to edit `tasks/ast_tools/src/generators/estree_visit.rs`. -// Mapping from node type name to node type ID +/** Mapping from node type name to node type ID */ export const NODE_TYPE_IDS_MAP = new Map([ ["DebuggerStatement", 0], ["EmptyStatement", 1], @@ -170,8 +170,11 @@ export const NODE_TYPE_IDS_MAP = new Map([ ["TSUnionType", 164], ]); +/** Count of all node types (both leaf and non-leaf nodes) */ export const NODE_TYPES_COUNT = 165; +/** Count of leaf node types */ export const LEAF_NODE_TYPES_COUNT = 27; +/** Type IDs which match `:function` selector class */ export const FUNCTION_NODE_TYPE_IDS = [30, 55, 56]; diff --git a/napi/parser/src-js/generated/visit/type_ids.js b/napi/parser/src-js/generated/visit/type_ids.js index e64d398252597..d7e0791ba5004 100644 --- a/napi/parser/src-js/generated/visit/type_ids.js +++ b/napi/parser/src-js/generated/visit/type_ids.js @@ -1,7 +1,7 @@ // Auto-generated code, DO NOT EDIT DIRECTLY! // To edit this generated file you have to edit `tasks/ast_tools/src/generators/estree_visit.rs`. -// Mapping from node type name to node type ID +/** Mapping from node type name to node type ID */ export const NODE_TYPE_IDS_MAP = new Map([ ["DebuggerStatement", 0], ["EmptyStatement", 1], @@ -170,6 +170,8 @@ export const NODE_TYPE_IDS_MAP = new Map([ ["TSUnionType", 164], ]); +/** Count of all node types (both leaf and non-leaf nodes) */ export const NODE_TYPES_COUNT = 165; +/** Count of leaf node types */ export const LEAF_NODE_TYPES_COUNT = 27; diff --git a/tasks/ast_tools/src/generators/estree_visit.rs b/tasks/ast_tools/src/generators/estree_visit.rs index 02203ae23b01e..17cfcdd4ab904 100644 --- a/tasks/ast_tools/src/generators/estree_visit.rs +++ b/tasks/ast_tools/src/generators/estree_visit.rs @@ -222,7 +222,7 @@ fn generate(codegen: &Codegen) -> Codes { #[rustfmt::skip] let mut type_ids_map = string!(" - // Mapping from node type name to node type ID + /** Mapping from node type name to node type ID */ export const NODE_TYPE_IDS_MAP = new Map([ // Leaf nodes "); @@ -416,13 +416,20 @@ fn generate(codegen: &Codegen) -> Codes { function_node_ids.sort_unstable(); #[rustfmt::skip] - write_it!(type_ids_map, "]); + write_it!(type_ids_map, " + ]); + /** Count of all node types (both leaf and non-leaf nodes) */ export const NODE_TYPES_COUNT = {nodes_count}; + + /** Count of leaf node types */ export const LEAF_NODE_TYPES_COUNT = {leaf_nodes_count}; /* IF LINTER */ + + /** Type IDs which match `:function` selector class */ export const FUNCTION_NODE_TYPE_IDS = {function_node_ids:?}; + /* END_IF */ ");