Fix printing of bytes in parsers/lexers
This commit is contained in:
parent
1b0ed4d4de
commit
5cef850bdd
@ -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"
|
||||
|
@ -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;
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user