aboutsummaryrefslogtreecommitdiff
path: root/new-luxc
diff options
context:
space:
mode:
authorEduardo Julian2018-07-11 22:21:23 -0400
committerEduardo Julian2018-07-11 22:21:23 -0400
commit81480739f4c5caa468b295eb047e5844d39701ca (patch)
treec0b95639cd9427f8ecf57220a38b413fb9845145 /new-luxc
parentf76922dfef6e88db854a27dc17987ccdc9736d6a (diff)
- Removed "lux text hash" extension.
Diffstat (limited to 'new-luxc')
-rw-r--r--new-luxc/source/luxc/lang/translation/common-lisp/procedure/common.jvm.lux1
-rw-r--r--new-luxc/source/luxc/lang/translation/js/procedure/common.jvm.lux2
-rw-r--r--new-luxc/source/luxc/lang/translation/js/runtime.jvm.lux12
-rw-r--r--new-luxc/source/luxc/lang/translation/jvm/procedure/common.jvm.lux2
-rw-r--r--new-luxc/source/luxc/lang/translation/lua/procedure/common.jvm.lux2
-rw-r--r--new-luxc/source/luxc/lang/translation/lua/runtime.jvm.lux12
-rw-r--r--new-luxc/source/luxc/lang/translation/php/procedure/common.jvm.lux1
-rw-r--r--new-luxc/source/luxc/lang/translation/python/procedure/common.jvm.lux1
-rw-r--r--new-luxc/source/luxc/lang/translation/r/procedure/common.jvm.lux1
-rw-r--r--new-luxc/source/luxc/lang/translation/r/runtime.jvm.lux16
-rw-r--r--new-luxc/source/luxc/lang/translation/ruby/procedure/common.jvm.lux2
-rw-r--r--new-luxc/test/test/luxc/lang/translation/common.lux10
12 files changed, 3 insertions, 59 deletions
diff --git a/new-luxc/source/luxc/lang/translation/common-lisp/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/common-lisp/procedure/common.jvm.lux
index e1ba0494a..8148bf0c6 100644
--- a/new-luxc/source/luxc/lang/translation/common-lisp/procedure/common.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/common-lisp/procedure/common.jvm.lux
@@ -311,7 +311,6 @@
(install "concat" (binary text//concat))
(install "index" (trinary text//index))
(install "size" (unary _.length))
- (install "hash" (unary _.sxhash/1))
(install "char" (binary text//char))
(install "clip" (trinary text//clip))
)))
diff --git a/new-luxc/source/luxc/lang/translation/js/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/js/procedure/common.jvm.lux
index cdaa22eee..a2b30390d 100644
--- a/new-luxc/source/luxc/lang/translation/js/procedure/common.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/js/procedure/common.jvm.lux
@@ -255,7 +255,6 @@
[int//to-frac runtimeT.int//to-number]
[frac//to-int runtimeT.int//from-number]
- [text//hash runtimeT.text//hash]
)
(def: (int//char inputJS)
@@ -440,7 +439,6 @@
(install "concat" (binary text//concat))
(install "index" (trinary text//index))
(install "size" (unary text//size))
- (install "hash" (unary text//hash))
(install "char" (binary text//char))
(install "clip" (trinary text//clip))
)))
diff --git a/new-luxc/source/luxc/lang/translation/js/runtime.jvm.lux b/new-luxc/source/luxc/lang/translation/js/runtime.jvm.lux
index 267a3e637..9840bba1f 100644
--- a/new-luxc/source/luxc/lang/translation/js/runtime.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/js/runtime.jvm.lux
@@ -591,21 +591,11 @@
"}")
"})"))
-(runtime: text//hash "textHash"
- (format "(function " @ "(input) {"
- "var hash = 0;"
- (format "for(var i = 0; i < input.length; i++) {"
- "hash = (((hash << 5) - hash) + input.charCodeAt(i)) & 0xFFFFFFFF;"
- "}")
- "return " int//from-number "(hash);"
- "})"))
-
(def: runtime//text
Runtime
(format __text//index
__text//clip
- __text//char
- __text//hash))
+ __text//char))
(runtime: array//get "arrayGet"
(format "(function " @ "(arr,idx) {"
diff --git a/new-luxc/source/luxc/lang/translation/jvm/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/procedure/common.jvm.lux
index 10b8cb75d..527ec4f2d 100644
--- a/new-luxc/source/luxc/lang/translation/jvm/procedure/common.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/jvm/procedure/common.jvm.lux
@@ -322,7 +322,6 @@
<post>))]
[text//size "java.lang.String" "length" lux-intI $t.int]
- [text//hash "java.lang.Object" "hashCode" lux-intI $t.int]
)
(do-template [<name> <pre-subject> <pre-param> <op> <post>]
@@ -583,7 +582,6 @@
(install "concat" (binary text//concat))
(install "index" (trinary text//index))
(install "size" (unary text//size))
- (install "hash" (unary text//hash))
(install "char" (binary text//char))
(install "clip" (trinary text//clip))
)))
diff --git a/new-luxc/source/luxc/lang/translation/lua/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/lua/procedure/common.jvm.lux
index 7497aeca2..c750bbaf4 100644
--- a/new-luxc/source/luxc/lang/translation/lua/procedure/common.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/lua/procedure/common.jvm.lux
@@ -255,7 +255,6 @@
(|> inputO <transform>))]
[frac//to-int (<| (lua.apply "math.floor") (list))]
- [text//hash runtimeT.text//hash]
)
(def: int//char
@@ -428,7 +427,6 @@
(install "concat" (binary text//concat))
(install "index" (trinary text//index))
(install "size" (unary text//size))
- (install "hash" (unary text//hash))
(install "char" (binary text//char))
(install "clip" (trinary text//clip))
)))
diff --git a/new-luxc/source/luxc/lang/translation/lua/runtime.jvm.lux b/new-luxc/source/luxc/lang/translation/lua/runtime.jvm.lux
index 9e7dc7422..2c0dfec17 100644
--- a/new-luxc/source/luxc/lang/translation/lua/runtime.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/lua/runtime.jvm.lux
@@ -207,21 +207,11 @@
(lua.return! none)
(lua.return! (some "char"))))))
-(runtime: (text//hash input)
- (lua.block! (list (lua.local! "hash" (#.Some (lua.int 0)))
- (lua.for-step! "idx" (lua.int 1) (lua.apply "string.len" (list input)) (lua.int 1)
- (lua.set! "hash" (|> "hash"
- (lua.bit-shl (lua.int 5))
- (lua.- "hash")
- (lua.+ (lua.apply "string.byte" (list input "idx"))))))
- (lua.return! "hash"))))
-
(def: runtime//text
Runtime
(format @@text//index
@@text//clip
- @@text//char
- @@text//hash))
+ @@text//char))
(def: (check-index-out-of-bounds array idx body!)
(-> Expression Expression Statement Statement)
diff --git a/new-luxc/source/luxc/lang/translation/php/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/php/procedure/common.jvm.lux
index 3f9825737..eea8682d3 100644
--- a/new-luxc/source/luxc/lang/translation/php/procedure/common.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/php/procedure/common.jvm.lux
@@ -323,7 +323,6 @@
## (install "concat" (binary text//concat))
## (install "index" (trinary text//index))
## (install "size" (unary (apply1 (_.global "len"))))
-## (install "hash" (unary (apply1 (_.global "hash"))))
## (install "char" (binary text//char))
## (install "clip" (trinary text//clip))
## )))
diff --git a/new-luxc/source/luxc/lang/translation/python/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/python/procedure/common.jvm.lux
index ea3d25687..2dece65c5 100644
--- a/new-luxc/source/luxc/lang/translation/python/procedure/common.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/python/procedure/common.jvm.lux
@@ -343,7 +343,6 @@
(install "concat" (binary text//concat))
(install "index" (trinary text//index))
(install "size" (unary (apply1 (python.global "len"))))
- (install "hash" (unary (apply1 (python.global "hash"))))
(install "char" (binary text//char))
(install "clip" (trinary text//clip))
)))
diff --git a/new-luxc/source/luxc/lang/translation/r/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/r/procedure/common.jvm.lux
index 2e6ea90e2..00f04e49f 100644
--- a/new-luxc/source/luxc/lang/translation/r/procedure/common.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/r/procedure/common.jvm.lux
@@ -325,7 +325,6 @@
(install "concat" (binary text//concat))
(install "index" (trinary text//index))
(install "size" (unary (|>> (apply1 (r.global "nchar")) runtimeT.int//from-float)))
- (install "hash" (unary runtimeT.text//hash))
(install "char" (binary text//char))
(install "clip" (trinary text//clip))
)))
diff --git a/new-luxc/source/luxc/lang/translation/r/runtime.jvm.lux b/new-luxc/source/luxc/lang/translation/r/runtime.jvm.lux
index 09bc9e7b0..9cab92115 100644
--- a/new-luxc/source/luxc/lang/translation/r/runtime.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/r/runtime.jvm.lux
@@ -720,26 +720,12 @@
(..some (int//from-float (char-at (@@ idx) (@@ text)))))
..none))
-(runtime: (text//hash input)
- (let [bits-32 (r.code "0xFFFFFFFF")]
- (with-vars [idx hash]
- ($_ r.then
- (r.set! hash (r.int 0))
- (r.for-in idx (r.range (r.int 1) (text-length (@@ input)))
- (r.set! hash (|> (@@ hash)
- (r.bit-shl (r.int 5))
- (r.- (@@ hash))
- (r.+ (char-at (@@ idx) (@@ input)))
- (r.bit-and bits-32))))
- (int//from-float (@@ hash))))))
-
(def: runtime//text
Runtime
($_ r.then
@@text//index
@@text//clip
- @@text//char
- @@text//hash))
+ @@text//char))
(def: (check-index-out-of-bounds array idx body)
(-> Expression Expression Expression Expression)
diff --git a/new-luxc/source/luxc/lang/translation/ruby/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/ruby/procedure/common.jvm.lux
index 01ca1e8b4..7100cf9a4 100644
--- a/new-luxc/source/luxc/lang/translation/ruby/procedure/common.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/ruby/procedure/common.jvm.lux
@@ -329,7 +329,6 @@
(ruby.send <op> (list)))]
[text//size "length"]
- [text//hash "hash"]
)
(def: (text//concat [subjectO paramO])
@@ -357,7 +356,6 @@
(install "concat" (binary text//concat))
(install "index" (trinary text//index))
(install "size" (unary text//size))
- (install "hash" (unary text//hash))
(install "char" (binary text//char))
(install "clip" (trinary text//clip))
)))
diff --git a/new-luxc/test/test/luxc/lang/translation/common.lux b/new-luxc/test/test/luxc/lang/translation/common.lux
index f933abe8d..0e2d66503 100644
--- a/new-luxc/test/test/luxc/lang/translation/common.lux
+++ b/new-luxc/test/test/luxc/lang/translation/common.lux
@@ -248,16 +248,6 @@
_
false))))
- (test "Text hashing is consistent."
- (|> (run (` ("lux int ="
- ("lux text hash" (~ sample0S))
- ("lux text hash" (~ sample0S)))))
- (case> (#e.Success valueV)
- (:coerce Bool valueV)
-
- (#e.Error error)
- (exec (log! error)
- false))))
(let [test-clip (function (_ from to expected)
(|> (run (` ("lux text clip"
(~ concatenatedS)