aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/translation/ruby
diff options
context:
space:
mode:
authorEduardo Julian2018-05-06 03:30:47 -0400
committerEduardo Julian2018-05-06 03:30:47 -0400
commite65e734e5df3746ffb7df2cc9fa33826e0083fcd (patch)
treec67b1105a4b421d527804ccbfcab4d29ec20e744 /new-luxc/source/luxc/lang/translation/ruby
parentf5a6fe62a612c0727063fa9e530d53ddda5fcd82 (diff)
- Re-named shift-left -> left-shift, shift-right -> logical-right-shift, signed-shift-right -> arithmetic-right-shift.
Diffstat (limited to '')
-rw-r--r--new-luxc/source/luxc/lang/translation/ruby/procedure/common.jvm.lux12
-rw-r--r--new-luxc/source/luxc/lang/translation/ruby/runtime.jvm.lux12
2 files changed, 12 insertions, 12 deletions
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 ccd2699ce..a13dae50b 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
@@ -160,7 +160,7 @@
[bit//xor ruby.bit-xor]
)
-(def: (bit//shift-left [subjectO paramO])
+(def: (bit//left-shift [subjectO paramO])
Binary
(ruby.bit-and "0xFFFFFFFFFFFFFFFF"
(ruby.bit-shl paramO subjectO)))
@@ -170,8 +170,8 @@
Binary
(<op> paramO subjectO))]
- [bit//shift-right ruby.bit-shr]
- [bit//unsigned-shift-right runtimeT.bit//shift-right]
+ [bit//arithmetic-right-shift ruby.bit-shr]
+ [bit//logical-right-shift runtimeT.bit//logical-right-shift]
)
(def: bit//count
@@ -186,9 +186,9 @@
(install "and" (binary bit//and))
(install "or" (binary bit//or))
(install "xor" (binary bit//xor))
- (install "shift-left" (binary bit//shift-left))
- (install "unsigned-shift-right" (binary bit//unsigned-shift-right))
- (install "shift-right" (binary bit//shift-right))
+ (install "left-shift" (binary bit//left-shift))
+ (install "logical-right-shift" (binary bit//logical-right-shift))
+ (install "arithmetic-right-shift" (binary bit//arithmetic-right-shift))
)))
## [[Arrays]]
diff --git a/new-luxc/source/luxc/lang/translation/ruby/runtime.jvm.lux b/new-luxc/source/luxc/lang/translation/ruby/runtime.jvm.lux
index 1e1e4c53a..c3f2981e1 100644
--- a/new-luxc/source/luxc/lang/translation/ruby/runtime.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/ruby/runtime.jvm.lux
@@ -165,7 +165,7 @@
(ruby.set! (list subject) (ruby./ (ruby.int 2) subject)))))
(ruby.return! "count"))))
-(runtime: (bit//shift-right param subject)
+(runtime: (bit//logical-right-shift param subject)
(let [mask (|> (ruby.int 1)
(ruby.bit-shl (ruby.- param (ruby.int 64)))
(ruby.- (ruby.int 1)))]
@@ -176,9 +176,9 @@
(def: runtime//bit
Runtime
(format @@bit//count
- @@bit//shift-right))
+ @@bit//logical-right-shift))
-(def: high (-> Expression Expression) (bit//shift-right (ruby.int 32)))
+(def: high (-> Expression Expression) (bit//logical-right-shift (ruby.int 32)))
(def: low (-> Expression Expression) (ruby.bit-and "0xFFFFFFFF"))
(runtime: (nat//< param subject)
@@ -220,8 +220,8 @@
(ruby.set! (list "sH") (high subject))
(ruby.set! (list "pL") (low param))
(ruby.set! (list "pH") (high param))
- (ruby.set! (list "bottom") (bit//shift-right (ruby.int 32)
- (ruby.* "pL" "sL")))
+ (ruby.set! (list "bottom") (bit//logical-right-shift (ruby.int 32)
+ (ruby.* "pL" "sL")))
(ruby.set! (list "middle") (ruby.+ (ruby.* "pL" "sH")
(ruby.* "pH" "sL")))
(ruby.set! (list "top") (ruby.* "pH" "sH"))
@@ -234,7 +234,7 @@
(ruby.block! (list (ruby.set! (list "zeroes") (ruby.int 64))
(ruby.while! (ruby.not (ruby.= (ruby.int 0) input))
(ruby.block! (list (ruby.set! (list "zeroes") (ruby.- (ruby.int 1) "zeroes"))
- (ruby.set! (list input) (bit//shift-right (ruby.int 1) input)))))
+ (ruby.set! (list input) (bit//logical-right-shift (ruby.int 1) input)))))
(ruby.return! "zeroes"))))
(runtime: (deg/// param subject)