From b65767c276124fff7412ef0112929d3aab16553b Mon Sep 17 00:00:00 2001 From: Chimrod <> Date: Mon, 25 Sep 2023 11:37:23 +0200 Subject: Name clash correction --- bin/dune | 2 +- bin/qsp_parser.ml | 12 ++++++++++-- lib/dune | 2 +- test/dune | 2 +- test/qsp_parser_test.ml | 4 ++-- 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/bin/dune b/bin/dune index 239c88e..9702e66 100644 --- a/bin/dune +++ b/bin/dune @@ -3,7 +3,7 @@ (name qsp_parser) (libraries qsp_syntax - qsp_parser) + qparser) (preprocess (pps ppx_deriving.show diff --git a/bin/qsp_parser.ml b/bin/qsp_parser.ml index 0026b73..af12abe 100644 --- a/bin/qsp_parser.ml +++ b/bin/qsp_parser.ml @@ -44,7 +44,7 @@ let () = 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.Type_of) lexer in + let result = Qparser.Analyzer.parse (module Qsp_syntax.Type_of) lexer in match result with | Ok f -> ( let report = List.fold_left (f []) ~init:[] ~f:(filter_report filters) in @@ -55,8 +55,16 @@ let () = | _ -> Format.fprintf Format.std_formatter "Location %s@;%a@." file_name pp_result report; + let () = + match Sys.os_type with "Win32" -> ignore @@ read_line () | _ -> () + in exit 1) | Error e -> Format.fprintf Format.std_formatter "\nError in location %s\n%a" file_name - Qsp_parser.Analyzer.format_error e; + Qparser.Analyzer.format_error e; + + let () = + match Sys.os_type with "Win32" -> ignore @@ read_line () | _ -> () + in + exit 1 diff --git a/lib/dune b/lib/dune index 284ab67..c88994d 100644 --- a/lib/dune +++ b/lib/dune @@ -1,5 +1,5 @@ (library - (name qsp_parser) + (name qparser) (libraries qsp_syntax menhirLib) diff --git a/test/dune b/test/dune index cbc33f6..2f4e803 100644 --- a/test/dune +++ b/test/dune @@ -2,7 +2,7 @@ (name qsp_parser_test) (libraries alcotest - qsp_parser + qparser qsp_syntax fmt ) diff --git a/test/qsp_parser_test.ml b/test/qsp_parser_test.ml index 505f905..b833fe5 100644 --- a/test/qsp_parser_test.ml +++ b/test/qsp_parser_test.ml @@ -1,4 +1,4 @@ -module Parser = Qsp_parser.Parser.Make (Qsp_syntax.Tree) +module Parser = Qparser.Parser.Make (Qsp_syntax.Tree) module Tree = Qsp_syntax.Tree module Ast = Qsp_syntax.Tree.Ast module T = Ast @@ -10,7 +10,7 @@ type 'a location = 'a * 'a Ast.statement list [@@deriving eq, show] let parse : string -> T.pos location = fun content -> let lexing = Lexing.from_string content in - Parser.main Qsp_parser.Lexer.token lexing + Parser.main Qparser.Lexer.token lexing let location : T.pos location Alcotest.testable = let equal = equal_location (fun _ _ -> true) in -- cgit v1.2.3