diff options
author | metagn <metagngn@gmail.com> | 2024-09-27 07:11:21 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-27 06:11:21 +0200 |
commit | 1bd5a4a99ed3fc6a77c3f8927d2d2292203af328 (patch) | |
tree | 913e9d4133313b4ad6126db069cb486c43698fce /compiler | |
parent | a27542195c9ba760d58e9d1e977313bc322a1ede (diff) | |
download | Nim-1bd5a4a99ed3fc6a77c3f8927d2d2292203af328.tar.gz |
render float128 literals (#24182)
fixes #23639 Not sure if these are meant to be supported but it's better than crashing.
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/renderer.nim | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/renderer.nim b/compiler/renderer.nim index 19df22326..cc07c0c2d 100644 --- a/compiler/renderer.nim +++ b/compiler/renderer.nim @@ -442,6 +442,11 @@ proc atom(g: TSrcGen; n: PNode): string = result = $n.floatVal & "\'f64" else: result = litAux(g, n, (cast[ptr int64](addr(n.floatVal)))[], 8) & "\'f64" + of nkFloat128Lit: + if n.flags * {nfBase2, nfBase8, nfBase16} == {}: + result = $n.floatVal & "\'f128" + else: + result = litAux(g, n, (cast[ptr int64](addr(n.floatVal)))[], 8) & "\'f128" of nkNilLit: result = "nil" of nkType: if (n.typ != nil) and (n.typ.sym != nil): result = n.typ.sym.name.s |