ref: 8aa9484a3ca94a08d42c5847db65edc011a42565
parent: 58582ade1b9641b0231052603372d08b77946852
author: Ori Bernstein <[email protected]>
date: Sun Aug 5 22:37:56 EDT 2012
Use octal escape codes. Fuck you, GAS. We can't use hex escape codes for two reasons: 1) OSX GAS doesn't support it 2) GAS decodes the hex value greedily, so if the next character in the string happens to be a hex digit, it gets gobbled up, and in the process makes the byte's value wrong.
--- a/test.myr
+++ b/test.myr
@@ -40,6 +40,8 @@
std.write(1, "Alpha\n")
elif std.isnum(c)
std.write(1, "Num\n")
+ else
+ std.write(1, "Dunno\n")
;;
if !std.encode(c, buf[0,std.charlen(c)])
std.write(1, "couldn't encode\n")
@@ -46,5 +48,8 @@
;;
std.write(1, buf[0,std.charlen(c)])
std.write(1, "\n")
+ ;;
+ if !std.encode(-1, buf[0,3])
+ std.write(1, "couldn't encode\n")
;;
}