tree-sitter / tree-sitter-haskell

Haskell grammar for tree-sitter.
MIT License
157 stars 37 forks source link

Include ! from strictness annotations #107

Open Wilfred opened 11 months ago

Wilfred commented 11 months ago

Given the file:

data X = X
  { a :: !Int }

It's parsed as:

haskell (0, 0) - (2, 0)
  adt (0, 0) - (1, 15)
    data (0, 0) - (0, 4) "data"
    type (0, 5) - (0, 6) "X"
    = (0, 7) - (0, 8) "="
    constructors (0, 9) - (1, 15)
      data_constructor_record (0, 9) - (1, 15)
        constructor (0, 9) - (0, 10) "X"
        record_fields (1, 2) - (1, 15)
          { (1, 2) - (1, 3) "{"
          field (1, 4) - (1, 13)
            variable (1, 4) - (1, 5) "a"
            :: (1, 6) - (1, 8) "::"
            strict_type (1, 9) - (1, 13)
              type_name (1, 10) - (1, 13)
                type (1, 10) - (1, 13) "Int"
          } (1, 14) - (1, 15) "}"

Note that the position of the ! from the strict type annotation isn't included. Could it be included?