summaryrefslogtreecommitdiff
path: root/lib/std/fmt.myr
diff options
context:
space:
mode:
Diffstat (limited to 'lib/std/fmt.myr')
-rw-r--r--lib/std/fmt.myr25
1 files changed, 23 insertions, 2 deletions
diff --git a/lib/std/fmt.myr b/lib/std/fmt.myr
index 60a9411..540d6d8 100644
--- a/lib/std/fmt.myr
+++ b/lib/std/fmt.myr
@@ -315,10 +315,10 @@ const fallbackfmt = {sb, params, tyenc, ap : valist# -> void
intfmt(sb, intparams(params), false, (val : uint64), 64)
| `Tyflt32:
var val : flt32 = vanext(ap)
- flt32bfmt(sb, val, MNormal, 0)
+ flt32bfmt(sb, fltparams(params), val)
| `Tyflt64:
var val : flt64 = vanext(ap)
- flt64bfmt(sb, val, MNormal, 0)
+ flt64bfmt(sb, fltparams(params), val)
| `Tyvalist:
sbputs(sb, "...")
@@ -448,6 +448,27 @@ const fmtslice = {sb, subap, params
;;
}
+const fltparams = {params
+ var fp : fltparams
+
+ fp = [
+ .mode = MNormal,
+ .prec = 0,
+ ]
+
+ for p : params
+ match p
+ | (opt, arg):
+ std.write(2, "fmt: ")
+ std.write(2, opt)
+ std.write(2, "arg: ")
+ std.write(2, arg)
+ std.die("\nunreachable\n")
+ ;;
+ ;;
+ -> fp
+}
+
type intparams = struct
base : size
padto : size