diff --git a/grammar.js b/grammar.js index 6eccb08..48f284e 100644 --- a/grammar.js +++ b/grammar.js @@ -250,7 +250,7 @@ module.exports = grammar({ ), _type_declaration: $ => seq( - $.type_identifier, + choice($.type_identifier, $.type_identifier_path), optional($.type_parameters), optional(seq( choice('=', '+='), diff --git a/queries/highlights.scm b/queries/highlights.scm index b65fc19..61f61f5 100644 --- a/queries/highlights.scm +++ b/queries/highlights.scm @@ -174,6 +174,7 @@ "->" "|>" ":>" + "+=" (uncurry) ] @operator diff --git a/test/corpus/type_declarations.txt b/test/corpus/type_declarations.txt index e5df8da..82a3b48 100644 --- a/test/corpus/type_declarations.txt +++ b/test/corpus/type_declarations.txt @@ -118,7 +118,7 @@ type t = .. type t += Other -type t += +type M.t += | Point | Line @@ -133,7 +133,7 @@ type t += (variant_declaration (variant_identifier)))) (type_declaration - (type_identifier) + (type_identifier_path (module_identifier) (type_identifier)) (variant_type (variant_declaration (variant_identifier))