From 979049ae423b5f1aa194710b66ceb31581d39fd4 Mon Sep 17 00:00:00 2001 From: mappu Date: Wed, 15 Apr 2020 19:06:28 +1200 Subject: [PATCH] node: implement float literals --- node.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/node.go b/node.go index c49d2bf..638f974 100644 --- a/node.go +++ b/node.go @@ -1585,6 +1585,11 @@ func (this *conversionState) convertNoFreeFloating(n_ node.Node) (string, error) // case *scalar.Lnumber: + // Integer (maybe with 0b / 0x / '0' prefix) + return n.Value, nil // number formats are compatible + + case *scalar.Dnumber: + // Float (maybe with period / scientific notation) return n.Value, nil // number formats are compatible case *scalar.String: