aboutsummaryrefslogtreecommitdiff
path: root/bin/main.ml
blob: 1e8ff4561d25ac49587e68cc791d87250087063b (plain)
1
2
3
4
5
6
7
8
9
10
11
let () =
  let file_name = Sys.argv.(1) in
  let ic = Stdlib.open_in file_name in
  let lexer = Lexing.from_channel ~with_positions:true ic in
  let result = Qsp_parser.Analyzer.parse (module Qsp_syntax.Tree) lexer in
  match result with
  | Ok _ -> exit 0
  | Error e ->
      Format.fprintf Format.std_formatter "\nError in location %s\n%a" file_name
        Qsp_parser.Analyzer.format_error e;
      exit 1