From 81480739f4c5caa468b295eb047e5844d39701ca Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Wed, 11 Jul 2018 22:21:23 -0400 Subject: - Removed "lux text hash" extension. --- .../translation/common-lisp/procedure/common.jvm.lux | 1 - .../luxc/lang/translation/js/procedure/common.jvm.lux | 2 -- new-luxc/source/luxc/lang/translation/js/runtime.jvm.lux | 12 +----------- .../luxc/lang/translation/jvm/procedure/common.jvm.lux | 2 -- .../luxc/lang/translation/lua/procedure/common.jvm.lux | 2 -- .../source/luxc/lang/translation/lua/runtime.jvm.lux | 12 +----------- .../luxc/lang/translation/php/procedure/common.jvm.lux | 1 - .../lang/translation/python/procedure/common.jvm.lux | 1 - .../luxc/lang/translation/r/procedure/common.jvm.lux | 1 - new-luxc/source/luxc/lang/translation/r/runtime.jvm.lux | 16 +--------------- .../luxc/lang/translation/ruby/procedure/common.jvm.lux | 2 -- 11 files changed, 3 insertions(+), 49 deletions(-) (limited to 'new-luxc/source/luxc/lang') 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 @@ ))] [text//size "java.lang.String" "length" lux-intI $t.int] - [text//hash "java.lang.Object" "hashCode" lux-intI $t.int] ) (do-template [ ] @@ -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 ))] [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 (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)) ))) -- cgit v1.2.3