Fix q format spec (#1811)

This commit is contained in:
Rangi
2025-08-29 14:23:49 -04:00
committed by GitHub
parent 02b880e1b0
commit 85176ef10a
5 changed files with 16 additions and 7 deletions

View File

@@ -2,7 +2,7 @@ println STRFMT("%+d %++d", 42, 42)
println STRFMT("%#x %##x", 42, 42)
println STRFMT("%-4d %--4d", 42, 42)
println STRFMT("%.f %..f", 42.0, 42.0)
println STRFMT("%qf %q.16f", 42.0, 42.0)
println STRFMT("%qf %q.16f %qq16f", 42.0, 42.0, 42.0)
DEF N = 42
println "{5d:N} {5d5:N}"

View File

@@ -10,6 +10,8 @@ error: Fixed-point constant precision 0 invalid, defaulting to 16
at invalid-format.asm(5)
error: STRFMT: Invalid format spec for argument 2
at invalid-format.asm(5)
error: STRFMT: Invalid format spec for argument 3
at invalid-format.asm(5)
error: Invalid format spec "5d5"
at invalid-format.asm(8)
error: Invalid format spec "xx"
@@ -28,4 +30,4 @@ error: Formatting type 'd' with fractional width
at invalid-format.asm(17)
error: Formatting type 'd' with fractional precision
at invalid-format.asm(18)
Assembly aborted with 15 errors!
Assembly aborted with 16 errors!

View File

@@ -2,7 +2,7 @@
$2a %x
42 %4d
42 %f
42.00000 %16f
42.00000 %16f %16f
42 42
2a 2a
hello