Fixed bug #3592
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6900 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02master
parent
ba8b84047b
commit
85bb4ee7f0
|
@ -482,6 +482,8 @@ value rec patt =
|
||||||
| PaRec loc lpl -> mkpat loc (Ppat_record (List.map mklabpat lpl))
|
| PaRec loc lpl -> mkpat loc (Ppat_record (List.map mklabpat lpl))
|
||||||
| PaStr loc s ->
|
| PaStr loc s ->
|
||||||
mkpat loc (Ppat_constant (Const_string (string_of_string_token loc s)))
|
mkpat loc (Ppat_constant (Const_string (string_of_string_token loc s)))
|
||||||
|
| PaTup loc [] -> error loc "empty tuple pattern"
|
||||||
|
| PaTup loc [_] -> error loc "singleton tuple pattern"
|
||||||
| PaTup loc pl -> mkpat loc (Ppat_tuple (List.map patt pl))
|
| PaTup loc pl -> mkpat loc (Ppat_tuple (List.map patt pl))
|
||||||
| PaTyc loc p t -> mkpat loc (Ppat_constraint (patt p) (ctyp t))
|
| PaTyc loc p t -> mkpat loc (Ppat_constraint (patt p) (ctyp t))
|
||||||
| PaTyp loc sl -> mkpat loc (Ppat_type (long_id_of_string_list loc sl))
|
| PaTyp loc sl -> mkpat loc (Ppat_type (long_id_of_string_list loc sl))
|
||||||
|
@ -703,6 +705,8 @@ value rec expr =
|
||||||
| ExStr loc s ->
|
| ExStr loc s ->
|
||||||
mkexp loc (Pexp_constant (Const_string (string_of_string_token loc s)))
|
mkexp loc (Pexp_constant (Const_string (string_of_string_token loc s)))
|
||||||
| ExTry loc e pel -> mkexp loc (Pexp_try (expr e) (List.map mkpwe pel))
|
| ExTry loc e pel -> mkexp loc (Pexp_try (expr e) (List.map mkpwe pel))
|
||||||
|
| ExTup loc [] -> error loc "empty tuple"
|
||||||
|
| ExTup loc [e] -> error loc "singleton tuple"
|
||||||
| ExTup loc el -> mkexp loc (Pexp_tuple (List.map expr el))
|
| ExTup loc el -> mkexp loc (Pexp_tuple (List.map expr el))
|
||||||
| ExTyc loc e t -> mkexp loc (Pexp_constraint (expr e) (Some (ctyp t)) None)
|
| ExTyc loc e t -> mkexp loc (Pexp_constraint (expr e) (Some (ctyp t)) None)
|
||||||
| ExUid loc s ->
|
| ExUid loc s ->
|
||||||
|
|
|
@ -488,6 +488,8 @@ let rec patt =
|
||||||
| PaRec (loc, lpl) -> mkpat loc (Ppat_record (List.map mklabpat lpl))
|
| PaRec (loc, lpl) -> mkpat loc (Ppat_record (List.map mklabpat lpl))
|
||||||
| PaStr (loc, s) ->
|
| PaStr (loc, s) ->
|
||||||
mkpat loc (Ppat_constant (Const_string (string_of_string_token loc s)))
|
mkpat loc (Ppat_constant (Const_string (string_of_string_token loc s)))
|
||||||
|
| PaTup (loc, []) -> error loc "empty tuple pattern"
|
||||||
|
| PaTup (loc, [_]) -> error loc "singleton tuple pattern"
|
||||||
| PaTup (loc, pl) -> mkpat loc (Ppat_tuple (List.map patt pl))
|
| PaTup (loc, pl) -> mkpat loc (Ppat_tuple (List.map patt pl))
|
||||||
| PaTyc (loc, p, t) -> mkpat loc (Ppat_constraint (patt p, ctyp t))
|
| PaTyc (loc, p, t) -> mkpat loc (Ppat_constraint (patt p, ctyp t))
|
||||||
| PaTyp (loc, sl) -> mkpat loc (Ppat_type (long_id_of_string_list loc sl))
|
| PaTyp (loc, sl) -> mkpat loc (Ppat_type (long_id_of_string_list loc sl))
|
||||||
|
@ -723,6 +725,8 @@ let rec expr =
|
||||||
| ExStr (loc, s) ->
|
| ExStr (loc, s) ->
|
||||||
mkexp loc (Pexp_constant (Const_string (string_of_string_token loc s)))
|
mkexp loc (Pexp_constant (Const_string (string_of_string_token loc s)))
|
||||||
| ExTry (loc, e, pel) -> mkexp loc (Pexp_try (expr e, List.map mkpwe pel))
|
| ExTry (loc, e, pel) -> mkexp loc (Pexp_try (expr e, List.map mkpwe pel))
|
||||||
|
| ExTup (loc, []) -> error loc "empty tuple"
|
||||||
|
| ExTup (loc, [e]) -> error loc "singleton tuple"
|
||||||
| ExTup (loc, el) -> mkexp loc (Pexp_tuple (List.map expr el))
|
| ExTup (loc, el) -> mkexp loc (Pexp_tuple (List.map expr el))
|
||||||
| ExTyc (loc, e, t) ->
|
| ExTyc (loc, e, t) ->
|
||||||
mkexp loc (Pexp_constraint (expr e, Some (ctyp t), None))
|
mkexp loc (Pexp_constraint (expr e, Some (ctyp t), None))
|
||||||
|
|
Loading…
Reference in New Issue