From a2a35cc953a3e18191ef646cc192a6e321700137 Mon Sep 17 00:00:00 2001 From: Christian Rinderknecht Date: Wed, 22 Jan 2020 12:47:11 +0100 Subject: [PATCH] Fixed helpers.ml and promoted negative test of reserved name for PascaLIGO. --- src/bin/expect_tests/lexer_tests.ml | 4 ++-- src/main/compile/helpers.ml | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/bin/expect_tests/lexer_tests.ml b/src/bin/expect_tests/lexer_tests.ml index 1e016fe78..99c75f077 100644 --- a/src/bin/expect_tests/lexer_tests.ml +++ b/src/bin/expect_tests/lexer_tests.ml @@ -99,9 +99,9 @@ ligo: lexer error: Negative byte sequence. run_ligo_bad [ "compile-contract" ; "../../test/lexer/reserved_name.ligo" ; "main" ] ; [%expect {| -ligo: lexer error: Reserved name: args. +ligo: lexer error: Reserved name: arguments. Hint: Change the name. - {"parser_loc":"in file \"reserved_name.ligo\", line 1, characters 4-8"} + {"parser_loc":"in file \"reserved_name.ligo\", line 1, characters 4-13"} If you're not sure how to fix this error, you can diff --git a/src/main/compile/helpers.ml b/src/main/compile/helpers.ml index 317b92736..b7daab8fe 100644 --- a/src/main/compile/helpers.ml +++ b/src/main/compile/helpers.ml @@ -134,27 +134,27 @@ let parsify_string = fun (syntax : v_syntax) source_filename -> let%bind applied = Self_ast_simplified.all_program parsified in ok applied -let pretty_print_pascaligo = fun source -> +let pretty_print_pascaligo = fun source -> let%bind ast = Parser.Pascaligo.parse_file source in let buffer = Buffer.create 59 in - let state = Parser.Pascaligo.ParserLog.mk_state + let state = Parser_pascaligo.ParserLog.mk_state ~offsets:true ~mode:`Byte ~buffer in - Parser.Pascaligo.ParserLog.pp_ast state ast; + Parser_pascaligo.ParserLog.pp_ast state ast; ok buffer -let pretty_print_cameligo = fun source -> +let pretty_print_cameligo = fun source -> let%bind ast = Parser.Cameligo.parse_file source in let buffer = Buffer.create 59 in - let state = Parser.Cameligo.ParserLog.mk_state + let state = Parser_cameligo.ParserLog.mk_state ~offsets:true ~mode:`Byte ~buffer in Parser.Cameligo.ParserLog.pp_ast state ast; ok buffer -let pretty_print_reasonligo = fun source -> +let pretty_print_reasonligo = fun source -> let%bind ast = Parser.Reasonligo.parse_file source in let buffer = Buffer.create 59 in let state = Parser.Reasonligo.ParserLog.mk_state @@ -170,4 +170,4 @@ let pretty_print = fun syntax source_filename -> | Pascaligo -> pretty_print_pascaligo | Cameligo -> pretty_print_cameligo | ReasonLIGO -> pretty_print_reasonligo) - source_filename \ No newline at end of file + source_filename