From a5e2f99430384fff580646a553b1e8ae27e07acd Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Wed, 10 Feb 2021 19:04:18 -0400 Subject: Continuing with Lua --- lux-bootstrapper/src/lux/compiler/jvm/proc/common.clj | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'lux-bootstrapper/src') 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))) -- cgit v1.2.3