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
ioedeveloper e959c61bb7 Exit if killProcess flag is set to true 2 years ago
..
src # This is a combination of 50 commits. 2 years ago
tests # This is a combination of 50 commits. 2 years ago
.eslintrc # This is a combination of 50 commits. 2 years ago
.gitignore moved libs into libs dir 4 years ago
.npmignore moved libs into libs dir 4 years ago
README.md use yarn 3 years ago
package.json Exit if killProcess flag is set to true 2 years ago
project.json update project.json 2 years ago
tsconfig.json fix libs linting 3 years ago
tsconfig.lib.json fix libs linting 3 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:

yarn add @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