File: test_parser.ml

package info (click to toggle)
ocsigen 1.3.4-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 3,560 kB
  • sloc: ml: 35,873; makefile: 1,450; sh: 772; ansic: 29
file content (11 lines) | stat: -rw-r--r-- 339 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
let parse_file f =
  let input = open_in f in
  let lexbuf = Lexing.from_channel input in
  try
  Http_parser.header Http_lexer.token lexbuf
  with
  Parsing.Parse_error -> failwith ("erreur vers "^ (Lexing.lexeme lexbuf))
  |e -> Ocsigen_http_frame.Http_error.display_http_exception e;failwith "erreur"

let _ =
  parse_file Sys.argv.(1)