aboutsummaryrefslogtreecommitdiff
path: root/lux-bootstrapper
diff options
context:
space:
mode:
authorEduardo Julian2021-02-10 19:04:18 -0400
committerEduardo Julian2021-02-10 19:04:18 -0400
commita5e2f99430384fff580646a553b1e8ae27e07acd (patch)
tree185681c6b41cec359a20cbb094e33048cbec921b /lux-bootstrapper
parentd99c47989a1047cd24019fd5ce434e701b5d3519 (diff)
Continuing with Lua
Diffstat (limited to 'lux-bootstrapper')
-rw-r--r--lux-bootstrapper/src/lux/compiler/jvm/proc/common.clj12
1 files changed, 7 insertions, 5 deletions
diff --git a/lux-bootstrapper/src/lux/compiler/jvm/proc/common.clj b/lux-bootstrapper/src/lux/compiler/jvm/proc/common.clj
index ad01dfb31..f21557e88 100644
--- a/lux-bootstrapper/src/lux/compiler/jvm/proc/common.clj
+++ b/lux-bootstrapper/src/lux/compiler/jvm/proc/common.clj
@@ -234,19 +234,21 @@
(return nil)))
(defn compile-text-clip [compile ?values special-args]
- (|do [:let [(&/$Cons ?text (&/$Cons ?from (&/$Cons ?to (&/$Nil)))) ?values]
+ (|do [:let [(&/$Cons ?text (&/$Cons ?offset (&/$Cons ?length (&/$Nil)))) ?values]
^MethodVisitor *writer* &/get-writer
_ (compile ?text)
:let [_ (doto *writer*
(.visitTypeInsn Opcodes/CHECKCAST "java/lang/String"))]
- _ (compile ?from)
+ _ (compile ?offset)
:let [_ (doto *writer*
&&/unwrap-long
- (.visitInsn Opcodes/L2I))]
- _ (compile ?to)
+ (.visitInsn Opcodes/L2I)
+ (.visitInsn Opcodes/DUP))]
+ _ (compile ?length)
:let [_ (doto *writer*
&&/unwrap-long
- (.visitInsn Opcodes/L2I))]
+ (.visitInsn Opcodes/L2I)
+ (.visitInsn Opcodes/IADD))]
:let [_ (doto *writer*
(.visitMethodInsn Opcodes/INVOKEVIRTUAL "java/lang/String" "substring" "(II)Ljava/lang/String;"))]]
(return nil)))