I'm writing an SMIE-based mode for a language that has type definitions that look like this:
type Foo = {
foo : Int,
bar : String
}
One problem I'm running into is that type
and =
are treated as parentheses. For example, if I put the cursor on type
in my previous example, it's highlighted as an unmatched parenthesis:
The =
is also treated as a parenthesis, but, oddly, it is matched with the corresponding type
keyword:
How can I tell SMIE not to treat type
and =
as parentheses?
Here's a pared-down version of the grammar I'm using that exhibits this problem:
(defconst theta-grammar
(smie-prec2->grammar
(smie-bnf->prec2
'((id)
(statement ("type" id "=" type-definition))
(type-definition (type-definition "|" type-definition)
("{" fields "}"))
(fields (fields "," fields)
(id ":" id)))
'((assoc "|"))
'((assoc ","))
'((assoc ":")))))