aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/spec/compositor/generation/common.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/spec/compositor/generation/common.lux')
-rw-r--r--stdlib/source/spec/compositor/generation/common.lux72
1 files changed, 36 insertions, 36 deletions
diff --git a/stdlib/source/spec/compositor/generation/common.lux b/stdlib/source/spec/compositor/generation/common.lux
index baa32674a..3d377b7ca 100644
--- a/stdlib/source/spec/compositor/generation/common.lux
+++ b/stdlib/source/spec/compositor/generation/common.lux
@@ -43,7 +43,7 @@
(synthesis.i64 subject)))
(run (..sanitize <extension>))
(case> (#try.Success valueT)
- (n.= (<reference> param subject) (:coerce Nat valueT))
+ (n.= (<reference> param subject) (:as Nat valueT))
(#try.Failure _)
false)
@@ -55,22 +55,22 @@
["lux i64 left-shift" i64.left-shift (n.% 64 param)]
["lux i64 logical-right-shift" i64.logic-right-shift (n.% 64 param)]
)]
- ($_ _.and
- <binary>
- (_.test "lux i64 arithmetic-right-shift"
- (|> (#synthesis.Extension "lux i64 arithmetic-right-shift"
- (list (synthesis.i64 subject)
- (synthesis.i64 param)))
- (run (..sanitize "lux i64 arithmetic-right-shift"))
- (case> (#try.Success valueT)
- ("lux i64 ="
- (i64.arithmetic-right-shift param subject)
- (:coerce I64 valueT))
-
- (#try.Failure _)
- false)
- (let [param (n.% 64 param)])))
- ))))
+ ($_ _.and
+ <binary>
+ (_.test "lux i64 arithmetic-right-shift"
+ (|> (#synthesis.Extension "lux i64 arithmetic-right-shift"
+ (list (synthesis.i64 subject)
+ (synthesis.i64 param)))
+ (run (..sanitize "lux i64 arithmetic-right-shift"))
+ (case> (#try.Success valueT)
+ ("lux i64 ="
+ (i64.arithmetic-right-shift param subject)
+ (:as I64 valueT))
+
+ (#try.Failure _)
+ false)
+ (let [param (n.% 64 param)])))
+ ))))
(def: (i64 run)
(-> Runner Test)
@@ -83,17 +83,17 @@
(|> (#synthesis.Extension <extension> (list (synthesis.i64 subject)))
(run (..sanitize <extension>))
(case> (#try.Success valueT)
- (<comp> (<prepare> subject) (:coerce <type> valueT))
+ (<comp> (<prepare> subject) (:as <type> valueT))
(#try.Failure _)
false)
(let [subject <subject-expr>])))]
["lux i64 f64" Frac i.frac f.= subject]
- ["lux i64 char" Text (|>> (:coerce Nat) text.from-code) text\= (|> subject
- (:coerce Nat)
- (n.% (i64.left-shift 8 1))
- (:coerce Int))]
+ ["lux i64 char" Text (|>> (:as Nat) text.from-code) text\= (|> subject
+ (:as Nat)
+ (n.% (i64.left-shift 8 1))
+ (:as Int))]
))
(~~ (template [<extension> <reference> <outputT> <comp>]
[(_.test <extension>
@@ -101,7 +101,7 @@
(synthesis.i64 subject)))
(run (..sanitize <extension>))
(case> (#try.Success valueT)
- (<comp> (<reference> param subject) (:coerce <outputT> valueT))
+ (<comp> (<reference> param subject) (:as <outputT> valueT))
(#try.Failure _)
false)))]
@@ -146,7 +146,7 @@
(run (..sanitize <extension>))
(case> (#try.Success valueV)
(bit\= (<text> param subject)
- (:coerce Bit valueV))
+ (:as Bit valueV))
_
false)))]
@@ -194,14 +194,14 @@
(and (|> (#synthesis.Extension "lux text =" (list sample-lowerS sample-lowerS))
(run (..sanitize "lux text ="))
(case> (#try.Success valueV)
- (:coerce Bit valueV)
+ (:as Bit valueV)
_
false))
(|> (#synthesis.Extension "lux text =" (list sample-upperS sample-lowerS))
(run (..sanitize "lux text ="))
(case> (#try.Success valueV)
- (not (:coerce Bit valueV))
+ (not (:as Bit valueV))
_
false))))
@@ -209,7 +209,7 @@
(|> (#synthesis.Extension "lux text <" (list sample-lowerS sample-upperS))
(run (..sanitize "lux text <"))
(case> (#try.Success valueV)
- (:coerce Bit valueV)
+ (:as Bit valueV)
(#try.Failure _)
false)))
@@ -217,7 +217,7 @@
(|> (#synthesis.Extension "lux text size" (list sample-lowerS))
(run (..sanitize "lux text size"))
(case> (#try.Success valueV)
- (n.= sample-size (:coerce Nat valueV))
+ (n.= sample-size (:as Nat valueV))
_
false)))
@@ -225,7 +225,7 @@
(|> (#synthesis.Extension "lux text size" (list concatenatedS))
(run (..sanitize "lux text size"))
(case> (#try.Success valueV)
- (n.= (n.* 2 sample-size) (:coerce Nat valueV))
+ (n.= (n.* 2 sample-size) (:as Nat valueV))
_
false)))
@@ -235,7 +235,7 @@
(synthesis.i64 +0)))
(run (..sanitize "lux text index"))
(case> (^multi (#try.Success valueV)
- [(:coerce (Maybe Nat) valueV) (#.Some valueV)])
+ [(:as (Maybe Nat) valueV) (#.Some valueV)])
(n.= 0 valueV)
_
@@ -245,7 +245,7 @@
(synthesis.i64 +0)))
(run (..sanitize "lux text index"))
(case> (^multi (#try.Success valueV)
- [(:coerce (Maybe Nat) valueV) (#.Some valueV)])
+ [(:as (Maybe Nat) valueV) (#.Some valueV)])
(n.= sample-size valueV)
_
@@ -258,7 +258,7 @@
(synthesis.i64 length)))
(run (..sanitize "lux text clip"))
(case> (^multi (#try.Success valueV)
- [(:coerce (Maybe Text) valueV) (#.Some valueV)])
+ [(:as (Maybe Text) valueV) (#.Some valueV)])
(text\= expected valueV)
_
@@ -272,7 +272,7 @@
(synthesis.i64 char-idx)))
(run (..sanitize "lux text char"))
(case> (^multi (#try.Success valueV)
- [(:coerce (Maybe Int) valueV) (#.Some valueV)])
+ [(:as (Maybe Int) valueV) (#.Some valueV)])
(text.contains? ("lux i64 char" valueV)
sample-lower)
@@ -303,7 +303,7 @@
(list (synthesis.text message)))})))
(run (..sanitize "lux try"))
(case> (^multi (#try.Success valueV)
- [(:coerce (Try Text) valueV) (#try.Failure error)])
+ [(:as (Try Text) valueV) (#try.Failure error)])
(text.contains? message error)
_
@@ -315,7 +315,7 @@
#synthesis.body (synthesis.text message)})))
(run (..sanitize "lux try"))
(case> (^multi (#try.Success valueV)
- [(:coerce (Try Text) valueV) (#try.Success valueV)])
+ [(:as (Try Text) valueV) (#try.Success valueV)])
(text\= message valueV)
_
@@ -325,7 +325,7 @@
(#synthesis.Extension "lux io current-time" (list))))
(run (..sanitize "lux io current-time"))
(case> (#try.Success valueV)
- (let [[pre post] (:coerce [Nat Nat] valueV)]
+ (let [[pre post] (:as [Nat Nat] valueV)]
(n.>= pre post))
(#try.Failure _)