diff options
author | Eduardo Julian | 2017-10-30 23:55:33 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-10-30 23:55:33 -0400 |
commit | e35f31c170be160b30f22eae22871eba74db2767 (patch) | |
tree | b73d58f00056c26996d5479370f82f485abdf827 /new-luxc/source/luxc | |
parent | a12eb1ae67e36ee12dd434da948a25b6b18e34d6 (diff) |
- Added "^code" pattern-matching macro for easier handling of code.
Diffstat (limited to 'new-luxc/source/luxc')
-rw-r--r-- | new-luxc/source/luxc/generator/expr.jvm.lux | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/new-luxc/source/luxc/generator/expr.jvm.lux b/new-luxc/source/luxc/generator/expr.jvm.lux index b439ff17a..61120ef86 100644 --- a/new-luxc/source/luxc/generator/expr.jvm.lux +++ b/new-luxc/source/luxc/generator/expr.jvm.lux @@ -27,10 +27,10 @@ (def: #export (generate synthesis) (-> ls;Synthesis (Meta $;Inst)) (case synthesis - [_ (#;Tuple #;Nil)] + (^code []) &primitive;generate-unit - (^ [_ (#;Tuple (list singleton))]) + (^code [(~ singleton)]) (generate singleton) (^template [<tag> <generator>] @@ -43,10 +43,10 @@ [#;Frac &primitive;generate-frac] [#;Text &primitive;generate-text]) - (^ [_ (#;Form (list [_ (#;Nat tag)] [_ (#;Bool last?)] valueS))]) + (^code ((~ [_ (#;Nat tag)]) (~ [_ (#;Bool last?)]) (~ valueS))) (&structure;generate-variant generate tag last? valueS) - - [_ (#;Tuple members)] + + (^code [(~@ members)]) (&structure;generate-tuple generate members) (^ [_ (#;Form (list [_ (#;Int var)]))]) @@ -57,20 +57,20 @@ [_ (#;Symbol definition)] (&reference;generate-definition definition) - (^ [_ (#;Form (list [_ (#;Text "lux let")] [_ (#;Nat register)] inputS exprS))]) + (^code ("lux let" (~ [_ (#;Nat register)]) (~ inputS) (~ exprS))) (caseG;generate-let generate register inputS exprS) - (^ [_ (#;Form (list [_ (#;Text "lux case")] inputS pathPS))]) + (^code ("lux case" (~ inputS) (~ pathPS))) (caseG;generate-case generate inputS pathPS) - (^multi (^ [_ (#;Form (list [_ (#;Text "lux function")] [_ (#;Nat arity)] [_ (#;Tuple environment)] bodyS))]) + (^multi (^code ("lux function" (~ [_ (#;Nat arity)]) [(~@ environment)] (~ bodyS))) [(s;run environment (p;some s;int)) (#e;Success environment)]) (&function;generate-function generate environment arity bodyS) - (^ [_ (#;Form (list& [_ (#;Text "lux call")] functionS argsS))]) + (^code ("lux call" (~ functionS) (~@ argsS))) (&function;generate-call generate functionS argsS) - (^ [_ (#;Form (list& [_ (#;Text procedure)] argsS))]) + (^code ((~ [_ (#;Text procedure)]) (~@ argsS))) (&procedure;generate-procedure generate procedure argsS) _ |