ref: 1a46ea4e36b58f739a1ca0d492a78f488712334f
parent: 5ec2c38d36f593ebbe4eb0da31b7537455f1f175
author: Ori Bernstein <ori@eigenstate.org>
date: Mon Feb 8 14:36:20 EST 2016
Add support for unescaped raw strings.
--- a/lib/std/fmt.myr
+++ b/lib/std/fmt.myr
@@ -476,12 +476,13 @@
| _: std.die("unreachable")
;;
;;
- iassert(!raw || !esc == false, "raw and excaped strings conflict\n")
iassert(p >= 0, "pad must be >= 0")
std.slfree(opts)
if raw
for b in str
- sbputs(sb, "\\x")
+ if esc
+ sbputs(sb, "\\x")
+ ;;
intfmt(sb, [.padto=2, .padfill='0', .base=16], false, b)
;;
elif esc