$ cnpm install @remix-project/remix-astwalker
remix-astwalker
module walks through solidity AST and spits out AST nodes.
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
.
Copyright 2014 - 2017 © taobao.org |