camlspotter avatar camlspotter committed 5264847

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

Comments (0)

Files changed (1)

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, []) }
 ;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.