Browse Source

Use 'visitor.on' instead of 'visitor.for'

master
Futago-za Ryuu 5 years ago
parent
commit
72ba85b3af
  1. 2
      lib/ast/visitor.js
  2. 9
      lib/typings/api.d.ts

2
lib/ast/visitor.js

@ -40,7 +40,7 @@ module.exports = {
};
// Helper's to create visitor's for use with the ASTVisitor class
const on = ASTVisitor.for = {
const on = ASTVisitor.on = {
// Visit a node that is defined as a property on another node
property( name ) {

9
lib/typings/api.d.ts

@ -317,7 +317,15 @@ declare namespace peg {
}
interface IOn {
property( name: string ): IVisitor;
children( name: string ): IVisitor;
}
const build: IVisitorBuilder;
const on: IFor;
}
@ -325,6 +333,7 @@ declare namespace peg {
ASTVisitor: visitor.ASTVisitor;
build: visitor.IVisitorBuilder;
on: visitor.IOn;
}

Loading…
Cancel
Save