uber / piranha

A tool for refactoring code related to feature flag APIs
Apache License 2.0
2.29k stars 198 forks source link

[WIP] Proper grammar for concrete syntax #641

Closed danieltrt closed 1 month ago

danieltrt commented 11 months ago

I hacked a grammar for concrete syntax from uber/tree-sitter-strings because:

  1. Existing implementation of concrete syntax is hacked using string comparisons
  2. Concrete syntax is limited in expressiveness compared to tree sitter query syntax because of 1.

The goal is to make concrete syntax more powerful. The version here supports:

:[x] and [x: node-type], which addresses the problem of being unable to use node types to further constraint the template variable types.

I was also thinking of addding a where syntax for basic operations like equality, and !=. Eventually it could be integrated with LSP for more powerful where queries