Commits

Anonymous committed f97314b

urilex, content-type, fixing error reporting

Comments (0)

Files changed (1)

 
 (* not an uri, but http *)
 
+and dump_rest = parse
+  ((_ *) as s)
+    { s }
+
 and content_type = parse
   g_space+
     { content_type lexbuf }
       | e -> `Error (Printexc.to_string e)
     }
 
-| ((_ *) as txt)
-    { `Error (Printf.sprintf "bad Content-Type: %S" txt) }
+| ""
+    { `Error (Printf.sprintf "bad Content-Type: %S" (dump_rest lexbuf)) }
 
 and parameters acc = parse
   eof 
       (par_name, v)
     }
 
-| ((_ *) as txt)
-    { failwith "expected parameter, found %S" txt }
+| ""
+    { failwith "expected parameter, found %S" (dump_rest lexbuf) }
 
 and parameter_value = parse
   (token as t) g_space*
     { t }
 | '"'
     { inside_quoted_string (Buffer.create 40) lexbuf }
-| ((_ *) as txt)
-    { failwith "expected parameter's value, found %S" txt }
+| ""
+    { failwith "expected parameter's value, found %S" (dump_rest lexbuf) }
 
 and inside_quoted_string buf = parse
   '"' g_space*
     { let () = Buffer.add_string buf txt in
       inside_quoted_string buf lexbuf
     }
-| ((_ *) as txt)
-    { failwith "expected HTTP's TEXT, found %S" txt }
+| ""
+    { failwith "expected HTTP's TEXT, found %S" (dump_rest lexbuf) }
 
 and escaped_char = parse
   g_char as c
 
 
 
-
-
-