From 5cef850bdd59fa46482cbe2a0a3778d6e0fc0320 Mon Sep 17 00:00:00 2001 From: Tom Jack Date: Thu, 9 Jan 2020 16:51:23 -0600 Subject: [PATCH] Fix printing of bytes in parsers/lexers --- src/passes/1-parser/cameligo/LexToken.mll | 2 +- src/passes/1-parser/cameligo/ParserLog.ml | 4 ++-- src/passes/1-parser/pascaligo/LexToken.mll | 2 +- src/passes/1-parser/pascaligo/ParserLog.ml | 4 ++-- src/passes/1-parser/reasonligo/LexToken.mll | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/passes/1-parser/cameligo/LexToken.mll b/src/passes/1-parser/cameligo/LexToken.mll index 5576d7c7b..d989d1186 100644 --- a/src/passes/1-parser/cameligo/LexToken.mll +++ b/src/passes/1-parser/cameligo/LexToken.mll @@ -145,7 +145,7 @@ let proj_token = function | Bytes Region.{region; value = s,b} -> region, sprintf "Bytes (\"%s\", \"0x%s\")" - s (Hex.to_string b) + s (Hex.show b) | Begin region -> region, "Begin" | Else region -> region, "Else" | End region -> region, "End" diff --git a/src/passes/1-parser/cameligo/ParserLog.ml b/src/passes/1-parser/cameligo/ParserLog.ml index 18c29a7d7..79c8baf09 100644 --- a/src/passes/1-parser/cameligo/ParserLog.ml +++ b/src/passes/1-parser/cameligo/ParserLog.ml @@ -105,7 +105,7 @@ let print_bytes state {region; value} = let line = sprintf "%s: Bytes (\"%s\", \"0x%s\")\n" (compact state region) lexeme - (Hex.to_string abstract) + (Hex.show abstract) in Buffer.add_string state#buffer line let print_int state {region; value} = @@ -712,7 +712,7 @@ and pp_ne_injection : and pp_bytes state {value=lexeme,hex; region} = pp_loc_node (state#pad 2 0) lexeme region; - pp_node (state#pad 2 1) (Hex.to_string hex) + pp_node (state#pad 2 1) (Hex.show hex) and pp_int state {value=lexeme,z; region} = pp_loc_node (state#pad 2 0) lexeme region; diff --git a/src/passes/1-parser/pascaligo/LexToken.mll b/src/passes/1-parser/pascaligo/LexToken.mll index b721a7932..51009bb76 100644 --- a/src/passes/1-parser/pascaligo/LexToken.mll +++ b/src/passes/1-parser/pascaligo/LexToken.mll @@ -126,7 +126,7 @@ let proj_token = function | Bytes Region.{region; value = s,b} -> region, sprintf "Bytes (\"%s\", \"0x%s\")" - s (Hex.to_string b) + s (Hex.show b) | Int Region.{region; value = s,n} -> region, sprintf "Int (\"%s\", %s)" s (Z.to_string n) diff --git a/src/passes/1-parser/pascaligo/ParserLog.ml b/src/passes/1-parser/pascaligo/ParserLog.ml index 5febaecd1..9b793a327 100644 --- a/src/passes/1-parser/pascaligo/ParserLog.ml +++ b/src/passes/1-parser/pascaligo/ParserLog.ml @@ -90,7 +90,7 @@ let print_bytes state {region; value} = let line = sprintf "%s: Bytes (\"%s\", \"0x%s\")\n" (compact state region) lexeme - (Hex.to_string abstract) + (Hex.show abstract) in Buffer.add_string state#buffer line let print_int state {region; value} = @@ -1093,7 +1093,7 @@ and pp_pattern state = function and pp_bytes state {value=lexeme,hex; region} = pp_loc_node (state#pad 2 0) lexeme region; - pp_node (state#pad 2 1) (Hex.to_string hex) + pp_node (state#pad 2 1) (Hex.show hex) and pp_int state {value=lexeme,z; region} = pp_loc_node (state#pad 2 0) lexeme region; diff --git a/src/passes/1-parser/reasonligo/LexToken.mll b/src/passes/1-parser/reasonligo/LexToken.mll index dd3272142..341dd8015 100644 --- a/src/passes/1-parser/reasonligo/LexToken.mll +++ b/src/passes/1-parser/reasonligo/LexToken.mll @@ -140,7 +140,7 @@ let proj_token = function | Bytes Region.{region; value = s,b} -> region, sprintf "Bytes (\"%s\", \"0x%s\")" - s (Hex.to_string b) + s (Hex.show b) | Else region -> region, "Else" | False region -> region, "False" | If region -> region, "If"