Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion apps/oxlint/src-js/generated/type_ids.ts
Original file line number Diff line number Diff line change
@@ -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],
Expand Down Expand Up @@ -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];
4 changes: 3 additions & 1 deletion napi/parser/src-js/generated/visit/type_ids.js
Original file line number Diff line number Diff line change
@@ -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],
Expand Down Expand Up @@ -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;
11 changes: 9 additions & 2 deletions tasks/ast_tools/src/generators/estree_visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
");
Expand Down Expand Up @@ -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 */
");

Expand Down
Loading