From 85239d2c294a28b45f46f0b1333d161a403270f6 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sat, 10 Aug 2019 23:46:33 -0400 Subject: Got the new compiler working again. --- new-luxc/source/luxc/lang/host/jvm/def.lux | 26 ++++++++++++++------------ new-luxc/source/luxc/lang/host/jvm/inst.lux | 11 ++++++----- 2 files changed, 20 insertions(+), 17 deletions(-) (limited to 'new-luxc/source/luxc/lang/host/jvm') diff --git a/new-luxc/source/luxc/lang/host/jvm/def.lux b/new-luxc/source/luxc/lang/host/jvm/def.lux index 4d1b99da0..138098929 100644 --- a/new-luxc/source/luxc/lang/host/jvm/def.lux +++ b/new-luxc/source/luxc/lang/host/jvm/def.lux @@ -4,9 +4,11 @@ [control ["." function]] [data - ["." text - format] ["." product] + [number + ["i" int]] + ["." text + ["%" format (#+ format)]] [collection ["." array (#+ Array)] ["." list ("#/." functor)]]] @@ -126,12 +128,12 @@ (def: (class-flags config) (-> //.Class-Config Int) - ($_ i/+ + ($_ i.+ (if (get@ #//.finalC config) (Opcodes::ACC_FINAL) +0))) (def: (method-flags config) (-> //.Method-Config Int) - ($_ i/+ + ($_ i.+ (if (get@ #//.staticM config) (Opcodes::ACC_STATIC) +0) (if (get@ #//.finalM config) (Opcodes::ACC_FINAL) +0) (if (get@ #//.synchronizedM config) (Opcodes::ACC_SYNCHRONIZED) +0) @@ -139,7 +141,7 @@ (def: (field-flags config) (-> //.Field-Config Int) - ($_ i/+ + ($_ i.+ (if (get@ #//.staticF config) (Opcodes::ACC_STATIC) +0) (if (get@ #//.finalF config) (Opcodes::ACC_FINAL) +0) (if (get@ #//.transientF config) (Opcodes::ACC_TRANSIENT) +0) @@ -179,7 +181,7 @@ (def: class-computes Int - ($_ i/+ + ($_ i.+ (ClassWriter::COMPUTE_MAXS) ## (ClassWriter::COMPUTE_FRAMES) )) @@ -191,7 +193,7 @@ (host.type [byte])) (let [writer (|> (do-to (ClassWriter::new class-computes) (ClassWriter::visit (version-flag version) - ($_ i/+ + ($_ i.+ (Opcodes::ACC_SUPER) (visibility-flag visibility) @@ -218,7 +220,7 @@ (host.type [byte])) (let [writer (|> (do-to (ClassWriter::new class-computes) (ClassWriter::visit (version-flag version) - ($_ i/+ + ($_ i.+ (Opcodes::ACC_SUPER) (Opcodes::ACC_INTERFACE) (visibility-flag visibility) @@ -237,7 +239,7 @@ (-> //.Visibility //.Method-Config Text Method //.Inst //.Def) (function (_ writer) - (let [=method (ClassWriter::visitMethod ($_ i/+ + (let [=method (ClassWriter::visitMethod ($_ i.+ (visibility-flag visibility) (method-flags config)) ($t.binary-name name) @@ -255,7 +257,7 @@ (-> //.Visibility //.Method-Config Text Method //.Def) (function (_ writer) - (let [=method (ClassWriter::visitMethod ($_ i/+ + (let [=method (ClassWriter::visitMethod ($_ i.+ (visibility-flag visibility) (method-flags config) (Opcodes::ACC_ABSTRACT)) @@ -270,7 +272,7 @@ (def: #export (field visibility config name type) (-> //.Visibility //.Field-Config Text Type //.Def) (function (_ writer) - (let [=field (do-to (ClassWriter::visitField ($_ i/+ + (let [=field (do-to (ClassWriter::visitField ($_ i.+ (visibility-flag visibility) (field-flags config)) ($t.binary-name name) @@ -285,7 +287,7 @@ [(def: #export ( visibility config name value) (-> //.Visibility //.Field-Config Text //.Def) (function (_ writer) - (let [=field (do-to (ClassWriter::visitField ($_ i/+ + (let [=field (do-to (ClassWriter::visitField ($_ i.+ (visibility-flag visibility) (field-flags config)) ($t.binary-name name) diff --git a/new-luxc/source/luxc/lang/host/jvm/inst.lux b/new-luxc/source/luxc/lang/host/jvm/inst.lux index 35f779799..fcf28d4a7 100644 --- a/new-luxc/source/luxc/lang/host/jvm/inst.lux +++ b/new-luxc/source/luxc/lang/host/jvm/inst.lux @@ -11,8 +11,9 @@ ["." product] ["." maybe] ["." error] - [text - format] + [number + ["n" nat] + ["i" int]] [collection ["." list ("#@." functor)]]] [macro @@ -305,13 +306,13 @@ (-> //.Label (List [Int //.Label]) Inst) (function (_ visitor) (let [keys+labels (list.sort (function (_ left right) - (i/< (product.left left) (product.left right))) + (i.< (product.left left) (product.left right))) keys+labels) array-size (list.size keys+labels) keys-array (host.array int array-size) labels-array (host.array org/objectweb/asm/Label array-size) _ (loop [idx 0] - (if (n/< array-size idx) + (if (n.< array-size idx) (let [[key label] (maybe.assume (list.nth idx keys+labels))] (exec (host.array-write idx (host.long-to-int key) keys-array) @@ -327,7 +328,7 @@ (let [num-labels (list.size labels) labels-array (host.array org/objectweb/asm/Label num-labels) _ (loop [idx 0] - (if (n/< num-labels idx) + (if (n.< num-labels idx) (exec (host.array-write idx (maybe.assume (list.nth idx labels)) labels-array) -- cgit v1.2.3