tree-sitter / tree-sitter-ruby

Ruby grammar for tree-sitter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Complex and rational literals are parsed wrongly

aibaars opened this issue · comments

Complex number literals can be any number (integer, float or rational) followed by an i. The grammar currently only allows complex integers.

In addition complex and rational literals are a single token, things like 3 r or 4 i should be rejected.

See also https://ruby-doc.org/core-3.0.0/doc/syntax/literals_rdoc.html