File tree Expand file tree Collapse file tree 4 files changed +15
-15
lines changed
napi/parser/src-js/generated/visit
tasks/ast_tools/src/generators Expand file tree Collapse file tree 4 files changed +15
-15
lines changed Original file line number Diff line number Diff line change 22// To edit this generated file you have to edit `tasks/ast_tools/src/generators/estree_visit.rs`.
33
44import type { Node , Program } from "./types.d.ts" ;
5+ import type { VisitFn , EnterExit } from "../plugins/visitor.ts" ;
56
6- type VisitFn = ( ( node : Node ) => void ) | null ;
7- type EnterExitVisitor = { enter : VisitFn ; exit : VisitFn } | null ;
8- type CompiledVisitors = ( VisitFn | EnterExitVisitor ) [ ] ;
7+ type CompiledVisitors = ( VisitFn | EnterExit | null ) [ ] ;
98
109export declare function walkProgram ( program : Program , visitors : CompiledVisitors ) : void ;
1110export declare const ancestors : Node [ ] ;
Original file line number Diff line number Diff line change @@ -17,9 +17,8 @@ import {
1717import { ancestors } from "../generated/walk.js" ;
1818import { debugAssert , debugAssertIsFunction } from "../utils/asserts.ts" ;
1919
20- import type { CfgVisitFn , EnterExit } from "./visitor.ts" ;
20+ import type { CfgVisitFn , EnterExit , VisitFn } from "./visitor.ts" ;
2121import type { Node , Program } from "../generated/types.d.ts" ;
22- import type { CompiledVisitors } from "../generated/walk.js" ;
2322
2423/**
2524 * Offset added to type IDs for exit visits to distinguish them from enter visits.
@@ -89,7 +88,10 @@ export function resetCfgWalk(): void {
8988 * @param ast - AST
9089 * @param visitors - Visitors array
9190 */
92- export function walkProgramWithCfg ( ast : Program , visitors : CompiledVisitors ) : void {
91+ export function walkProgramWithCfg (
92+ ast : Program ,
93+ visitors : ( VisitFn | EnterExit | CfgVisitFn | null ) [ ] ,
94+ ) : void {
9395 // Get the steps that need to be run to walk the AST
9496 prepareSteps ( ast ) ;
9597
Original file line number Diff line number Diff line change 33
44import type * as ESTree from "@oxc-project/types" ;
55
6- type VisitFn = ( ( node : ESTree . Node ) => void ) | null ;
7- type EnterExitVisitor = { enter : VisitFn ; exit : VisitFn } | null ;
8- type CompiledVisitors = ( VisitFn | EnterExitVisitor ) [ ] ;
6+ type VisitFn = ( node : ESTree . Node ) => void ;
7+ type EnterExit = { enter : VisitFn ; exit : VisitFn } ;
8+ type CompiledVisitors = ( VisitFn | EnterExit | null ) [ ] ;
99
1010export declare function walkProgram ( program : ESTree . Program , visitors : CompiledVisitors ) : void ;
Original file line number Diff line number Diff line change @@ -535,9 +535,9 @@ fn generate(codegen: &Codegen) -> Codes {
535535 let walk_dts_parser = "
536536 import type * as ESTree from '@oxc-project/types';
537537
538- type VisitFn = (( node: ESTree.Node) => void) | null ;
539- type EnterExitVisitor = { enter: VisitFn; exit: VisitFn } | null ;
540- type CompiledVisitors = (VisitFn | EnterExitVisitor )[];
538+ type VisitFn = (node: ESTree.Node) => void;
539+ type EnterExit = { enter: VisitFn; exit: VisitFn };
540+ type CompiledVisitors = (VisitFn | EnterExit | null )[];
541541
542542 export declare function walkProgram(program: ESTree.Program, visitors: CompiledVisitors): void;
543543 " . to_string ( ) ;
@@ -550,10 +550,9 @@ fn generate(codegen: &Codegen) -> Codes {
550550 #[ rustfmt:: skip]
551551 let walk_dts_oxlint = "
552552 import type { Node, Program } from './types.d.ts';
553+ import type { VisitFn, EnterExit } from '../plugins/visitor.ts';
553554
554- type VisitFn = ((node: Node) => void) | null;
555- type EnterExitVisitor = { enter: VisitFn; exit: VisitFn } | null;
556- type CompiledVisitors = (VisitFn | EnterExitVisitor)[];
555+ type CompiledVisitors = (VisitFn | EnterExit | null)[];
557556
558557 export declare function walkProgram(program: Program, visitors: CompiledVisitors): void;
559558 export declare const ancestors: Node[];
You can’t perform that action at this time.
0 commit comments