From a1b0601c160c2c7377cc95fb39d6c8885437386c Mon Sep 17 00:00:00 2001 From: EmileRolley Date: Wed, 26 May 2021 17:44:57 +0200 Subject: [PATCH] refactor(driver)!: removes the `NonVerbose frontend language --- src/catala/driver.ml | 5 ++--- src/catala/surface/parser_driver.ml | 2 -- src/catala/utils/cli.ml | 4 ++-- src/catala/utils/cli.mli | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/catala/driver.ml b/src/catala/driver.ml index a9ea645d..b0a6b8b3 100644 --- a/src/catala/driver.ml +++ b/src/catala/driver.ml @@ -17,12 +17,11 @@ module Errors = Utils.Errors module Pos = Utils.Pos (** Associates a {!type: Cli.frontend_lang} with its string represtation. *) -let languages = [ ("en", `En); ("fr", `Fr); ("pl", `Pl); ("non-verbose", `NonVerbose) ] +let languages = [ ("en", `En); ("fr", `Fr); ("pl", `Pl) ] (** Associates a file extension with its corresponding {!type: Cli.frontend_lang} string representation. *) -let extensions = - [ (".catala_fr", "fr"); (".catala_en", "en"); (".catala_pl", "pl"); (".catala", "non-verbose") ] +let extensions = [ (".catala_fr", "fr"); (".catala_en", "en"); (".catala_pl", "pl") ] (** Entry function for the executable. Returns a negative number in case of error. Usage: [driver source_file debug dcalc unstyled wrap_weaved_output backend language max_prec_digits trace optimize scope_to_execute output_file]*) diff --git a/src/catala/surface/parser_driver.ml b/src/catala/surface/parser_driver.ml index 9dd27481..ea087028 100644 --- a/src/catala/surface/parser_driver.ml +++ b/src/catala/surface/parser_driver.ml @@ -222,13 +222,11 @@ module ParserAux (LocalisedLexer : Lexer_common.LocalisedLexer) = struct sedlex_with_menhir LocalisedLexer.lexer LocalisedLexer.token_list Incremental.source_file lexbuf end -module Parser_NonVerbose = ParserAux (Lexer_en) module Parser_En = ParserAux (Lexer_en) module Parser_Fr = ParserAux (Lexer_fr) module Parser_Pl = ParserAux (Lexer_pl) let localised_parser : Cli.frontend_lang -> lexbuf -> Ast.source_file = function - | `NonVerbose -> Parser_NonVerbose.commands_or_includes | `En -> Parser_En.commands_or_includes | `Fr -> Parser_Fr.commands_or_includes | `Pl -> Parser_Pl.commands_or_includes diff --git a/src/catala/utils/cli.ml b/src/catala/utils/cli.ml index 7b17a9cc..5f6aed26 100644 --- a/src/catala/utils/cli.ml +++ b/src/catala/utils/cli.ml @@ -12,12 +12,12 @@ or implied. See the License for the specific language governing permissions and limitations under the License. *) -type frontend_lang = [ `Fr | `En | `NonVerbose | `Pl ] +type frontend_lang = [ `Fr | `En | `Pl ] type backend_lang = [ `Fr | `En | `Pl ] let to_backend_lang (lang : frontend_lang) : backend_lang = - match lang with `En | `NonVerbose -> `En | `Fr -> `Fr | `Pl -> `Pl + match lang with `En | `Fr -> `Fr | `Pl -> `Pl (** Source files to be compiled *) let source_files : string list ref = ref [] diff --git a/src/catala/utils/cli.mli b/src/catala/utils/cli.mli index 2ffa0b96..bdc9c095 100644 --- a/src/catala/utils/cli.mli +++ b/src/catala/utils/cli.mli @@ -12,7 +12,7 @@ or implied. See the License for the specific language governing permissions and limitations under the License. *) -type frontend_lang = [ `En | `Fr | `NonVerbose | `Pl ] +type frontend_lang = [ `En | `Fr | `Pl ] type backend_lang = [ `En | `Fr | `Pl ]