diff --git a/vendors/Preprocessor/E_LexerMain.ml b/vendors/Preprocessor/E_LexerMain.ml index 93b0a5930..3c8f87403 100644 --- a/vendors/Preprocessor/E_LexerMain.ml +++ b/vendors/Preprocessor/E_LexerMain.ml @@ -5,7 +5,7 @@ module Region = Simple_utils.Region let highlight msg = Printf.eprintf "\027[31m%s\027[0m%!" msg -let options = EvalOpt.(read ~lang:`PascaLIGO ~ext:".ligo") +let options = EvalOpt.read ".ligo" (* No comments allowed *) let lex in_chan = let buffer = Lexing.from_channel in_chan in diff --git a/vendors/Preprocessor/E_ParserMain.ml b/vendors/Preprocessor/E_ParserMain.ml index 653e80425..d46d9eea1 100644 --- a/vendors/Preprocessor/E_ParserMain.ml +++ b/vendors/Preprocessor/E_ParserMain.ml @@ -5,7 +5,7 @@ module Region = Simple_utils.Region let highlight msg = Printf.eprintf "\027[31m%s\027[0m%!" msg -let options = EvalOpt.(read ~lang:`PascaLIGO ~ext:".ligo") +let options = EvalOpt.read ".ligo" (* No comments allowed *) let parse in_chan = let buffer = Lexing.from_channel in_chan in diff --git a/vendors/Preprocessor/EvalOpt.ml b/vendors/Preprocessor/EvalOpt.ml index 63c92fad1..2ce560cec 100644 --- a/vendors/Preprocessor/EvalOpt.ml +++ b/vendors/Preprocessor/EvalOpt.ml @@ -2,29 +2,33 @@ (* The type [options] gathers the command-line options. *) -type language = [`PascaLIGO | `CameLIGO | `ReasonLIGO] - -let lang_to_string = function - `PascaLIGO -> "PascaLIGO" -| `CameLIGO -> "CameLIGO" -| `ReasonLIGO -> "ReasonLIGO" - module SSet = Set.Make (String) +type line_comment = string (* Opening of a line comment *) +type block_comment = + +let mk_block ~opening ~closing : block_comment = + object + method opening = opening + method closing = closing + end + type options = < input : string option; libs : string list; verbose : SSet.t; offsets : bool; - lang : language; - ext : string (* ".ligo", ".mligo", ".religo" *) + block : block_comment option; + line : line_comment option; + ext : string > -let make ~input ~libs ~lang ~offsets ~verbose ~ext : options = +let make ~input ~libs ?block ?line ~offsets ~verbose ~ext : options = object method input = input method libs = libs - method lang = lang + method block = block + method line = line method offsets = offsets method verbose = verbose method ext = ext @@ -47,10 +51,10 @@ let abort msg = (* Help *) -let help lang ext () = +let help ext () = let file = Filename.basename Sys.argv.(0) in printf "Usage: %s [