3 ms·
"Tracebacks now highlight in which AST node the error occurs." Can you describe in simple terms how the AST works?
by Takizawamura 5y ago
"Tracebacks now highlight in which AST node the error occurs."
Can you describe in simple terms how the AST works?
- carreau 5y agoAST in a more general concept see https://en.wikipedia.org/wiki/Abstract_syntax_tree https://en.wikipedia.org/wiki/Abstract_syntax_tree, it basically turn your text into a tree where f(a) + f(b) is `call(plus, call(f, a), call(f,b))`. Using https://github.com/alexmojaki/stack_data https://github.com/alexmojaki/stack_data we can say "the error occurred in `a`, while trying to call `f`, while calling `plus`, get the range in the original text and make them yellow.