diff options
author | Eduardo Julian | 2015-03-21 20:26:24 -0400 |
---|---|---|
committer | Eduardo Julian | 2015-03-21 20:26:24 -0400 |
commit | 6c5c857412c55aa1e015625afa6cdf163dea159b (patch) | |
tree | 2748e595d0136c24aa06bd03433f4a3dd4c1ccf6 /source | |
parent | 4f35491020fba914b746b4109f4362de603288bc (diff) |
- Added the reading-phase and it's associated structure as the mediator between raw source-code and the lexing-phase.
Diffstat (limited to '')
-rw-r--r-- | source/lux.lux | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/source/lux.lux b/source/lux.lux index fd895f25c..d3ed0c3a3 100644 --- a/source/lux.lux +++ b/source/lux.lux @@ -2,6 +2,26 @@ (jvm-interface Function (: apply (-> [java.lang.Object] java.lang.Object))) +## (jvm-interface Function +## [apply ([java.lang.Object] java.lang.Object)]) + +## (jvm-class Function +## (modifiers public abstract) +## (fields) +## (abstract-methods +## [apply1 ([java.lang.Object] java.lang.Object)]) +## (virtual-methods +## [apply2 ((this [arg1 java.lang.Object] [arg2 java.lang.Object]) +## java.lang.Object +## (jvm-invokevirtual lux.Function "apply1" [java.lang.Object] +## (jvm-invokevirtual lux.Function "apply1" [java.lang.Object] +## this [arg1]) [arg2]))] +## [apply3 ((this [arg1 java.lang.Object] [arg2 java.lang.Object] [arg3 java.lang.Object]) +## java.lang.Object +## (jvm-invokevirtual lux.Function "apply1" [java.lang.Object] +## (jvm-invokevirtual lux.Function "apply2" [java.lang.Object java.lang.Object] +## this [arg1 arg2]) [arg3]))])) + ## Base functions & macros (def' let' (lambda' _ tokens @@ -57,11 +77,11 @@ (lambda [tokens state] (let' output (case' tokens (#Cons [(#Symbol name) (#Cons [body #Nil])]) - (#Form (#Cons [(#Symbol ["lux" "def'"]) tokens])) + (#Form (#Cons [(#Symbol ["" "def'"]) tokens])) (#Cons [(#Form (#Cons [(#Symbol name) args])) (#Cons [body #Nil])]) - (#Form (#Cons [(#Symbol ["lux" "def'"]) + (#Form (#Cons [(#Symbol ["" "def'"]) (#Cons [(#Symbol name) (#Cons [(#Form (#Cons [(#Symbol ["lux" "lambda"]) (#Cons [(#Symbol name) @@ -80,7 +100,7 @@ (#Cons [(#Form (#Cons [(#Symbol fn-name) args])) (#Cons [body #Nil])])]))]) - (let' declaration (#Form (#Cons [(#Symbol ["lux" "declare-macro"]) (#Cons [(#Symbol fn-name) #Nil])])) + (let' declaration (#Form (#Cons [(#Symbol ["" "declare-macro"]) (#Cons [(#Symbol fn-name) #Nil])])) (#Right [state (#Cons [fn-def (#Cons [declaration #Nil])])])))) (declare-macro defmacro) @@ -758,7 +778,8 @@ (` (#All (list) (~ (#Text "")) (~ (#Text arg-name)) (~ (replace-ident [arg-module arg-name] (` (#Bound (~ (#Text arg-name)))) body)))))) - body args)] + body + args)] (case' rolled (#Form (#Cons [(#Tag ["lux" "TAll"]) (#Cons [env (#Cons [(#Test "") (#Cons [(#Text arg-name) (#Cons [body #Nil])])])])])) (return (list (` (#All (~ env) (~ (#Text name)) (~ (#Text arg-name)) |