aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--luxc/src/lux/analyser/proc/common.clj4
-rw-r--r--stdlib/source/lux.lux2
-rw-r--r--stdlib/source/lux/data/number/int.lux4
-rw-r--r--stdlib/source/lux/data/number/nat.lux2
-rw-r--r--stdlib/source/lux/data/number/rev.lux2
-rw-r--r--stdlib/source/lux/data/text.lux4
-rw-r--r--stdlib/source/lux/tool/compiler/default/syntax.lux2
-rw-r--r--stdlib/source/lux/tool/compiler/name.lux2
-rw-r--r--stdlib/source/test/lux/compiler/default/phase/analysis/procedure/common.lux2
9 files changed, 12 insertions, 12 deletions
diff --git a/luxc/src/lux/analyser/proc/common.clj b/luxc/src/lux/analyser/proc/common.clj
index 8f51521d8..cbe741a34 100644
--- a/luxc/src/lux/analyser/proc/common.clj
+++ b/luxc/src/lux/analyser/proc/common.clj
@@ -91,9 +91,9 @@
)
(defn- analyse-text-char [analyse exo-type ?values]
- (|do [:let [(&/$Cons text (&/$Cons idx (&/$Nil))) ?values]
- =text (&&/analyse-1 analyse &type/Text text)
+ (|do [:let [(&/$Cons idx (&/$Cons text (&/$Nil))) ?values]
=idx (&&/analyse-1 analyse &type/Nat idx)
+ =text (&&/analyse-1 analyse &type/Text text)
_ (&type/check exo-type &type/Nat)
_cursor &/cursor]
(return (&/|list (&&/|meta exo-type _cursor
diff --git a/stdlib/source/lux.lux b/stdlib/source/lux.lux
index 412169967..45b190c82 100644
--- a/stdlib/source/lux.lux
+++ b/stdlib/source/lux.lux
@@ -5999,7 +5999,7 @@
(case tokens
(^multi (^ (list [_ (#Text input)]))
(n/= 1 ("lux text size" input)))
- (|> ("lux text char" input 0)
+ (|> input ("lux text char" 0)
nat$ list
[compiler] #Right)
diff --git a/stdlib/source/lux/data/number/int.lux b/stdlib/source/lux/data/number/int.lux
index 9a2ce2b9b..f94049296 100644
--- a/stdlib/source/lux/data/number/int.lux
+++ b/stdlib/source/lux/data/number/int.lux
@@ -73,7 +73,7 @@
(def: (int;sign?? representation)
(-> Text (Maybe Int))
- (case ("lux text char" representation 0)
+ (case ("lux text char" 0 representation)
(^ (char "-"))
(#.Some -1)
@@ -88,7 +88,7 @@
(loop [idx 1
output +0]
(if (n/< input-size idx)
- (case (<to-value> ("lux text char" repr idx))
+ (case (<to-value> ("lux text char" idx repr))
#.None
(#error.Failure <error>)
diff --git a/stdlib/source/lux/data/number/nat.lux b/stdlib/source/lux/data/number/nat.lux
index fb47d2460..c1f0ca420 100644
--- a/stdlib/source/lux/data/number/nat.lux
+++ b/stdlib/source/lux/data/number/nat.lux
@@ -191,7 +191,7 @@
(loop [idx 0
output 0]
(if (n/< input-size idx)
- (case (<to-value> ("lux text char" repr idx))
+ (case (<to-value> ("lux text char" idx repr))
#.None
(#error.Failure ("lux text concat" <error> repr))
diff --git a/stdlib/source/lux/data/number/rev.lux b/stdlib/source/lux/data/number/rev.lux
index cb95efff4..bbb34c570 100644
--- a/stdlib/source/lux/data/number/rev.lux
+++ b/stdlib/source/lux/data/number/rev.lux
@@ -77,7 +77,7 @@
(def: (decode repr)
(let [repr-size ("lux text size" repr)]
(if (n/> 1 repr-size)
- (case ("lux text char" repr 0)
+ (case ("lux text char" 0 repr)
(^ (char "."))
(case (:: <codec> decode (de-prefix repr))
(#error.Success output)
diff --git a/stdlib/source/lux/data/text.lux b/stdlib/source/lux/data/text.lux
index cf13fd182..384d4e860 100644
--- a/stdlib/source/lux/data/text.lux
+++ b/stdlib/source/lux/data/text.lux
@@ -46,7 +46,7 @@
(def: #export (nth idx input)
(-> Nat Text (Maybe Char))
(if (n/< ("lux text size" input) idx)
- (#.Some ("lux text char" input idx))
+ (#.Some ("lux text char" idx input))
#.None))
(def: #export (index-of' pattern from input)
@@ -215,7 +215,7 @@
(|> hash
(i64.left-shift 5)
(n/- hash)
- (n/+ ("lux text char" input idx))))
+ (n/+ ("lux text char" idx input))))
hash)))))))
(def: #export concat
diff --git a/stdlib/source/lux/tool/compiler/default/syntax.lux b/stdlib/source/lux/tool/compiler/default/syntax.lux
index 8be32d7f2..512c19246 100644
--- a/stdlib/source/lux/tool/compiler/default/syntax.lux
+++ b/stdlib/source/lux/tool/compiler/default/syntax.lux
@@ -155,7 +155,7 @@
(template: (!with-char+ @source-code-size @source-code @offset @char @else @body)
(if (!i/< (:coerce Int @source-code-size)
(:coerce Int @offset))
- (let [@char ("lux text char" @source-code @offset)]
+ (let [@char ("lux text char" @offset @source-code)]
@body)
@else))
diff --git a/stdlib/source/lux/tool/compiler/name.lux b/stdlib/source/lux/tool/compiler/name.lux
index f65113d38..d2841d849 100644
--- a/stdlib/source/lux/tool/compiler/name.lux
+++ b/stdlib/source/lux/tool/compiler/name.lux
@@ -40,7 +40,7 @@
output ""]
(if (n/< name/size idx)
(recur (inc idx)
- (|> ("lux text char" name idx) !sanitize (format output)))
+ (|> name ("lux text char" idx) !sanitize (format output)))
output))))
(def: #export (definition [module short])
diff --git a/stdlib/source/test/lux/compiler/default/phase/analysis/procedure/common.lux b/stdlib/source/test/lux/compiler/default/phase/analysis/procedure/common.lux
index a4c4421d2..bf7de5cec 100644
--- a/stdlib/source/test/lux/compiler/default/phase/analysis/procedure/common.lux
+++ b/stdlib/source/test/lux/compiler/default/phase/analysis/procedure/common.lux
@@ -165,7 +165,7 @@
(test "Can query the size/length of a text."
(check-success+ "lux text size" (list subjectC) Nat))
(test "Can obtain the character code of a text at a given index."
- (check-success+ "lux text char" (list subjectC fromC) Nat))
+ (check-success+ "lux text char" (list fromC subjectC) Nat))
(test "Can clip a piece of text between 2 indices."
(check-success+ "lux text clip" (list fromC toC subjectC) Text))
))))