rescript-lang / tree-sitter-rescript

ReScript parser for Tree-Sitter
MIT License
50 stars 15 forks source link

Error: Variant with prefix `?` #215

Closed aspeddro closed 1 year ago

aspeddro commented 1 year ago
let nameWasSet = switch me {
| {name: ?None} => false
| {name: ?Some(_)} => true
}
(source_file [0, 0] - [4, 0]
  (let_declaration [0, 0] - [3, 1]
    (let_binding [0, 4] - [3, 1]
      pattern: (value_identifier [0, 4] - [0, 14])
      body: (switch_expression [0, 17] - [3, 1]
        (value_identifier [0, 24] - [0, 26])
        (switch_match [1, 0] - [1, 24]
          pattern: (record_pattern [1, 2] - [1, 15]
            (value_identifier [1, 3] - [1, 7])
            (ERROR [1, 9] - [1, 10])
            (variant_pattern [1, 10] - [1, 14]
              (variant_identifier [1, 10] - [1, 14])))
          body: (sequence_expression [1, 19] - [1, 24]
            (expression_statement [1, 19] - [1, 24]
              (false [1, 19] - [1, 24]))))
        (switch_match [2, 0] - [2, 26]
          pattern: (record_pattern [2, 2] - [2, 18]
            (value_identifier [2, 3] - [2, 7])
            (ERROR [2, 9] - [2, 10])
            (variant_pattern [2, 10] - [2, 17]
              (variant_identifier [2, 10] - [2, 14])
              (formal_parameters [2, 14] - [2, 17]
                (value_identifier [2, 15] - [2, 16]))))
          body: (sequence_expression [2, 22] - [2, 26]
            (expression_statement [2, 22] - [2, 26]
              (true [2, 22] - [2, 26]))))))))

Playground Example