diff options
author | Eduardo Julian | 2018-05-06 00:45:45 -0400 |
---|---|---|
committer | Eduardo Julian | 2018-05-06 00:45:45 -0400 |
commit | 8787650c4b1641832db9df2c35bc3046e886220e (patch) | |
tree | 8c14799379226aa8452d39d91e9a56896db9187f /new-luxc/source/luxc/lang/translation/python | |
parent | 3c93d7a3aabaa49c67f9a498bc0d70f0af7f09d0 (diff) |
- Updated new-luxc to the latest stdlib changes.
Diffstat (limited to '')
7 files changed, 20 insertions, 20 deletions
diff --git a/new-luxc/source/luxc/lang/translation/python.lux b/new-luxc/source/luxc/lang/translation/python.lux index 77df53332..8739c278d 100644 --- a/new-luxc/source/luxc/lang/translation/python.lux +++ b/new-luxc/source/luxc/lang/translation/python.lux @@ -54,7 +54,7 @@ (type: #export Host {#context [Text Nat] #anchor (Maybe Anchor) - #loader (-> Statement (Error Unit)) + #loader (-> Statement (Error Top)) #interpreter (-> Expression (Error PyObject)) #module-buffer (Maybe StringBuilder) #program-buffer StringBuilder}) @@ -74,12 +74,12 @@ (def: #export python-module-name Text "module.py") (def: #export init-module-buffer - (Meta Unit) + (Meta Top) (function (_ compiler) (#e.Success [(update@ #.host (|>> (:! Host) (set@ #module-buffer (#.Some (StringBuilder::new []))) - (:! Void)) + (:! Bottom)) compiler) []]))) @@ -90,13 +90,13 @@ [old-name old-sub] (get@ #context old) new-name (format old-name "___" (%i (nat-to-int old-sub)))] (case (expr (set@ #.host - (:! Void (set@ #context [new-name +0] old)) + (:! Bottom (set@ #context [new-name +0] old)) compiler)) (#e.Success [compiler' output]) (#e.Success [(update@ #.host (|>> (:! Host) (set@ #context [old-name (n/inc old-sub)]) - (:! Void)) + (:! Bottom)) compiler') [new-name output]]) @@ -118,13 +118,13 @@ (function (_ compiler) (let [old (:! Host (get@ #.host compiler))] (case (expr (set@ #.host - (:! Void (set@ #anchor (#.Some anchor) old)) + (:! Bottom (set@ #anchor (#.Some anchor) old)) compiler)) (#e.Success [compiler' output]) (#e.Success [(update@ #.host (|>> (:! Host) (set@ #anchor (get@ #anchor old)) - (:! Void)) + (:! Bottom)) compiler') output]) @@ -168,7 +168,7 @@ (#e.Success output) (#e.Success [compiler output])))))] - [load! #loader Statement Unit] + [load! #loader Statement Top] [interpret #interpreter Expression PyObject] ) @@ -191,12 +191,12 @@ module-buffer)]] (<eval> code)))] - [save load! python.statement Statement Unit] + [save load! python.statement Statement Top] [run interpret python.expression Expression PyObject] ) (def: #export (save-module! target) - (-> File (Meta (Process Unit))) + (-> File (Meta (Process Top))) (do macro.Monad<Meta> [module macro.current-module-name module-buffer module-buffer diff --git a/new-luxc/source/luxc/lang/translation/python/case.jvm.lux b/new-luxc/source/luxc/lang/translation/python/case.jvm.lux index 6769103d9..2c32b26a6 100644 --- a/new-luxc/source/luxc/lang/translation/python/case.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/python/case.jvm.lux @@ -6,7 +6,7 @@ [text] text/format (coll [list "list/" Functor<List> Fold<List>] - [set #+ Set])) + (set ["set" unordered #+ Set]))) [macro #+ "meta/" Monad<Meta>] (macro [code])) (luxc [lang] diff --git a/new-luxc/source/luxc/lang/translation/python/procedure.jvm.lux b/new-luxc/source/luxc/lang/translation/python/procedure.jvm.lux index 699c0c000..f793a0165 100644 --- a/new-luxc/source/luxc/lang/translation/python/procedure.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/python/procedure.jvm.lux @@ -4,7 +4,7 @@ ["ex" exception #+ exception:]) (data [maybe] text/format - (coll [dict]))) + (coll (dictionary ["dict" unordered #+ Dict])))) (luxc ["&" lang] (lang ["ls" synthesis] (host [python #+ Expression Statement]))) diff --git a/new-luxc/source/luxc/lang/translation/python/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/python/procedure/common.jvm.lux index badca2d74..24e4197d1 100644 --- a/new-luxc/source/luxc/lang/translation/python/procedure/common.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/python/procedure/common.jvm.lux @@ -8,7 +8,7 @@ text/format [number] (coll [list "list/" Functor<List>] - [dict #+ Dict])) + (dictionary ["dict" unordered #+ Dict]))) [macro #+ with-gensyms] (macro [code] ["s" syntax #+ syntax:]) @@ -33,7 +33,7 @@ (type: #export Bundle (Dict Text Proc)) -(syntax: (Vector [size s.nat] elemT) +(syntax: (Vector {size s.nat} elemT) (wrap (list (` [(~+ (list.repeat size elemT))])))) (type: #export Nullary (-> (Vector +0 Expression) Expression)) @@ -61,7 +61,7 @@ "Expected: " (|> expected nat-to-int %i) "\n" " Actual: " (|> actual nat-to-int %i))) -(syntax: (arity: [name s.local-symbol] [arity s.nat]) +(syntax: (arity: {name s.local-symbol} {arity s.nat}) (with-gensyms [g!_ g!proc g!name g!translate g!inputs] (do @ [g!input+ (monad.seq @ (list.repeat arity (macro.gensym "input")))] diff --git a/new-luxc/source/luxc/lang/translation/python/procedure/host.jvm.lux b/new-luxc/source/luxc/lang/translation/python/procedure/host.jvm.lux index c1b43da2f..af82491b6 100644 --- a/new-luxc/source/luxc/lang/translation/python/procedure/host.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/python/procedure/host.jvm.lux @@ -4,7 +4,7 @@ (data [text] text/format (coll [list "list/" Functor<List>] - [dict #+ Dict])) + (dictionary ["dict" unordered #+ Dict]))) [macro "macro/" Monad<Meta>]) (luxc ["&" lang] (lang ["la" analysis] diff --git a/new-luxc/source/luxc/lang/translation/python/runtime.jvm.lux b/new-luxc/source/luxc/lang/translation/python/runtime.jvm.lux index 6319c2121..5d0ea9186 100644 --- a/new-luxc/source/luxc/lang/translation/python/runtime.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/python/runtime.jvm.lux @@ -57,7 +57,7 @@ (p.either (p.seq s.local-symbol (p/wrap (list))) (s.form (p.seq s.local-symbol (p.some s.local-symbol))))) -(syntax: (runtime: [[name args] declaration] +(syntax: (runtime: {[name args] declaration} definition) (let [implementation (code.local-symbol (format "@@" name)) runtime (format "__" prefix "__" (lang.normalize-name name)) @@ -88,7 +88,7 @@ (list (~+ argsLC+)) (~ definition)))))))))))) -(syntax: (with-vars [vars (s.tuple (p.many s.local-symbol))] +(syntax: (with-vars {vars (s.tuple (p.many s.local-symbol))} body) (wrap (list (` (let [(~+ (|> vars (list/map (function (_ var) @@ -576,7 +576,7 @@ (def: #export artifact Text (format prefix ".py")) (def: #export translate - (Meta (Process Unit)) + (Meta (Process Top)) (do macro.Monad<Meta> [_ //.init-module-buffer _ (//.save runtime)] diff --git a/new-luxc/source/luxc/lang/translation/python/statement.jvm.lux b/new-luxc/source/luxc/lang/translation/python/statement.jvm.lux index 36fe472d3..b267f5a64 100644 --- a/new-luxc/source/luxc/lang/translation/python/statement.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/python/statement.jvm.lux @@ -11,7 +11,7 @@ [".T" eval])) (def: #export (translate-def name expressionT expressionO metaV) - (-> Text Type Expression Code (Meta Unit)) + (-> Text Type Expression Code (Meta Top)) (do macro.Monad<Meta> [current-module macro.current-module-name #let [def-ident [current-module name]]] |