From 17629d66062b88b040a2397032f6c08361a5f3a7 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Thu, 12 Aug 2021 03:12:42 -0400 Subject: Improved binding syntax for "syntax:". --- lux-jvm/source/luxc/lang/directive/jvm.lux | 8 ++++---- lux-jvm/source/luxc/lang/host/jvm.lux | 8 ++++---- lux-jvm/source/luxc/lang/host/jvm/inst.lux | 2 +- lux-jvm/source/luxc/lang/synthesis/variable.lux | 8 ++++---- lux-jvm/source/luxc/lang/translation/jvm/function.lux | 2 +- lux-jvm/test/test/luxc/lang/synthesis/loop.lux | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) (limited to 'lux-jvm') diff --git a/lux-jvm/source/luxc/lang/directive/jvm.lux b/lux-jvm/source/luxc/lang/directive/jvm.lux index fa8b1420e..bc038bc92 100644 --- a/lux-jvm/source/luxc/lang/directive/jvm.lux +++ b/lux-jvm/source/luxc/lang/directive/jvm.lux @@ -426,7 +426,7 @@ #.None (let [label' (org/objectweb/asm/Label::new)] - [(dictionary.put label label' mapping) label']))) + [(dictionary.has label label' mapping) label']))) (def: (relabel_branching [mapping instruction]) (Re_labeler /.Branching) @@ -1477,6 +1477,6 @@ (def: .public (bundle class_loader extender) (-> java/lang/ClassLoader jvm.Extender (directive.Bundle jvm.Anchor jvm.Inst jvm.Definition)) (|> bundle.empty - (dictionary.put "lux def generation" (..def::generation extender)) - (dictionary.put "jvm class" (..jvm::class class_loader)) - (dictionary.put "jvm class interface" ..jvm::class::interface))) + (dictionary.has "lux def generation" (..def::generation extender)) + (dictionary.has "jvm class" (..jvm::class class_loader)) + (dictionary.has "jvm class interface" ..jvm::class::interface))) diff --git a/lux-jvm/source/luxc/lang/host/jvm.lux b/lux-jvm/source/luxc/lang/host/jvm.lux index a9b73c8b0..6ce7badc5 100644 --- a/lux-jvm/source/luxc/lang/host/jvm.lux +++ b/lux-jvm/source/luxc/lang/host/jvm.lux @@ -88,10 +88,10 @@ (type: .public (Generator i) (-> Phase Archive i (Operation Inst))) -(syntax: (config: {type .local_identifier} - {none .local_identifier} - {++ .local_identifier} - {options (.tuple (<>.many .local_identifier))}) +(syntax: (config: [type .local_identifier + none .local_identifier + ++ .local_identifier + options (.tuple (<>.many .local_identifier))]) (let [g!type (code.local_identifier type) g!none (code.local_identifier none) g!tags+ (list/map code.local_tag options) diff --git a/lux-jvm/source/luxc/lang/host/jvm/inst.lux b/lux-jvm/source/luxc/lang/host/jvm/inst.lux index 7229babab..90732578e 100644 --- a/lux-jvm/source/luxc/lang/host/jvm/inst.lux +++ b/lux-jvm/source/luxc/lang/host/jvm/inst.lux @@ -44,7 +44,7 @@ (import: java/lang/Object) (import: java/lang/String) -(syntax: (declare {codes (p.many s.local_identifier)}) +(syntax: (declare [codes (p.many s.local_identifier)]) (|> codes (list@map (function (_ code) (` ((~' #static) (~ (code.local_identifier code)) (~' int))))) in)) diff --git a/lux-jvm/source/luxc/lang/synthesis/variable.lux b/lux-jvm/source/luxc/lang/synthesis/variable.lux index 11fbaae51..4721187f8 100644 --- a/lux-jvm/source/luxc/lang/synthesis/variable.lux +++ b/lux-jvm/source/luxc/lang/synthesis/variable.lux @@ -47,11 +47,11 @@ (def: (unused-vars current-arity bound exprS) (-> ls.Arity (List Variable) ls.Synthesis (List Variable)) (let [tracker (loop [exprS exprS - tracker (list/fold s.add init-tracker bound)] + tracker (list/fold s.has init-tracker bound)] (case exprS (#ls.Variable var) (if (non-arg? current-arity var) - (s.remove var tracker) + (s.lacks var tracker) tracker) (#ls.Variant tag last? memberS) @@ -77,13 +77,13 @@ (recur bodyS (list/fold recur tracker initsS)) (#ls.Case inputS outputPS) - (let [tracker' (list/fold s.add + (let [tracker' (list/fold s.has (recur inputS tracker) (bound-vars outputPS))] (list/fold recur tracker' (path-bodies outputPS))) (#ls.Function arity env bodyS) - (list/fold s.remove tracker env) + (list/fold s.lacks tracker env) _ tracker diff --git a/lux-jvm/source/luxc/lang/translation/jvm/function.lux b/lux-jvm/source/luxc/lang/translation/jvm/function.lux index dfca4a6e6..e4fb2c65e 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/function.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/function.lux @@ -58,7 +58,7 @@ (-> (Environment Synthesis) Arity (Type Method)) (if (poly_arg? arity) (type.method [(list) - (list.concat (list (captured_args env) + (list.joined (list (captured_args env) (list type.int) (list.repeat (dec arity) //.$Value))) type.void diff --git a/lux-jvm/test/test/luxc/lang/synthesis/loop.lux b/lux-jvm/test/test/luxc/lang/synthesis/loop.lux index c6efa7dbf..0ed3b63fa 100644 --- a/lux-jvm/test/test/luxc/lang/synthesis/loop.lux +++ b/lux-jvm/test/test/luxc/lang/synthesis/loop.lux @@ -62,7 +62,7 @@ #let [bad-bodies (list.repeat num-cases (' []))] good-body (gen-body arity output) where-to-set (|> r.nat (:: @ map (n/% num-cases))) - #let [bodies (list.concat (list (list.take where-to-set bad-bodies) + #let [bodies (list.joined (list (list.take where-to-set bad-bodies) (list good-body) (list.drop (n/inc where-to-set) bad-bodies)))]] (wrap (` ("lux case" (~ inputA) -- cgit v1.2.3