From cee9cc841eb1dfb8fbe63bbfc2e126434db15ea0 Mon Sep 17 00:00:00 2001 From: Sander Spies Date: Mon, 8 Jun 2020 15:07:20 +0200 Subject: [PATCH] More fixes for PascaLIGO. --- src/passes/01-parser/pascaligo/Pretty.ml | 4 ++-- src/test/contracts/dune | 3 --- .../contracts/expected/boolean_operators.ligo.expected | 8 ++++---- src/test/contracts/expected/loop.ligo.expected | 4 ++-- src/test/contracts/expected/variant.ligo.expected | 2 +- 5 files changed, 9 insertions(+), 12 deletions(-) diff --git a/src/passes/01-parser/pascaligo/Pretty.ml b/src/passes/01-parser/pascaligo/Pretty.ml index b65c3d6d8..e2a5b4cfd 100644 --- a/src/passes/01-parser/pascaligo/Pretty.ml +++ b/src/passes/01-parser/pascaligo/Pretty.ml @@ -411,8 +411,8 @@ and pp_bool_expr = function Or e -> pp_bin_op "or" e | And e -> pp_bin_op "and" e | Not e -> pp_un_op "not" e -| True _ -> string "true" -| False _ -> string "false" +| True _ -> string "True" +| False _ -> string "False" and pp_bin_op op {value; _} = let {arg1; arg2; _} = value diff --git a/src/test/contracts/dune b/src/test/contracts/dune index 7068bb793..0f59f8b84 100644 --- a/src/test/contracts/dune +++ b/src/test/contracts/dune @@ -1053,7 +1053,6 @@ (rule (targets arithmetic.ligo_ast) (action (with-stdout-to arithmetic.ligo_ast (run ligo print-ast arithmetic.ligo -s pascaligo))) (deps arithmetic.ligo)) (rule (targets assign.ligo_ast) (action (with-stdout-to assign.ligo_ast (run ligo print-ast assign.ligo -s pascaligo))) (deps assign.ligo)) (rule (targets attributes.ligo_ast) (action (with-stdout-to attributes.ligo_ast (run ligo print-ast attributes.ligo -s pascaligo))) (deps attributes.ligo)) -(rule (targets bad_timestamp.ligo_ast) (action (with-stdout-to bad_timestamp.ligo_ast (run ligo print-ast bad_timestamp.ligo -s pascaligo))) (deps bad_timestamp.ligo)) (rule (targets bad_type_operator.ligo_ast) (action (with-stdout-to bad_type_operator.ligo_ast (run ligo print-ast bad_type_operator.ligo -s pascaligo))) (deps bad_type_operator.ligo)) (rule (targets balance_constant.ligo_ast) (action (with-stdout-to balance_constant.ligo_ast (run ligo print-ast balance_constant.ligo -s pascaligo))) (deps balance_constant.ligo)) (rule (targets big_map.ligo_ast) (action (with-stdout-to big_map.ligo_ast (run ligo print-ast big_map.ligo -s pascaligo))) (deps big_map.ligo)) @@ -1240,7 +1239,6 @@ (rule (targets arithmetic.ligo_ast_pretty) (action (with-stdout-to arithmetic.ligo_ast_pretty (run ligo print-ast arithmetic.ligo_output -s pascaligo))) (deps arithmetic.ligo_output)) (rule (targets assign.ligo_ast_pretty) (action (with-stdout-to assign.ligo_ast_pretty (run ligo print-ast assign.ligo_output -s pascaligo))) (deps assign.ligo_output)) (rule (targets attributes.ligo_ast_pretty) (action (with-stdout-to attributes.ligo_ast_pretty (run ligo print-ast attributes.ligo_output -s pascaligo))) (deps attributes.ligo_output)) -(rule (targets bad_timestamp.ligo_ast_pretty) (action (with-stdout-to bad_timestamp.ligo_ast_pretty (run ligo print-ast bad_timestamp.ligo_output -s pascaligo))) (deps bad_timestamp.ligo_output)) (rule (targets bad_type_operator.ligo_ast_pretty) (action (with-stdout-to bad_type_operator.ligo_ast_pretty (run ligo print-ast bad_type_operator.ligo_output -s pascaligo))) (deps bad_type_operator.ligo_output)) (rule (targets balance_constant.ligo_ast_pretty) (action (with-stdout-to balance_constant.ligo_ast_pretty (run ligo print-ast balance_constant.ligo_output -s pascaligo))) (deps balance_constant.ligo_output)) (rule (targets big_map.ligo_ast_pretty) (action (with-stdout-to big_map.ligo_ast_pretty (run ligo print-ast big_map.ligo_output -s pascaligo))) (deps big_map.ligo_output)) @@ -1427,7 +1425,6 @@ (alias (name runtest) (action (diff arithmetic.ligo_ast arithmetic.ligo_ast_pretty)) (deps arithmetic.ligo_ast arithmetic.ligo_ast_pretty)) (alias (name runtest) (action (diff assign.ligo_ast assign.ligo_ast_pretty)) (deps assign.ligo_ast assign.ligo_ast_pretty)) (alias (name runtest) (action (diff attributes.ligo_ast attributes.ligo_ast_pretty)) (deps attributes.ligo_ast attributes.ligo_ast_pretty)) -(alias (name runtest) (action (diff bad_timestamp.ligo_ast bad_timestamp.ligo_ast_pretty)) (deps bad_timestamp.ligo_ast bad_timestamp.ligo_ast_pretty)) (alias (name runtest) (action (diff bad_type_operator.ligo_ast bad_type_operator.ligo_ast_pretty)) (deps bad_type_operator.ligo_ast bad_type_operator.ligo_ast_pretty)) (alias (name runtest) (action (diff balance_constant.ligo_ast balance_constant.ligo_ast_pretty)) (deps balance_constant.ligo_ast balance_constant.ligo_ast_pretty)) (alias (name runtest) (action (diff big_map.ligo_ast big_map.ligo_ast_pretty)) (deps big_map.ligo_ast big_map.ligo_ast_pretty)) diff --git a/src/test/contracts/expected/boolean_operators.ligo.expected b/src/test/contracts/expected/boolean_operators.ligo.expected index 110e856ed..499947dc2 100644 --- a/src/test/contracts/expected/boolean_operators.ligo.expected +++ b/src/test/contracts/expected/boolean_operators.ligo.expected @@ -1,9 +1,9 @@ -function or_true (const b : bool) : bool is b or true +function or_true (const b : bool) : bool is b or True -function or_false (const b : bool) : bool is b or false +function or_false (const b : bool) : bool is b or False -function and_true (const b : bool) : bool is b and true +function and_true (const b : bool) : bool is b and True -function and_false (const b : bool) : bool is b and false +function and_false (const b : bool) : bool is b and False function not_bool (const b : bool) : bool is not b diff --git a/src/test/contracts/expected/loop.ligo.expected b/src/test/contracts/expected/loop.ligo.expected index d6b3df0b0..7a8e40b8a 100644 --- a/src/test/contracts/expected/loop.ligo.expected +++ b/src/test/contracts/expected/loop.ligo.expected @@ -208,7 +208,7 @@ block { function dummy (const n : nat) : nat is block { - while false + while False block { skip } @@ -218,7 +218,7 @@ function inner_capture_in_conditional_block (var nee : unit) : bool * int is block { var count : int := 1; - var ret : bool := false; + var ret : bool := False; var mylist : list (int) := list [1; 2; 3]; for it1 in list mylist block { diff --git a/src/test/contracts/expected/variant.ligo.expected b/src/test/contracts/expected/variant.ligo.expected index cd06f7ec3..aae742d50 100644 --- a/src/test/contracts/expected/variant.ligo.expected +++ b/src/test/contracts/expected/variant.ligo.expected @@ -2,6 +2,6 @@ type foobar is Foo of int | Bar of bool | Kee of nat const foo : foobar = Foo (42) -const bar : foobar = Bar (true) +const bar : foobar = Bar (True) const kee : foobar = Kee (23n)