diff --git a/grammar.js b/grammar.js index 523b154..61dbcdd 100644 --- a/grammar.js +++ b/grammar.js @@ -153,7 +153,10 @@ module.exports = grammar({ include_statement: $ => seq( 'include', - choice($.module_expression, seq('(', $.module_expression, ')')), + choice( + $.module_expression, + seq('(', choice($.module_expression, $.functor_parameter), ')') + ), ), declaration: $ => choice( @@ -202,7 +205,7 @@ module.exports = grammar({ ), functor_parameter: $ => seq( - $.module_identifier, + $.module_identifier_path, $.module_type_annotation, ), @@ -210,6 +213,7 @@ module.exports = grammar({ ':', choice( $.module_expression, + seq('(', $.module_expression, ')'), $.block, ) ), @@ -291,18 +295,8 @@ module.exports = grammar({ $.object_type, $.generic_type, $.unit_type, + $.module_pack, $.unit, - $.module_pack_type, - ), - - module_pack_type: $ => seq( - 'module', - '(', - choice($.module_identifier, $._type_identifier), - optional( - seq('with', sep1('and', seq('type', $._type_identifier, '=', $._type_identifier))) - ), - ')' ), tuple_type: $ => prec.dynamic(-1, seq( @@ -509,7 +503,7 @@ module.exports = grammar({ $.pipe_expression, $.subscript_expression, $.member_expression, - $.module_pack_expression, + $.module_pack, $.extension_expression, ), @@ -522,7 +516,8 @@ module.exports = grammar({ ), value_identifier_path: $ => seq( - repeat1(seq($.module_identifier, '.')), + $.module_identifier_path, + '.', $.value_identifier, ), @@ -736,11 +731,11 @@ module.exports = grammar({ ), )), - module_pack_expression: $ => seq( + module_pack: $ => seq( 'module', '(', - choice($.module_expression, $.block), - optional(seq(':', $.module_expression)), + $._module_definition, + optional($.module_type_annotation), ')' ), @@ -831,7 +826,8 @@ module.exports = grammar({ $._destructuring_pattern, $.polyvar_type_pattern, $.unit, - $._parenthesized_pattern + $.module_pack, + $._parenthesized_pattern, )), optional($.type_annotation), optional($.as_aliasing), @@ -1214,7 +1210,8 @@ module.exports = grammar({ )), nested_variant_identifier: $ => seq( - repeat1(seq($.module_identifier, '.')), + $.module_identifier_path, + '.', $.variant_identifier ), @@ -1240,54 +1237,65 @@ module.exports = grammar({ ), type_identifier_path: $ => seq( - repeat1(seq($.module_identifier, '.')), + $.module_identifier_path, + '.', $.type_identifier ), module_expression: $ => choice( - $.module_identifier, $.module_identifier_path, + $.type_identifier_path, $.module_type_of, $.functor_use, $.module_type_constraint, $.module_unpack, ), - module_identifier_path: $ => prec.left(seq( - $.module_expression, - '.', + module_identifier_path: $ => path( + $.module_identifier_path, $.module_identifier, - )), + ), - module_type_of: $ => prec.dynamic(-1, seq( + module_type_of: $ => prec.left(seq( 'module', 'type', 'of', - choice($.module_expression, $.block), + choice($.module_expression, $.block) )), - module_type_constraint: $ => seq( - '(', - choice($.module_identifier, $.module_identifier_path), - ':', - $.module_type_of, + _module_type_constraint: $ => seq( 'with', - sep1('and', - seq( - 'module', - $.module_expression, - choice('=', ':='), - $.module_expression - ) + sep1(choice('and', 'with'), + choice($.constrain_module, $.constrain_type) ), - ')' + ), + + module_type_constraint: $ => prec.left(choice( + seq($.module_identifier_path, $._module_type_constraint), + seq( + '(', + $.module_identifier_path, $._module_type_constraint, + ')', + $._module_type_constraint + ) + )), + + constrain_module: $ => seq( + 'module', + $.module_identifier_path, + choice('=', ':='), + $.module_identifier_path, + ), + + constrain_type: $ => seq( + 'type', + $._type, + choice('=', ':='), + $._type, ), functor_use: $ => seq( - choice( - $.module_identifier, - $.module_identifier_path, - ), + $.module_identifier_path, alias($.functor_arguments, $.arguments), ), @@ -1486,3 +1494,7 @@ function commaSept(rule) { function sep1(delimiter, rule) { return seq(rule, repeat(seq(delimiter, rule))) } + +function path(prefix, final) { + return choice(final, seq(prefix, '.', final)) +} diff --git a/test/corpus/decorators.txt b/test/corpus/decorators.txt index 3649de1..c2abe98 100644 --- a/test/corpus/decorators.txt +++ b/test/corpus/decorators.txt @@ -42,7 +42,9 @@ let onResult = () => @doesNotRaise Belt.Array.getExn([], 0) (parenthesized_expression (decorator (decorator_identifier)) (value_identifier_path - (module_identifier) (value_identifier))) + (module_identifier_path + (module_identifier)) + (value_identifier))) (arguments (number) (character)))) @@ -51,7 +53,10 @@ let onResult = () => @doesNotRaise Belt.Array.getExn([], 0) (value_identifier) (decorator (decorator_identifier)) (call_expression - (value_identifier_path (module_identifier) (value_identifier)) + (value_identifier_path + (module_identifier_path + (module_identifier)) + (value_identifier)) (arguments (number) (character)))) @@ -62,7 +67,12 @@ let onResult = () => @doesNotRaise Belt.Array.getExn([], 0) (formal_parameters) (decorator (decorator_identifier)) (call_expression - (value_identifier_path (module_identifier) (module_identifier) (value_identifier)) + (value_identifier_path + (module_identifier_path + (module_identifier_path + (module_identifier)) + (module_identifier)) + (value_identifier)) (arguments (array) (number)))))) diff --git a/test/corpus/expressions.txt b/test/corpus/expressions.txt index 2db8bb0..bea34c3 100644 --- a/test/corpus/expressions.txt +++ b/test/corpus/expressions.txt @@ -41,14 +41,20 @@ Foo.Bar.baz.qux (source_file (expression_statement (value_identifier_path - (module_identifier) - (module_identifier) (value_identifier))) + (module_identifier_path + (module_identifier_path + (module_identifier)) + (module_identifier)) + (value_identifier))) (expression_statement (member_expression (value_identifier_path - (module_identifier) - (module_identifier) (value_identifier)) - (property_identifier)))) + (module_identifier_path + (module_identifier_path + (module_identifier)) + (module_identifier)) + (value_identifier)) + (property_identifier)))) =========================================== Escape identifiers @@ -149,7 +155,8 @@ f(raise) left: (pipe_expression (value_identifier) (value_identifier_path - (module_identifier) + (module_identifier_path + (module_identifier)) (value_identifier))) right: (number)))))) (expression_statement @@ -158,7 +165,7 @@ f(raise) arguments: (arguments (number) (block - (open_statement (module_identifier)) + (open_statement (module_identifier_path (module_identifier))) (expression_statement (value_identifier))) (labeled_argument label: (value_identifier) @@ -208,9 +215,15 @@ foo->{ (call_expression (pipe_expression (value_identifier) - (value_identifier_path (module_identifier) (value_identifier))) + (value_identifier_path + (module_identifier_path + (module_identifier)) + (value_identifier))) (arguments (value_identifier))) - (value_identifier_path (module_identifier) (value_identifier)))) + (value_identifier_path + (module_identifier_path + (module_identifier)) + (value_identifier)))) (expression_statement (pipe_expression (number) @@ -234,7 +247,7 @@ foo->{ (pipe_expression (value_identifier) (block - (open_statement (module_identifier)) + (open_statement (module_identifier_path (module_identifier))) (expression_statement (value_identifier)))))) =========================================== @@ -274,12 +287,18 @@ Record (expression_statement (record (record_field - (property_identifier (module_identifier) (value_identifier)) + (property_identifier + (module_identifier_path + (module_identifier)) + (value_identifier)) (number)))) (expression_statement (record (record_field - (property_identifier (module_identifier) (value_identifier)) + (property_identifier + (module_identifier_path + (module_identifier)) + (value_identifier)) (number)) (record_field (property_identifier) @@ -437,7 +456,8 @@ switch foo { (switch_match (variant_pattern (nested_variant_identifier - (module_identifier) + (module_identifier_path + (module_identifier)) (variant_identifier))) (expression_statement (number)))))) @@ -473,7 +493,8 @@ switch foo { (switch_match (polyvar_type_pattern (type_identifier_path - (module_identifier) + (module_identifier_path + (module_identifier)) (type_identifier))) (as_aliasing (value_identifier)) (expression_statement (number)))))) @@ -728,7 +749,8 @@ switch (element->HtmlInputElement.ofElement) { (pipe_expression (value_identifier) (value_identifier_path - (module_identifier) + (module_identifier_path + (module_identifier)) (value_identifier)))) (switch_match (variant_pattern @@ -738,14 +760,16 @@ switch (element->HtmlInputElement.ofElement) { (expression_statement (call_expression function: (value_identifier_path - (module_identifier) + (module_identifier_path + (module_identifier)) (value_identifier)) arguments: (arguments (value_identifier)))) (expression_statement (call_expression function: (value_identifier_path - (module_identifier) + (module_identifier_path + (module_identifier)) (value_identifier)) arguments: (arguments (value_identifier))))) @@ -774,7 +798,12 @@ switch parseExn(str) { (switch_match (exception (variant_pattern - (nested_variant_identifier (module_identifier) (module_identifier) (variant_identifier)) + (nested_variant_identifier + (module_identifier_path + (module_identifier_path + (module_identifier)) + (module_identifier)) + (variant_identifier)) (formal_parameters (value_identifier)))) (expression_statement (number)))))) @@ -792,7 +821,7 @@ switch { open Mod; foo() } { (expression_statement (switch_expression (block - (open_statement (module_identifier)) + (open_statement (module_identifier_path (module_identifier))) (expression_statement (call_expression (value_identifier) (arguments)))) (switch_match @@ -1055,7 +1084,10 @@ Foo((Obj.magic(v): string)) (arguments (parenthesized_expression (call_expression - (value_identifier_path (module_identifier) (value_identifier)) + (value_identifier_path + (module_identifier_path + (module_identifier)) + (value_identifier)) (arguments (value_identifier))) (type_annotation (type_identifier))))))) @@ -1246,7 +1278,12 @@ try switch foo() { (expression_statement (number))) (switch_match (variant_pattern - (nested_variant_identifier (module_identifier) (module_identifier) (variant_identifier)) + (nested_variant_identifier + (module_identifier_path + (module_identifier_path + (module_identifier)) + (module_identifier)) + (variant_identifier)) (formal_parameters (value_identifier))) (expression_statement (number))))) (expression_statement @@ -1258,7 +1295,12 @@ try switch foo() { (switch_match (value_identifier) (expression_statement (string (string_fragment))))) (switch_match (variant_pattern - (nested_variant_identifier (module_identifier) (module_identifier) (variant_identifier)) + (nested_variant_identifier + (module_identifier_path + (module_identifier_path + (module_identifier)) + (module_identifier)) + (variant_identifier)) (formal_parameters (value_identifier))) (expression_statement (string (string_fragment))))))) @@ -1309,7 +1351,9 @@ for x in 1 downto 3 { (block (expression_statement (call_expression - (value_identifier_path (module_identifier) (value_identifier)) + (value_identifier_path + (module_identifier_path (module_identifier)) + (value_identifier)) (arguments (value_identifier))))))) (expression_statement (for_expression @@ -1319,7 +1363,9 @@ for x in 1 downto 3 { (block (expression_statement (call_expression - (value_identifier_path (module_identifier) (value_identifier)) + (value_identifier_path + (module_identifier_path (module_identifier)) + (value_identifier)) (arguments (value_identifier)))))))) =========================================== @@ -1339,7 +1385,10 @@ while true { (block (expression_statement (call_expression - (value_identifier_path (module_identifier) (value_identifier)) + (value_identifier_path + (module_identifier_path + (module_identifier)) + (value_identifier)) (arguments (string (string_fragment))))))))) =========================================== @@ -1385,6 +1434,6 @@ let f = ({name, _} as foo: T.t) => {} (value_identifier) (type_annotation (type_identifier_path - (module_identifier) + (module_identifier_path (module_identifier)) (type_identifier)))))) body: (block)))) diff --git a/test/corpus/functions.txt b/test/corpus/functions.txt index e0fb1be..2385d8d 100644 --- a/test/corpus/functions.txt +++ b/test/corpus/functions.txt @@ -210,7 +210,7 @@ Operator precendence (binary_expression (pipe_expression (value_identifier) - (value_identifier_path (module_identifier) (value_identifier))) + (value_identifier_path (module_identifier_path (module_identifier)) (value_identifier))) (number))))) =================================================== diff --git a/test/corpus/jsx.txt b/test/corpus/jsx.txt index cd56e1c..a1be478 100644 --- a/test/corpus/jsx.txt +++ b/test/corpus/jsx.txt @@ -43,7 +43,7 @@ Simple JSX elements (expression_statement (jsx_element (jsx_opening_element (jsx_identifier)) - (value_identifier_path (module_identifier) (value_identifier)) + (value_identifier_path (module_identifier_path (module_identifier)) (value_identifier)) (jsx_closing_element (jsx_identifier)))) (expression_statement @@ -148,7 +148,10 @@ Block children (block (expression_statement (call_expression - (value_identifier_path (module_identifier) (value_identifier)) + (value_identifier_path + (module_identifier_path + (module_identifier)) + (value_identifier)) (arguments (string (string_fragment)))))) (jsx_closing_element (jsx_identifier))))) (jsx_closing_element (jsx_identifier))))) @@ -197,7 +200,8 @@ Attribute Block (expression_statement (call_expression (value_identifier_path - (module_identifier) + (module_identifier_path + (module_identifier)) (value_identifier)) (arguments (string @@ -206,7 +210,7 @@ Attribute Block (property_identifier) (jsx_expression (open_statement - (module_identifier)) + (module_identifier_path (module_identifier))) (expression_statement (record (record_field diff --git a/test/corpus/let_bindings.txt b/test/corpus/let_bindings.txt index 856b179..10355ec 100644 --- a/test/corpus/let_bindings.txt +++ b/test/corpus/let_bindings.txt @@ -73,8 +73,10 @@ let {Bar.Bar.bar: bar} = foo (let_binding (record_pattern (value_identifier_path - (module_identifier) - (module_identifier) + (module_identifier_path + (module_identifier_path + (module_identifier)) + (module_identifier)) (value_identifier)) (value_identifier)) (value_identifier))) @@ -294,15 +296,17 @@ let {baz, _} = module(User.Inner) (record_pattern (value_identifier) (value_identifier)) - (module_pack_expression (module_identifier))) - + (module_pack + (module_identifier_path + (module_identifier)))) (let_binding (record_pattern (value_identifier) (value_identifier)) - (module_pack_expression + (module_pack (module_identifier_path - (module_identifier) + (module_identifier_path + (module_identifier)) (module_identifier))))) =========================================== @@ -316,7 +320,7 @@ let foo = module(Bar) (source_file (let_binding (value_identifier) - (module_pack_expression (module_identifier)))) + (module_pack (module_identifier_path (module_identifier))))) =========================================== Unpacking module diff --git a/test/corpus/modules.txt b/test/corpus/modules.txt index dbd200d..f7d0d34 100644 --- a/test/corpus/modules.txt +++ b/test/corpus/modules.txt @@ -8,9 +8,13 @@ open! Foo.Bar --- (source_file - (open_statement (module_identifier)) (open_statement - (module_identifier_path (module_identifier) (module_identifier)))) + (module_identifier_path (module_identifier))) + (open_statement + (module_identifier_path + (module_identifier_path + (module_identifier)) + (module_identifier)))) =========================================== Include @@ -34,42 +38,69 @@ include module type of { --- (source_file - (include_statement (module_identifier)) (include_statement - (module_identifier_path (module_identifier) (module_identifier))) + (module_identifier_path + (module_identifier))) + (include_statement + (module_identifier_path + (module_identifier_path + (module_identifier)) + (module_identifier))) (include_statement (functor_use - (module_identifier_path (module_identifier) (module_identifier)) - (arguments (module_identifier)))) + (module_identifier_path + (module_identifier_path + (module_identifier)) + (module_identifier)) + (arguments (module_identifier_path (module_identifier))))) (include_statement (functor_use - (module_identifier_path (module_identifier) (module_identifier)) + (module_identifier_path + (module_identifier_path + (module_identifier)) + (module_identifier)) (arguments (block (type_declaration (type_identifier)) (let_binding (value_identifier) (type_annotation (type_identifier))))))) (include_statement (module_type_of - (module_identifier_path (module_identifier) (module_identifier)))) - + (module_identifier_path + (module_identifier_path + (module_identifier)) + (module_identifier)))) (include_statement (module_type_of - (module_identifier_path (module_identifier) (module_identifier)))) + (module_identifier_path + (module_identifier_path + (module_identifier)) + (module_identifier)))) (include_statement - (module_type_constraint - (module_identifier) + (functor_parameter + (module_identifier_path (module_identifier)) + (module_type_annotation (module_type_of - (module_identifier)) - (module_identifier) - (module_identifier_path (module_identifier) (module_identifier)) - (module_identifier) - (module_identifier_path (module_identifier) (module_identifier)))) + (module_type_constraint + (module_identifier_path (module_identifier)) + (constrain_module + (module_identifier_path (module_identifier)) + (module_identifier_path + (module_identifier_path + (module_identifier)) + (module_identifier))) + (constrain_module + (module_identifier_path (module_identifier)) + (module_identifier_path + (module_identifier_path + (module_identifier)) + (module_identifier)))))))) (include_statement (module_type_of (block - (include_statement (module_identifier)))))) + (include_statement + (module_identifier_path (module_identifier))))))) =========================================== Simple definition @@ -117,7 +148,10 @@ module MyModule: { (let_binding (value_identifier) (type_annotation (type_identifier))))) (module_declaration name: (module_identifier) - signature: (module_identifier_path (module_identifier) (module_identifier)) + signature: (module_identifier_path + (module_identifier_path + (module_identifier)) + (module_identifier)) definition: (block (type_declaration (type_identifier)))) (module_declaration name: (module_identifier) @@ -140,7 +174,11 @@ module type t (block (type_declaration (type_identifier)))) (module_declaration (module_identifier) - (module_type_of (module_identifier_path (module_identifier) (module_identifier)))) + (module_type_of + (module_identifier_path + (module_identifier_path + (module_identifier)) + (module_identifier)))) (module_declaration (type_identifier))) =========================================== @@ -161,21 +199,23 @@ module(SomeFunctor(unpack(x))) (source_file (expression_statement - (module_pack_expression (module_identifier))) + (module_pack (module_identifier_path (module_identifier)))) (expression_statement - (module_pack_expression (module_identifier) (module_identifier))) + (module_pack + (module_identifier_path (module_identifier)) + (module_type_annotation (module_identifier_path (module_identifier))))) (expression_statement - (module_pack_expression + (module_pack (block (type_declaration (type_identifier)) (let_binding (value_identifier) (string (string_fragment)))) - (module_identifier))) + (module_type_annotation (module_identifier_path (module_identifier))))) (expression_statement - (module_pack_expression + (module_pack (functor_use - (module_identifier) + (module_identifier_path (module_identifier)) (arguments (module_unpack (call_arguments (value_identifier)))))))) @@ -198,16 +238,16 @@ module MyFunctor = (X: {type t}, Y: {type t}): {type tx; type ty} => { definition: (functor parameters: (functor_parameters (functor_parameter - (module_identifier) + (module_identifier_path (module_identifier)) (module_type_annotation (block (type_declaration (type_identifier))))) (functor_parameter - (module_identifier) + (module_identifier_path (module_identifier)) (module_type_annotation (block (type_declaration (type_identifier)))))) return_module_type: (module_type_annotation (block (type_declaration (type_identifier)) (type_declaration (type_identifier)))) body: (block - (type_declaration (type_identifier) (type_identifier_path (module_identifier) (type_identifier))) - (type_declaration (type_identifier) (type_identifier_path (module_identifier) (type_identifier))))))) + (type_declaration (type_identifier) (type_identifier_path (module_identifier_path (module_identifier)) (type_identifier))) + (type_declaration (type_identifier) (type_identifier_path (module_identifier_path (module_identifier)) (type_identifier))))))) =========================================== Functor signature @@ -224,7 +264,7 @@ module Make: (Content: StaticContent) => { (module_identifier) (functor (functor_parameters - (functor_parameter (module_identifier) (module_type_annotation (module_identifier)))) + (functor_parameter (module_identifier_path (module_identifier)) (module_type_annotation (module_identifier_path (module_identifier))))) (block (let_binding (value_identifier) @@ -243,10 +283,14 @@ module M = MyFunctor(Foo, Bar.Baz) (module_declaration (module_identifier) (functor_use - (module_identifier) + (module_identifier_path (module_identifier)) (arguments - (module_identifier) - (module_identifier_path (module_identifier) (module_identifier)))))) + (module_identifier_path + (module_identifier)) + (module_identifier_path + (module_identifier_path + (module_identifier)) + (module_identifier)))))) =========================================== Alias @@ -260,7 +304,10 @@ module Q = Foo.Bar.Qux (module_declaration (module_identifier) (module_identifier_path - (module_identifier_path (module_identifier) (module_identifier)) + (module_identifier_path + (module_identifier_path + (module_identifier)) + (module_identifier)) (module_identifier)))) =========================================== @@ -276,8 +323,10 @@ module rec BYOBReader: { (source_file (module_declaration (module_identifier) - (block (include_statement (module_identifier))) - (module_identifier))) + (block + (include_statement + (module_identifier_path (module_identifier)))) + (module_identifier_path (module_identifier)))) =========================================== Definition through extension @@ -362,7 +411,7 @@ external add: ( (function_type (function_type_parameters (parameter - (type_identifier_path (module_identifier) (type_identifier))) + (type_identifier_path (module_identifier_path (module_identifier)) (type_identifier))) (parameter (decorator (decorator_identifier) (decorator_arguments (template_string))) (type_identifier)) @@ -391,11 +440,11 @@ external add: ( (polyvar_declaration (polyvar_identifier) (polyvar_parameters - (type_identifier_path (module_identifier) (type_identifier)))) + (type_identifier_path (module_identifier_path (module_identifier)) (type_identifier)))) (polyvar_declaration (polyvar_identifier) (polyvar_parameters - (type_identifier_path (module_identifier) (type_identifier))))))))) + (type_identifier_path (module_identifier_path (module_identifier)) (type_identifier))))))))) (unit_type))) (string (string_fragment))))) @@ -432,5 +481,69 @@ exception Invalid = Errors.Invalid (exception_declaration (variant_identifier) (nested_variant_identifier - (module_identifier) + (module_identifier_path + (module_identifier)) (variant_identifier)))) + +========================================= +Module Constraints +========================================= + +module(M: T with type t = a and type t = b) + +module M = (): (T with type t = int) => {} + +module M = (Na: N, Nb: N): ( + (S with type t = x) with type a = b +) => {} + +--- + +(source_file + (expression_statement + (module_pack + (module_identifier_path (module_identifier)) + (module_type_annotation + (module_type_constraint + (module_identifier_path (module_identifier)) + (constrain_type + (type_identifier) + (type_identifier)) + (constrain_type + (type_identifier) + (type_identifier)))))) + + (module_declaration + (module_identifier) + (functor + (functor_parameters) + (module_type_annotation + (module_type_constraint + (module_identifier_path (module_identifier)) + (constrain_type + (type_identifier) + (type_identifier)))) + (block))) + + (module_declaration + (module_identifier) + (functor + (functor_parameters + (functor_parameter + (module_identifier_path (module_identifier)) + (module_type_annotation + (module_identifier_path (module_identifier)))) + (functor_parameter + (module_identifier_path (module_identifier)) + (module_type_annotation + (module_identifier_path (module_identifier))))) + (module_type_annotation + (module_type_constraint + (module_identifier_path (module_identifier)) + (constrain_type + (type_identifier) + (type_identifier)) + (constrain_type + (type_identifier) + (type_identifier)))) + (block)))) diff --git a/test/corpus/type_declarations.txt b/test/corpus/type_declarations.txt index 9f5e0b2..cb56ea3 100644 --- a/test/corpus/type_declarations.txt +++ b/test/corpus/type_declarations.txt @@ -35,7 +35,11 @@ type t = Foo.Bar.qux (type_declaration (type_identifier) (type_identifier_path - (module_identifier) (module_identifier) (type_identifier)))) + (module_identifier_path + (module_identifier_path + (module_identifier)) + (module_identifier)) + (type_identifier)))) =========================================== Private @@ -162,12 +166,14 @@ type t = (variant_declaration (variant_identifier) (variant_parameters - (module_pack_type (module_identifier)))) + (module_pack + (module_identifier_path (module_identifier))))) (variant_declaration (variant_identifier) (variant_parameters - (module_pack_type - (type_identifier_path (module_identifier) (type_identifier)))))))) + (module_pack + (type_identifier_path + (module_identifier_path (module_identifier)) (type_identifier)))))))) =========================================== Annotated variant