semgrep / pfff

pfff is mainly an OCaml API to write static analysis, dynamic analysis, code visualizations, code navigations, or style-preserving source-to-source transformations such as refactorings on source code.
https://semgrep.dev
Other
186 stars 29 forks source link

Scala: parse nested comments. #493

Closed mmcqd closed 2 years ago

mmcqd commented 2 years ago

See title. Associated semgrep PR: https://github.com/returntocorp/semgrep/pull/4231 Not entirely clear to me why the original multi-line comment rule looked like it did, but this change doesn't introduce any regressions. Let me know if there's some special case that is now missing.

Security

linear[bot] commented 2 years ago
PA-670 Parse nested comments

Scala supports arbitrarily nested comments, like ``` /* A /* B */ C */ ```

aryx commented 2 years ago

BTW a little challenge for you! We have the same problem with kotlin. Kotlin support nested comments but tree-sitter-kotlin grammar does not support it! We could use your helper there too :)