可爱的小python模块位于treesitter库之上,为与源代码交互提供了一个更易于使用和更干净的接口。
fast-trees的Python项目详细描述
速生树
Cute little python module that sits atop the tree-sitter library to provide an easier to use and cleaner interface for interacting with source code
安装
pip install fast-trees
如何使用
使用高级API轻松处理源代码数据。下面是如何获取java方法的参数:
mthd="""public static void main(String[] args, Object clazz) { // This is a test System.out.println(args[0]); /** This is another test! */}"""parser=FastParser("java")print(parser.get_method_parameters(mthd))^{pr2}$
inline_comments=parser.get_method_inline_comments(mthd)forcininline_comments:print(c)
// This is a test
/**
This is another test!
*/
支持的语言
- [x] 爪哇
托多
- [x] 增加抓取方法参数的能力
- []添加解析方法与类之间的分隔
- []添加获取类中所有方法的能力
- []添加获取类中所有实例变量的功能
- []添加更多语言
- 项目
标签: