Merge branch 'feature/literal-bytes-again-again' into 'dev'

Fix literal bytes printing again

See merge request ligolang/ligo!423
This commit is contained in:
Christian Rinderknecht 2020-02-16 11:47:57 +00:00
commit c04cd69103
2 changed files with 6 additions and 1 deletions

View File

@ -166,7 +166,7 @@ let literal ppf (l : literal) =
| Literal_string s ->
fprintf ppf "%S" s
| Literal_bytes b ->
fprintf ppf "0x%s" @@ Bytes.to_string @@ Bytes.escaped b
fprintf ppf "0x%a" Hex.pp (Hex.of_bytes b)
| Literal_address s ->
fprintf ppf "@%S" s
| Literal_operation _ ->

View File

@ -0,0 +1,5 @@
open PP
let%expect_test _ =
Format.printf "%a" literal (Literal_bytes (Bytes.of_string "foo")) ;
[%expect{| 0x666f6f |}]