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
 
 
 
-
-
-
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.