├── .gitignore ├── LICENSE ├── LibCompiler.hs ├── README.md ├── Setup.hs ├── app └── Main.hs ├── libcompilerhelper.c ├── scheme2luac.cabal ├── src ├── Assembler.hs ├── CodeGenerator.hs ├── Macro.hs └── Parser2.hs ├── stack.yaml └── test ├── Spec.hs └── testfiles ├── arith1.scm ├── arith2.scm ├── arith3.scm ├── arith4.scm ├── arith5.scm ├── bool1.scm ├── bool2.scm ├── bool3.scm ├── bool4.scm ├── bool5.scm ├── bool6.scm ├── bool7.scm ├── bool8.scm ├── cons1.scm ├── cons2.scm ├── cons3.scm ├── define1.scm ├── define2.scm ├── define3.scm ├── define4.scm ├── define5.scm ├── eval1.result ├── eval1.scm ├── eval2.result ├── eval2.scm ├── eval3.result ├── eval3.scm ├── lambda1.scm ├── lambda2.scm ├── lambda3.scm ├── lambda4.scm ├── lambda5.scm ├── let1.scm ├── let2.scm ├── let3.scm ├── lookup1.scm ├── macro1.scm ├── macro2.scm ├── quote1.scm ├── recursive1.scm ├── recursive2.scm └── tailcall1.scm /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamrk/scheme2luac/HEAD/.gitignore -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamrk/scheme2luac/HEAD/LICENSE -------------------------------------------------------------------------------- /LibCompiler.hs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamrk/scheme2luac/HEAD/LibCompiler.hs -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamrk/scheme2luac/HEAD/README.md -------------------------------------------------------------------------------- /Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /app/Main.hs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamrk/scheme2luac/HEAD/app/Main.hs -------------------------------------------------------------------------------- /libcompilerhelper.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamrk/scheme2luac/HEAD/libcompilerhelper.c -------------------------------------------------------------------------------- /scheme2luac.cabal: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamrk/scheme2luac/HEAD/scheme2luac.cabal -------------------------------------------------------------------------------- /src/Assembler.hs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamrk/scheme2luac/HEAD/src/Assembler.hs -------------------------------------------------------------------------------- /src/CodeGenerator.hs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamrk/scheme2luac/HEAD/src/CodeGenerator.hs -------------------------------------------------------------------------------- /src/Macro.hs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamrk/scheme2luac/HEAD/src/Macro.hs -------------------------------------------------------------------------------- /src/Parser2.hs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamrk/scheme2luac/HEAD/src/Parser2.hs -------------------------------------------------------------------------------- /stack.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamrk/scheme2luac/HEAD/stack.yaml -------------------------------------------------------------------------------- /test/Spec.hs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamrk/scheme2luac/HEAD/test/Spec.hs -------------------------------------------------------------------------------- /test/testfiles/arith1.scm: -------------------------------------------------------------------------------- 1 | (+ 1 2 3 4 5 6) -------------------------------------------------------------------------------- /test/testfiles/arith2.scm: -------------------------------------------------------------------------------- 1 | (- 3) -------------------------------------------------------------------------------- /test/testfiles/arith3.scm: -------------------------------------------------------------------------------- 1 | (- 10 1 2 3 4 5) -------------------------------------------------------------------------------- /test/testfiles/arith4.scm: -------------------------------------------------------------------------------- 1 | (* 1 2 3 4 5) -------------------------------------------------------------------------------- /test/testfiles/arith5.scm: -------------------------------------------------------------------------------- 1 | (+ (* 4 5) (- 25 3) 100) -------------------------------------------------------------------------------- /test/testfiles/bool1.scm: -------------------------------------------------------------------------------- 1 | (if (< 4 5) 0 1) -------------------------------------------------------------------------------- /test/testfiles/bool2.scm: -------------------------------------------------------------------------------- 1 | (if (not #f) 0 1) -------------------------------------------------------------------------------- /test/testfiles/bool3.scm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamrk/scheme2luac/HEAD/test/testfiles/bool3.scm -------------------------------------------------------------------------------- /test/testfiles/bool4.scm: -------------------------------------------------------------------------------- 1 | (if (= 3 4) 0 1) -------------------------------------------------------------------------------- /test/testfiles/bool5.scm: -------------------------------------------------------------------------------- 1 | (if (> 4 5) 0 1) -------------------------------------------------------------------------------- /test/testfiles/bool6.scm: -------------------------------------------------------------------------------- 1 | (if 100 0 1) -------------------------------------------------------------------------------- /test/testfiles/bool7.scm: -------------------------------------------------------------------------------- 1 | (if "hello" 0 1) -------------------------------------------------------------------------------- /test/testfiles/bool8.scm: -------------------------------------------------------------------------------- 1 | (if 0 0 1) -------------------------------------------------------------------------------- /test/testfiles/cons1.scm: -------------------------------------------------------------------------------- 1 | (car (cons 4 5)) 2 | -------------------------------------------------------------------------------- /test/testfiles/cons2.scm: -------------------------------------------------------------------------------- 1 | (cdr (cons 1 2)) 2 | -------------------------------------------------------------------------------- /test/testfiles/cons3.scm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamrk/scheme2luac/HEAD/test/testfiles/cons3.scm -------------------------------------------------------------------------------- /test/testfiles/define1.scm: -------------------------------------------------------------------------------- 1 | (define x 5) 2 | x 3 | -------------------------------------------------------------------------------- /test/testfiles/define2.scm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamrk/scheme2luac/HEAD/test/testfiles/define2.scm -------------------------------------------------------------------------------- /test/testfiles/define3.scm: -------------------------------------------------------------------------------- 1 | (define g (lambda (x) x)) 2 | (g 2) 3 | -------------------------------------------------------------------------------- /test/testfiles/define4.scm: -------------------------------------------------------------------------------- 1 | (define (g x y) x) 2 | (g 5 6) 3 | -------------------------------------------------------------------------------- /test/testfiles/define5.scm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamrk/scheme2luac/HEAD/test/testfiles/define5.scm -------------------------------------------------------------------------------- /test/testfiles/eval1.result: -------------------------------------------------------------------------------- 1 | 10 -------------------------------------------------------------------------------- /test/testfiles/eval1.scm: -------------------------------------------------------------------------------- 1 | (eval '10) -------------------------------------------------------------------------------- /test/testfiles/eval2.result: -------------------------------------------------------------------------------- 1 | 10 -------------------------------------------------------------------------------- /test/testfiles/eval2.scm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamrk/scheme2luac/HEAD/test/testfiles/eval2.scm -------------------------------------------------------------------------------- /test/testfiles/eval3.result: -------------------------------------------------------------------------------- 1 | 100 -------------------------------------------------------------------------------- /test/testfiles/eval3.scm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamrk/scheme2luac/HEAD/test/testfiles/eval3.scm -------------------------------------------------------------------------------- /test/testfiles/lambda1.scm: -------------------------------------------------------------------------------- 1 | ((lambda (x y z) x) 10 25 1) -------------------------------------------------------------------------------- /test/testfiles/lambda2.scm: -------------------------------------------------------------------------------- 1 | ((lambda (x) x) 100) -------------------------------------------------------------------------------- /test/testfiles/lambda3.scm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamrk/scheme2luac/HEAD/test/testfiles/lambda3.scm -------------------------------------------------------------------------------- /test/testfiles/lambda4.scm: -------------------------------------------------------------------------------- 1 | ((lambda () 5)) -------------------------------------------------------------------------------- /test/testfiles/lambda5.scm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamrk/scheme2luac/HEAD/test/testfiles/lambda5.scm -------------------------------------------------------------------------------- /test/testfiles/let1.scm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamrk/scheme2luac/HEAD/test/testfiles/let1.scm -------------------------------------------------------------------------------- /test/testfiles/let2.scm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamrk/scheme2luac/HEAD/test/testfiles/let2.scm -------------------------------------------------------------------------------- /test/testfiles/let3.scm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamrk/scheme2luac/HEAD/test/testfiles/let3.scm -------------------------------------------------------------------------------- /test/testfiles/lookup1.scm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamrk/scheme2luac/HEAD/test/testfiles/lookup1.scm -------------------------------------------------------------------------------- /test/testfiles/macro1.scm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamrk/scheme2luac/HEAD/test/testfiles/macro1.scm -------------------------------------------------------------------------------- /test/testfiles/macro2.scm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamrk/scheme2luac/HEAD/test/testfiles/macro2.scm -------------------------------------------------------------------------------- /test/testfiles/quote1.scm: -------------------------------------------------------------------------------- 1 | (car '(1 2 a)) -------------------------------------------------------------------------------- /test/testfiles/recursive1.scm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamrk/scheme2luac/HEAD/test/testfiles/recursive1.scm -------------------------------------------------------------------------------- /test/testfiles/recursive2.scm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamrk/scheme2luac/HEAD/test/testfiles/recursive2.scm -------------------------------------------------------------------------------- /test/testfiles/tailcall1.scm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamrk/scheme2luac/HEAD/test/testfiles/tailcall1.scm --------------------------------------------------------------------------------