Skip to content

Commit

Permalink
Add support for exception generators in "with sexp"
Browse files Browse the repository at this point in the history
  • Loading branch information
let-def committed Mar 24, 2013
1 parent 258f139 commit ffa59f4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions chunk_parser.mly
Expand Up @@ -615,6 +615,8 @@ structure_item:
}
| EXCEPTION UIDENT constructor_arguments
{ [mkstr $startpos $endpos (Pstr_exception(mkrhs $startpos($2) $endpos($2) $2, $3))] }
| EXCEPTION UIDENT constructor_arguments WITH with_extensions
{ [mkstr $startpos $endpos (Pstr_exception(mkrhs $startpos($2) $endpos($2) $2, $3))] }
| EXCEPTION UIDENT EQUAL constr_longident
{ [mkstr $startpos $endpos (Pstr_exn_rebind(mkrhs $startpos($2) $endpos($2) $2,
mkloc $4 (rhs_loc $startpos($4) $endpos($4))))] }
Expand Down Expand Up @@ -695,6 +697,8 @@ signature_item:
}
| EXCEPTION UIDENT constructor_arguments
{ [mksig $startpos $endpos (Psig_exception(mkrhs $startpos($2) $endpos($2) $2, $3))] }
| EXCEPTION UIDENT constructor_arguments WITH with_extensions
{ [mksig $startpos $endpos (Psig_exception(mkrhs $startpos($2) $endpos($2) $2, $3))] }
| MODULE UIDENT module_declaration
{ [mksig $startpos $endpos (Psig_module(mkrhs $startpos($2) $endpos($2) $2, $3))] }
| MODULE REC module_rec_declarations
Expand Down
4 changes: 2 additions & 2 deletions outline_parser.mly
Expand Up @@ -295,7 +295,7 @@ structure_item:
{ emit_top Definition $endpos }
| TYPE type_declarations with_extension
{ emit_top Definition $endpos }
| EXCEPTION UIDENT constructor_arguments
| EXCEPTION UIDENT constructor_arguments with_extension
{ emit_top Definition $endpos }
| EXCEPTION UIDENT EQUAL constr_longident
{ emit_top Definition $endpos }
Expand Down Expand Up @@ -364,7 +364,7 @@ signature_item:
{ () }
| TYPE type_declarations with_extension
{ () }
| EXCEPTION UIDENT constructor_arguments
| EXCEPTION UIDENT constructor_arguments with_extension
{ () }
| MODULE UIDENT module_declaration
{ () }
Expand Down

0 comments on commit ffa59f4

Please sign in to comment.