Commits

camlspotter committed 5264847

added type t = F (int, bool) syntax and {..} for struct..end sig..end

  • Participants
  • Parent commits cf8f011
  • Branches custom-3.12.0

Comments (0)

Files changed (1)

File parsing/parser.mly

       { mkmod(Pmod_structure($2)) }
   | STRUCT structure error
       { unclosed "struct" 1 "end" 3 }
+  | LBRACE structure RBRACE
+      { mkmod(Pmod_structure($2)) }
+  | LBRACE structure error
+      { unclosed "{" 1 "end" 3 }
   | FUNCTOR LPAREN UIDENT COLON module_type RPAREN MINUSGREATER module_expr
       { mkmod(Pmod_functor($3, $5, $8)) }
   | module_expr LPAREN module_expr RPAREN
       { mkmty(Pmty_signature(List.rev $2)) }
   | SIG signature error
       { unclosed "sig" 1 "end" 3 }
+  | LBRACE signature RBRACE
+      { mkmty(Pmty_signature(List.rev $2)) }
+  | LBRACE signature error
+      { unclosed "{" 1 "end" 3 }
   | FUNCTOR LPAREN UIDENT COLON module_type RPAREN MINUSGREATER module_type
       %prec below_WITH
       { mkmty(Pmty_functor($3, $5, $8)) }
 constructor_arguments:
     /*empty*/                                   { [] }
   | OF core_type_list                           { List.rev $2 }
+  | LPAREN core_type_comma_list RPAREN          { List.rev $2 }
 ;
 label_declarations:
     label_declaration                           { [$1] }
 tag_field:
     name_tag OF opt_ampersand amper_type_list
       { Rtag ($1, $3, List.rev $4) }
+  | name_tag LPAREN opt_ampersand amper_type_list RPAREN
+      { Rtag ($1, $3, List.rev $4) }
   | name_tag
       { Rtag ($1, true, []) }
 ;