Open gkapfham opened 1 year ago
S Expressions: https://en.wikipedia.org/wiki/S-expression Tree-Sitter querying syntax: https://tree-sitter.github.io/tree-sitter/using-parsers#query-syntax Tips for using Tree-Sitter queries: https://www.bearer.com/blog/tips-for-using-tree-sitter-queries
@Jaclynpqc have you started working on this?
@simojo Yes, I'm mostly testing and learning how to use Treesitter at the moment. This is not an urgent feature, more like a nice-to-have, plus it involves changing our code, so I don't think we could incorporate and finish it by the end of the semester. Feel free to experiment with this issue if you like! And thanks for the resources
update: I've figured out how to run it to parse Python code However, due to time limitation and more urgent issues, this issue is on hold and I'm focusing on other issues needed to get done
Right now the
chasten
tool uses XPath expressions to query an XML-based representation of a Python program. However, this means thatchasten
can only work correctly for Python programs!It would be awesome if
chasten
could parse source code from any Treesitter-supported language (there are many!) and then use Treesitter S-expressions to run queries for source code patterns.The complete implementation of this feature would likely require a significant amount of re-implementation of core functionality. However, this feature would be a game changer for
chasten
because the tool would then support static analysis of programs implemented in many different programming languages!