summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authormetagn <metagngn@gmail.com>2024-09-27 07:11:21 +0300
committerGitHub <noreply@github.com>2024-09-27 06:11:21 +0200
commit1bd5a4a99ed3fc6a77c3f8927d2d2292203af328 (patch)
tree913e9d4133313b4ad6126db069cb486c43698fce /compiler
parenta27542195c9ba760d58e9d1e977313bc322a1ede (diff)
downloadNim-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.nim5
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