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 1b713c43a5 bump libs version 3 years ago
..
src linting for astwalker done 4 years ago
tests astwalker test fix 4 years ago
.eslintrc linting for astwalker done 4 years ago
.gitignore moved libs into libs dir 4 years ago
.npmignore moved libs into libs dir 4 years ago
README.md astwalker readme 4 years ago
package.json bump libs version 3 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

npm version npm npm GitHub contributions welcome

@remix-project/remix-astwalker is a tool to parse AST (Abstract Syntax Tree) generated by Solidity compiler to perform certain operations. It is used in remix-analyzer, remix-debug and in contextualListener plugin of Remix IDE.

Installation

@remix-project/remix-astwalker is an NPM package and can be installed using NPM as:

npm install @remix-project/remix-astwalker

How to use

@remix-project/remix-astwalker can be used as:

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);
  }
});

Contribute

Please feel free to open an issue or a pull request.

In case you want to add some code, do have a look to our contribution guidelnes here. Reach us on Gitter in case of any queries.

License

MIT © 2018-21 Remix Team