4 ms·
Author here. I am guessing you mean display the parse trees for python snippets? It wouldn't be too difficult to do in backend code, using something like https
by loadzero 9y ago
Author here. I am guessing you mean display the parse trees for python snippets?
It wouldn't be too difficult to do in backend code, using something like https://docs.python.org/2/library/ast.html https://docs.python.org/2/library/ast.html.
It might be tricky to get it to work completely in the frontend, like the demos in this article.
- w_t_payne 9y agoYeah ... I've turned the parse tree output from Baron (https://github.com/PyCQA/baron https://github.com/PyCQA/baron) into HTML -- using span elements to represent the subtrees in the Baron AST. It was quite trivial (less than 200 lines including comments). I am now trying to see how I can add different representations to the rendered html output. I would like to show the abstract syntax tree, the data dependency graph, the control flow graph; the output of git blame; perhaps deltas over time; test coverage and various bits of requirements and test results traceability information alongside the code somehow. Lots of stuff. :-)
- w_t_payne 9y agoAll in the back-end --- I just want it as standalone single-file HTML w/ no server infrastructure required.