remix-project mirror
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
remix-project/libs/remix-astwalker
aniket-engg 6f8608a810 astwalker test fix 4 years ago
..
src add isYulAstNode 4 years ago
tests astwalker test fix 4 years ago
.eslintrc Fix failing linting 4 years ago
.gitignore
.npmignore
README.md
package.json publish remix libs 4 years ago
tsconfig.json
tsconfig.lib.json

README.md

Remix ASTwalker

remix-astwalker module walks through solidity AST and spits out AST nodes.

Example

import { AstWalker } from "remix-astwalker";

const astWalker = new AstWalker();
astWalker.on("node", node => {
  if (node.nodeType === "ContractDefinition") {
    checkContract(st, node);
  }

  if (node.nodeType === "PragmaDirective") {
    checkProgramDirective(st, node);
  }
});

For more examples see tests.