mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-08 07:48:47 +00:00
Modified escaping for llvm assembly
This commit is contained in:
parent
60f1f7d024
commit
670bb2d242
1 changed files with 6 additions and 5 deletions
11
src/X86.ml
11
src/X86.ml
|
|
@ -1156,11 +1156,12 @@ class env prg =
|
||||||
let buf = Buffer.create (n * 2) in
|
let buf = Buffer.create (n * 2) in
|
||||||
let rec iterate i =
|
let rec iterate i =
|
||||||
if i < n then (
|
if i < n then (
|
||||||
(match x.[i] with
|
match x.[i] with
|
||||||
| '"' -> Buffer.add_string buf "\\\""
|
| '"' -> Buffer.add_string buf "\\\""
|
||||||
| '\n' -> Buffer.add_string buf "\n"
|
| '\n' -> Buffer.add_string buf "\\n"
|
||||||
| '\t' -> Buffer.add_string buf "\t"
|
| '\t' -> Buffer.add_string buf "\\t"
|
||||||
| c -> Buffer.add_char buf c);
|
| '\\' -> Buffer.add_string buf "\\\\"
|
||||||
|
| c -> Buffer.add_char buf c;
|
||||||
iterate (i + 1))
|
iterate (i + 1))
|
||||||
in
|
in
|
||||||
iterate 0;
|
iterate 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue