1. camlspotter
  2. ocaml-indent

Commits

camlspotter  committed 6fb5e43

fix for parenless comma after ->

  • Participants
  • Parent commits 9c09aca
  • Branches default

Comments (0)

Files changed (1)

File main.ml

View file
  • Ignore whitespace
     | KDo of int
     | KFunction of int
     | KFun of int
+    | KCaseArrow
   with sexp
 
   type elt = { k : k;
         let rec f bases = match bases with
           | { k = (KWith cols) } :: _ ->
               bases0, 
-              { k = KNone (* arrow ? *); indent = cols + 4; } :: bases
+              { k = KCaseArrow; indent = cols + 4; } :: bases
           | { k = (KFunction cols) } :: _ ->
               bases0, 
-              { k = KNone (* arrow ? *); indent = cols + 6; } :: bases
+              { k = KCaseArrow; indent = cols + 6; } :: bases
           | { k = (KFun cols) } :: _ ->
               bases0, 
-              { k = KNone (* arrow ? *); indent = cols + 2; } :: bases
+              { k = KCaseArrow; indent = cols + 2; } :: bases
           | [] -> bases0, bases0 (* if overrun, keep the original *)
           | _ :: bs -> f bs
         in
           | { k = ( KParen cols ) } :: _ ->
               fix cols, bases
           (* comma cannot exceeds them (comma is stronger than them) *)
-          | { k = (KThen _ | KElse _ | KWith _ | KFunction _ | KFun _) } :: _ ->
+          | { k = (KThen _ | KElse _ | KWith _ | KFunction _ | KFun _ | KCaseArrow ) } :: _ ->
               bases0, bases
           | [] -> bases0, bases0 (* if overrun, keep the original *)
           | _ :: bs -> f bs