jasmin2tex program always convert integer from source file to base 10. In certain cases, it makes readability of the program harder. For example :
tab[i] = 0xab;
is converted to :
\jasminindent{2}tab[i] = 172;\\
Solution
We implement a new Syntax node pbinteger that store the raw integer string coming from source file :
type pbinteger = {zvalue:Z.t; raw:string}
At pretyping, we convert this type back to Z.t, which mean that it does not affect the behavior of the compiler for all next compilation steps. Since latex_printer is executed before pre-typing, we can use the raw string for generating latex file. The new output is now :
\jasminindent{2}tab[i] = 0xab;\\
Changelog
Add new Syntax Node pbasedinteger which dissapear at pretyping
Issue
jasmin2tex program always convert integer from source file to base 10. In certain cases, it makes readability of the program harder. For example :
is converted to :
Solution
We implement a new Syntax node
pbinteger
that store the raw integer string coming from source file :At pretyping, we convert this type back to
Z.t
, which mean that it does not affect the behavior of the compiler for all next compilation steps. Sincelatex_printer
is executed before pre-typing, we can use the raw string for generating latex file. The new output is now :Changelog
pbasedinteger
which dissapear at pretyping