![]() Consider this "hello-world" level task: matching console.log in JavaScript using Babel. However, developing with AST is tedious and frustrating. We usually prefer to parse the code into abstract syntax tree for precise matches. Using text-based tool for searching code is fast but imprecise. Thanks to tree-sitter, a popular parser generator library, ast-grep manages to support many languages out of the box! Motivation Here is a list of notable programming languages it supports. Supported Languages Īst-grep supports a wide range of programming languages. Think ast-grep as an hybrid of grep, eslint and codemod. Besides, you can also use operators to compose complex matching from simple patterns. Rewrite: ast-grep provide jQuery like utility methods to traverse and manipulate syntax tree.It also has a pretty error reporting out of box ![]() Thanks to the flexible rule configuration, adding a new customized rule is more intuitive and straightforward.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |