tree-sitter / tree-sitter-scala

Scala grammar for tree-sitter
MIT License
158 stars 55 forks source link

Fuzz test failing with "repetition quantifier expects a valid decimal" #382

Closed eed3si9n closed 7 months ago

eed3si9n commented 7 months ago

Commit of tree-sitter-scala you tested this on

e02f003d78dc269fef287b9b7b9963dc1f26bd7e

A code sample showing the error

n/a

Show the error node

https://github.com/tree-sitter/tree-sitter-scala/actions/runs/8224970088/job/22489610251

Caused by:
    regex parse error:
        u{[0-9a-fA-F]+}
          ^
    error: repetition quantifier expects a valid decimal

What do you expect the tree to look like

No errors

Where are you experiencing this error?

No response

eed3si9n commented 7 months ago

There's an invalid regex in our character_literal parser, which we copied from tree-sitter-rust per the comment in https://github.com/tree-sitter/tree-sitter-scala/pull/22#discussion_r598983209, and tree-sitter-rust has also fixed it recently. The problem is that Scala doesn't really support curly brace, so I think the parser itself is invalid.