OSDN Git Service

remove warn
authorMIZUNO Hiroki <mzpppp@gmail.com>
Thu, 7 Aug 2008 12:50:32 +0000 (21:50 +0900)
committerMIZUNO Hiroki <mzpppp@gmail.com>
Thu, 7 Aug 2008 12:50:32 +0000 (21:50 +0900)
src/base.ml
src/bytes.ml
src/hList.ml
src/lexer.ml

index cf72b54..56d27f8 100644 (file)
@@ -48,9 +48,12 @@ let rec group_by f =
       [] ->
        []
     | x1::x2::xs when f x1 x2 ->
-       let y::ys = 
-         group_by f @@ x2::xs in
-         (x1::y)::ys
+       begin match group_by f @@ x2::xs with
+           y::ys ->
+             (x1::y)::ys
+         | _ ->
+             failwith "must not happen"
+       end
     | x::xs ->
        [x]::group_by f xs
   
index 614c313..d1d7f27 100644 (file)
@@ -81,8 +81,6 @@ let rec encode_base = function
             let current =
               Int32.to_int ((x &/ 0x7Fl) |/ 0x80l) in
               Some (current,next)) x
-  | _ ->
-      invalid_arg "of_int_list"
 
 (** encode label *)
 
@@ -132,7 +130,7 @@ let rec encode_blocked bytes =
            encode_base @@ U30 (Int32.of_int @@ List.length ys) in
            len @ ys
       | xs ->
-         encode_labeled @@ List.map (fun (Labeled x)->x) xs in
+         encode_labeled @@ List.map (function (Labeled x)->x | _ -> failwith "must not happen") xs in
   let same x y =
     match x,y with
       | Labeled _,Labeled _ ->
index f7bc29b..2b77075 100644 (file)
@@ -85,9 +85,11 @@ let rec scanr f z =
       [] ->
        [z]
     | x::xs ->
-       let y::_ as yss = 
-         scanr f z xs in
-         (f x y) :: yss
+       match scanr f z xs with
+           y::_ as yss ->
+             (f x y) :: yss
+         | _ ->
+             failwith "must not happen"
 
 let scanr1 f =
   function
index adf0678..6cdced5 100644 (file)
@@ -64,13 +64,16 @@ let parse_int stream =
 let parse_number stream =
   match stream with parser
       [<Genlex.Int x = parse_int>] ->
-       match stream with parser
+       begin match stream with parser
            [<''.'; y = many digit >] ->
              let v = 
                Printf.sprintf "%d.%s" x @@ ExtString.String.implode y in
                Genlex.Float (float_of_string v)
          | [<>] ->
              Genlex.Int x
+       end
+    | [<>] ->
+       fail ()
 
 
 type token = Genlex.token