I think that in order to use this library, I need to do something like:
import { walk, parse, createVisitor } from 'python-ast';
let ast = parse(`
print("hello world!)
`);
let listener = createVisitor(ast);
walk(ast, listener);
but I got this error:
no viable alternative at input '!'
ctx.enterRule(listener);
^
TypeError: Cannot read property 'enterRule' of undefined
This library is quite opaque to me. I've been unable to use antlr4 directly (by installing antlr4 using npm). I'm not sure why I'm getting this error.
I think that in order to use this library, I need to do something like:
but I got this error:
This library is quite opaque to me. I've been unable to use antlr4 directly (by installing antlr4 using npm). I'm not sure why I'm getting this error.