You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on adding Swift support to Semgrep (semgrep/semgrep#2232) using this grammar. Thanks for all the hard work you've put into it so far!
One issue I'm running into is that the CST that ocaml-tree-sitter-semgrep generates from the grammar includes anonymous nodes for shared grammar fragments. This isn't a problem initially, but it can lead to maintainability issues as inconsequential changes will perturb the generated names.
The solution is simple: just pull out shared grammar fragments into top-level rules with names. I'm happy to do the work here and put up pull requests, assuming you are amenable to these changes.
The text was updated successfully, but these errors were encountered:
There are a few places where there are similar-but-not-exactly-the-same choices represented inline because of subtle differences between what’s legal in local scope vs class scope vs global scope. You’ll want to watch out for those since they impact correctness (where private isn’t legal as a modifier it becomes legal as an identifier, although that’s a bad example because it is a named rule). I think that CI would catch any regressions there, but I just mention it as something to watch out for.
I'm working on adding Swift support to Semgrep (semgrep/semgrep#2232) using this grammar. Thanks for all the hard work you've put into it so far!
One issue I'm running into is that the CST that ocaml-tree-sitter-semgrep generates from the grammar includes anonymous nodes for shared grammar fragments. This isn't a problem initially, but it can lead to maintainability issues as inconsequential changes will perturb the generated names.
For example, this choice call, which is duplicated a few lines below, leads to this generated CST node. In total there are 17 such cases.
The solution is simple: just pull out shared grammar fragments into top-level rules with names. I'm happy to do the work here and put up pull requests, assuming you are amenable to these changes.
The text was updated successfully, but these errors were encountered: