aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/translation/jvm/procedure
diff options
context:
space:
mode:
authorEduardo Julian2018-04-06 08:32:41 -0400
committerEduardo Julian2018-04-06 08:32:41 -0400
commitca238f9c89d3156842b0a3d5fe24a5d69b2eedb0 (patch)
tree50ba106541f2357daf27393df28e8b263f7311e1 /new-luxc/source/luxc/lang/translation/jvm/procedure
parent84d7e87817cd2c074653b34d028c8fa807febc7f (diff)
- Adapted new-luxc's code to latest stdlib changes.
Diffstat (limited to 'new-luxc/source/luxc/lang/translation/jvm/procedure')
-rw-r--r--new-luxc/source/luxc/lang/translation/jvm/procedure/common.jvm.lux38
-rw-r--r--new-luxc/source/luxc/lang/translation/jvm/procedure/host.jvm.lux25
2 files changed, 35 insertions, 28 deletions
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 abd2d49c8..158d4c788 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
@@ -72,7 +72,7 @@
(-> Text Bundle Bundle)
(|> bundle
dict.entries
- (list/map (function [[key val]] [(format prefix " " key) val]))
+ (list/map (function (_ [key val]) [(format prefix " " key) val]))
(dict.from-list text.Hash<Text>)))
(def: (wrong-arity proc expected actual)
@@ -82,19 +82,19 @@
" Actual: " (|> actual nat-to-int %i)))
(syntax: (arity: [name s.local-symbol] [arity s.nat])
- (with-gensyms [g!proc g!name g!translate g!inputs]
+ (with-gensyms [g!_ g!proc g!name g!translate g!inputs]
(do @
[g!input+ (monad.seq @ (list.repeat arity (macro.gensym "input")))]
(wrap (list (` (def: #export ((~ (code.local-symbol name)) (~ g!proc))
(-> (-> (..Vector (~ (code.nat arity)) $.Inst) $.Inst)
(-> Text ..Proc))
- (function [(~ g!name)]
- (function [(~ g!translate) (~ g!inputs)]
+ (function ((~ g!_) (~ g!name))
+ (function ((~ g!_) (~ g!translate) (~ g!inputs))
(case (~ g!inputs)
(^ (list (~+ g!input+)))
(do macro.Monad<Meta>
[(~+ (|> g!input+
- (list/map (function [g!input]
+ (list/map (function (_ g!input)
(list g!input (` ((~ g!translate) (~ g!input))))))
list.concat))]
((~' wrap) ((~ g!proc) [(~+ g!input+)])))
@@ -109,8 +109,8 @@
(def: #export (variadic proc)
(-> Variadic (-> Text Proc))
- (function [proc-name]
- (function [translate inputsS]
+ (function (_ proc-name)
+ (function (_ translate inputsS)
(do macro.Monad<Meta>
[inputsI (monad.map @ translate inputsS)]
(wrap (proc inputsI))))))
@@ -131,8 +131,8 @@
(def: (predicateI tester)
(-> (-> $.Label $.Inst)
$.Inst)
- (<| $i.with-label (function [@then])
- $i.with-label (function [@end])
+ (<| $i.with-label (function (_ @then))
+ $i.with-label (function (_ @end))
(|>> (tester @then)
($i.GETSTATIC "java.lang.Boolean" "FALSE" ($t.class "java.lang.Boolean" (list)))
($i.GOTO @end)
@@ -167,7 +167,9 @@
Unary
valueI)
-(exception: #export Wrong-Syntax)
+(exception: #export (Wrong-Syntax {message Text})
+ message)
+
(def: #export (wrong-syntax procedure args)
(-> Text (List ls.Synthesis) Text)
(format "Procedure: " procedure "\n"
@@ -175,8 +177,8 @@
(def: lux//loop
(-> Text Proc)
- (function [proc-name]
- (function [translate inputsS]
+ (function (_ proc-name)
+ (function (_ translate inputsS)
(case (s.run inputsS ($_ p.seq s.nat (s.tuple (p.many s.any)) s.any))
(#e.Success [offset initsS+ bodyS])
(loopT.translate-loop translate offset initsS+ bodyS)
@@ -187,8 +189,8 @@
(def: lux//recur
(-> Text Proc)
- (function [proc-name]
- (function [translate inputsS]
+ (function (_ proc-name)
+ (function (_ translate inputsS)
(loopT.translate-recur translate inputsS))))
## [[Bits]]
@@ -230,8 +232,8 @@
(def: (array//get [arrayI idxI])
Binary
- (<| $i.with-label (function [@is-null])
- $i.with-label (function [@end])
+ (<| $i.with-label (function (_ @is-null))
+ $i.with-label (function (_ @end))
(|>> arrayI ($i.CHECKCAST ($t.descriptor $Object-Array))
idxI jvm-intI
$i.AALOAD
@@ -435,8 +437,8 @@
(def: index-method $.Method ($t.method (list $String $t.int) (#.Some $t.int) (list)))
(def: (text//index [textI partI startI])
Trinary
- (<| $i.with-label (function [@not-found])
- $i.with-label (function [@end])
+ (<| $i.with-label (function (_ @not-found))
+ $i.with-label (function (_ @end))
(|>> textI ($i.CHECKCAST "java.lang.String")
partI ($i.CHECKCAST "java.lang.String")
startI jvm-intI
diff --git a/new-luxc/source/luxc/lang/translation/jvm/procedure/host.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/procedure/host.jvm.lux
index 609a0833c..f8461be45 100644
--- a/new-luxc/source/luxc/lang/translation/jvm/procedure/host.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/jvm/procedure/host.jvm.lux
@@ -25,8 +25,13 @@
["ls" synthesis]))
(// ["@" common]))
-(exception: #export Invalid-Syntax-For-JVM-Type)
-(exception: #export Invalid-Syntax-For-Argument-Generation)
+(do-template [<name>]
+ [(exception: #export (<name> {message Text})
+ message)]
+
+ [Invalid-Syntax-For-JVM-Type]
+ [Invalid-Syntax-For-Argument-Generation]
+ )
(do-template [<name> <inst>]
[(def: <name>
@@ -41,7 +46,7 @@
(do-template [<name> <unwrap> <conversion> <wrap>]
[(def: (<name> inputI)
@.Unary
- (if (is $i.NOP <conversion>)
+ (if (is? $i.NOP <conversion>)
(|>> inputI
($i.unwrap <unwrap>)
($i.wrap <wrap>))
@@ -153,8 +158,8 @@
(do-template [<name> <op> <unwrapX> <unwrapY> <wrap>]
[(def: (<name> [xI yI])
@.Binary
- (<| $i.with-label (function [@then])
- $i.with-label (function [@end])
+ (<| $i.with-label (function (_ @then))
+ $i.with-label (function (_ @end))
(|>> xI ($i.unwrap <unwrapX>)
yI ($i.unwrap <unwrapY>)
(<op> @then)
@@ -174,8 +179,8 @@
(do-template [<name> <op> <reference> <unwrapX> <unwrapY> <wrap>]
[(def: (<name> [xI yI])
@.Binary
- (<| $i.with-label (function [@then])
- $i.with-label (function [@end])
+ (<| $i.with-label (function (_ @then))
+ $i.with-label (function (_ @end))
(|>> xI ($i.unwrap <unwrapX>)
yI ($i.unwrap <unwrapY>)
<op>
@@ -371,8 +376,8 @@
(def: (object//null? objectI)
@.Unary
- (<| $i.with-label (function [@then])
- $i.with-label (function [@end])
+ (<| $i.with-label (function (_ @then))
+ $i.with-label (function (_ @end))
(|>> objectI
($i.IFNULL @then)
($i.GETSTATIC "java.lang.Boolean" "FALSE" ($t.class "java.lang.Boolean" (list)))
@@ -616,7 +621,7 @@
(p.after (l.this "float") (parser/wrap $t.float))
(p.after (l.this "double") (parser/wrap $t.double))
(p.after (l.this "char") (parser/wrap $t.char))
- (parser/map (function [name]
+ (parser/map (function (_ name)
($t.class name (list)))
(l.many (l.none-of "[")))
))