From bbf5fb06275b3eef9c9209713e1d667b41d8ec47 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Mon, 20 Aug 2018 18:53:08 -0400 Subject: Fixed syntax bug. --- stdlib/source/lux/compiler/default/syntax.lux | 2 +- stdlib/source/lux/data/number.lux | 4 ++-- stdlib/test/test/lux/compiler/default/syntax.lux | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/stdlib/source/lux/compiler/default/syntax.lux b/stdlib/source/lux/compiler/default/syntax.lux index 7556e7e46..5f2d6d93b 100644 --- a/stdlib/source/lux/compiler/default/syntax.lux +++ b/stdlib/source/lux/compiler/default/syntax.lux @@ -614,8 +614,8 @@ (..record where ast') (..text where) (..nat where) - (..int where) (..frac where) + (..int where) (..rev where) (..bit where) (..identifier current-module aliases where) diff --git a/stdlib/source/lux/data/number.lux b/stdlib/source/lux/data/number.lux index a1303f848..4b3b786b4 100644 --- a/stdlib/source/lux/data/number.lux +++ b/stdlib/source/lux/data/number.lux @@ -646,12 +646,12 @@ +1.0)] (case ("lux text index" repr "." 0) (#.Some split-index) - (let [whole-part (maybe.assume ("lux text clip" repr (if (f/= -1.0 sign) 1 0) split-index)) + (let [whole-part (maybe.assume ("lux text clip" repr 1 split-index)) decimal-part (maybe.assume ("lux text clip" repr (inc split-index) ("lux text size" repr))) as-binary (|> ( decimal-part) ("lux text concat" ".") ("lux text concat" ( whole-part)) - ("lux text concat" (if (f/= -1.0 sign) "-" "")))] + ("lux text concat" (if (f/= -1.0 sign) "-" "+")))] (case (:: Binary@Codec decode as-binary) (#error.Error _) (#error.Error ("lux text concat" repr)) diff --git a/stdlib/test/test/lux/compiler/default/syntax.lux b/stdlib/test/test/lux/compiler/default/syntax.lux index e52a6ea02..2b4a8f5b6 100644 --- a/stdlib/test/test/lux/compiler/default/syntax.lux +++ b/stdlib/test/test/lux/compiler/default/syntax.lux @@ -3,7 +3,6 @@ [control [monad (#+ do)]] [data - [number] ["e" error] ["." text format @@ -123,7 +122,7 @@ (test "Can parse frac ratio syntax." (case (&.read "" (dict.new text.Hash) [default-cursor 0 - (format (if signed? "-" "") + (format (if signed? "-" "+") (%i (frac-to-int numerator)) "/" (%i (frac-to-int denominator)))]) -- cgit v1.2.3