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 98e2e78e56 bump versions after publish 4 years ago
..
src moved libs into libs dir 4 years ago
tests moved libs into libs dir 4 years ago
.eslintrc remix-astwalker linting done 4 years ago
.gitignore moved libs into libs dir 4 years ago
.npmignore moved libs into libs dir 4 years ago
README.md moved libs into libs dir 4 years ago
package.json bump versions after publish 4 years ago
tsconfig.json Merge branch 'master' of https://github.com/ethereum/remix-project 4 years ago
tsconfig.lib.json updates for analyzer 4 years ago

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.