tree-sitter / tree-sitter-scala

Scala grammar for tree-sitter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Semicolon in `$.if_expression`

susliko opened this issue · comments

Commit of tree-sitter-scala you tested this on

d42d40c

A code sample showing the error

if (a) b;
else c.d

Show the error node

(compilation_unit [0, 0] - [2, 0]
  (if_expression [0, 0] - [0, 8]
    condition: (parenthesized_expression [0, 3] - [0, 6]
      (identifier [0, 4] - [0, 5]))
    consequence: (identifier [0, 7] - [0, 8]))
  (field_expression [1, 0] - [1, 8]
    value: (identifier [1, 0] - [1, 4])
    (ERROR [1, 5] - [1, 6])
    field: (identifier [1, 7] - [1, 8])))

What do you expect the tree to look like

(compilation_unit [0, 0] - [2, 0]
  (if_expression [0, 0] - [1, 8]
    condition: (parenthesized_expression [0, 3] - [0, 6]
      (identifier [0, 4] - [0, 5]))
    consequence: (identifier [0, 7] - [0, 8])
    alternative: (field_expression [1, 5] - [1, 8]
      value: (identifier [1, 5] - [1, 6])
      field: (identifier [1, 7] - [1, 8]))))

Where are you experiencing this error?

Plugins.scala