diff options
author | Eduardo Julian | 2014-12-07 20:13:58 -0400 |
---|---|---|
committer | Eduardo Julian | 2014-12-07 20:13:58 -0400 |
commit | 8f8467773fa2c5fb6556355a826b03050f75824e (patch) | |
tree | 18b61120f162a893ab89b93eae7a6a57391be942 /src/lang/compiler.clj | |
parent | 0dbcec8e727511d71101a705972eb252eec79b9f (diff) |
Fixed the bug that was causing &lexer/lex-form to be used unbound.
Diffstat (limited to 'src/lang/compiler.clj')
-rw-r--r-- | src/lang/compiler.clj | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/src/lang/compiler.clj b/src/lang/compiler.clj index 66e50a462..52195d2f2 100644 --- a/src/lang/compiler.clj +++ b/src/lang/compiler.clj @@ -103,28 +103,18 @@ (match ?form [::&parser/fn-call [::&parser/ident ?name] ?args] (if (= "main" ?name) - (let [=method (doto (.visitMethod *writer* (+ Opcodes/ACC_PUBLIC Opcodes/ACC_STATIC) ?name "([Ljava/lang/String;)V" nil nil) - (.visitCode))] - (compile-form =method ?body) - (doto =method - (.visitInsn Opcodes/RETURN) - (.visitMaxs 0 0) - (.visitEnd))) - (let [=method (doto (.visitMethod *writer* (+ Opcodes/ACC_PUBLIC Opcodes/ACC_STATIC) ?name "(Ljava/lang/Object;)Ljava/lang/Object;" nil nil) - (.visitCode))] - ;; (doto =method - ;; (.visitFieldInsn Opcodes/GETSTATIC (->class "java.lang.System") "out" (->type-signature "java.io.PrintStream")) - ;; (.visitLdcInsn "IN") - ;; (.visitMethodInsn Opcodes/INVOKEVIRTUAL (->class "java.io.PrintStream") "println" "(Ljava/lang/String;)V")) - (compile-form =method ?body) - ;; (doto =method - ;; (.visitFieldInsn Opcodes/GETSTATIC (->class "java.lang.System") "out" (->type-signature "java.io.PrintStream")) - ;; (.visitLdcInsn "OUT") - ;; (.visitMethodInsn Opcodes/INVOKEVIRTUAL (->class "java.io.PrintStream") "println" "(Ljava/lang/String;)V")) - (doto =method - (.visitInsn Opcodes/ARETURN) - (.visitMaxs 0 0) - (.visitEnd)))) + (doto (.visitMethod *writer* (+ Opcodes/ACC_PUBLIC Opcodes/ACC_STATIC) ?name "([Ljava/lang/String;)V" nil nil) + (.visitCode) + (compile-form ?body) + (.visitInsn Opcodes/RETURN) + (.visitMaxs 0 0) + (.visitEnd)) + (doto (.visitMethod *writer* (+ Opcodes/ACC_PUBLIC Opcodes/ACC_STATIC) ?name "(Ljava/lang/Object;)Ljava/lang/Object;" nil nil) + (.visitCode) + (compile-form ?body) + (.visitInsn Opcodes/ARETURN) + (.visitMaxs 0 0) + (.visitEnd))) )) (let [+compilers+ [compile-boolean |