diff --git a/grammar.js b/grammar.js index 8bf186e..3d2e08b 100644 --- a/grammar.js +++ b/grammar.js @@ -254,6 +254,7 @@ module.exports = grammar({ choice('=', '+='), optional('private'), $._type, + optional(seq('=', $._type)), repeat(alias($._type_declaration_and, $.type_declaration)), )), ), diff --git a/test/corpus/type_declarations.txt b/test/corpus/type_declarations.txt index e9d5244..e5df8da 100644 --- a/test/corpus/type_declarations.txt +++ b/test/corpus/type_declarations.txt @@ -79,6 +79,8 @@ type t = { opt?: string } +type t = Mod.t = {a: int} + --- (source_file @@ -98,7 +100,15 @@ type t = { (record_type_field (property_identifier) (type_annotation (type_identifier))) (record_type_field - (property_identifier) (type_annotation (type_identifier)))))) + (property_identifier) (type_annotation (type_identifier))))) + (type_declaration + (type_identifier) + (type_identifier_path + (module_identifier) (type_identifier)) + (record_type + (record_type_field + (property_identifier) + (type_annotation (type_identifier)))))) =========================================== Extensible Variant