diff options
Diffstat (limited to 'parsing')
| -rw-r--r-- | parsing/g_constr.ml4 | 8 | ||||
| -rw-r--r-- | parsing/ppconstr.ml | 1 |
2 files changed, 7 insertions, 2 deletions
diff --git a/parsing/g_constr.ml4 b/parsing/g_constr.ml4 index c649b58466..a7d905032b 100644 --- a/parsing/g_constr.ml4 +++ b/parsing/g_constr.ml4 @@ -203,8 +203,9 @@ GEXTEND Gram CLetTuple (loc,List.map snd lb,po,c1,c2) | "dest"; c1 = operconstr LEVEL "200"; "as"; p=pattern; "in"; c2 = operconstr LEVEL "200" -> + let loc' = cases_pattern_expr_loc p in CCases (loc, None, [(c1, (None, None))], - [loc, [[p]], c2]) + [loc, [loc',[p]], c2]) | "if"; c=operconstr LEVEL "200"; po = return_type; "then"; b1=operconstr LEVEL "200"; "else"; b2=operconstr LEVEL "200" -> @@ -274,8 +275,11 @@ GEXTEND Gram branches: [ [ OPT"|"; br=LIST0 eqn SEP "|" -> br ] ] ; + mult_pattern: + [ [ pl = LIST1 pattern LEVEL "99" SEP "," -> (loc,pl) ] ] + ; eqn: - [ [ pll = LIST1 LIST1 pattern LEVEL "99" SEP "," SEP "|"; + [ [ pll = LIST1 mult_pattern SEP "|"; "=>"; rhs = lconstr -> (loc,pll,rhs) ] ] ; pattern: diff --git a/parsing/ppconstr.ml b/parsing/ppconstr.ml index 85bf11806e..ed4386ada0 100644 --- a/parsing/ppconstr.ml +++ b/parsing/ppconstr.ml @@ -197,6 +197,7 @@ let rec pr_patt sep inh p = let pr_patt = pr_patt mt let pr_eqn pr (loc,pl,rhs) = + let pl = List.map snd pl in spc() ++ hov 4 (pr_with_comments loc (str "| " ++ |
