[gcommon decomp] compiler and decompiler fixes (#239)

* wip

* decompile file-io

* a

* fix
This commit is contained in:
water111
2021-02-07 18:21:00 -05:00
committed by GitHub
parent f8b63a3f92
commit e01e065170
31 changed files with 925 additions and 164 deletions
@@ -234,7 +234,7 @@ TEST_F(FormRegressionTest, WhileLoop) {
" (begin (set! v1-0 (-> v1-0 parent)) (= v1-0 a0-1))\n"
" (if\n"
" (= v1-0 a1-0)\n"
" (return (begin (set! v1-1 '#t) (set! v0-0 v1-1)) (set! v1-0 0))\n"
" (return (begin (set! v1-1 '#t) (set! v0-0 v1-1)))\n"
" )\n"
" )\n"
" (set! v0-0 '#f)\n"
@@ -300,7 +300,7 @@ TEST_F(FormRegressionTest, Or) {
" )\n"
" (if\n"
" (= a0-0 a1-0)\n"
" (return (begin (set! v1-1 '#t) (set! v0-0 v1-1)) (set! v1-0 0))\n"
" (return (begin (set! v1-1 '#t) (set! v0-0 v1-1)))\n"
" )\n"
" )\n"
" (set! v0-0 '#f)\n"
@@ -365,9 +365,9 @@ TEST_F(FormRegressionTest, DynamicMethodAccess) {
" (if\n"
" (begin\n"
" (if\n"
" (begin (set! a2-0 object) (= a0-0 a2-0))\n" // if we reached the top
" (return (begin (set! v1-3 nothing) (set! v0-0 v1-3)) (set! v1-2 0))\n" // return
// nothing.
" (begin (set! a2-0 object) (= a0-0 a2-0))\n" // if we reached the top
" (return (begin (set! v1-3 nothing) (set! v0-0 v1-3)))\n" // return
// nothing.
" )\n"
" (set! a0-0 (-> a0-0 parent))\n" // get next parent type
" (set! a2-2 (sll a1-0 2))\n" // fancy access
@@ -376,9 +376,9 @@ TEST_F(FormRegressionTest, DynamicMethodAccess) {
// condition)
" (zero? v0-0)\n" // is it defined?
" )\n"
" (return (begin (set! v1-4 nothing) (set! v0-0 v1-4)) (set! v1-2 0))\n" // also
// return
// nothing.
" (return (begin (set! v1-4 nothing) (set! v0-0 v1-4)))\n" // also
// return
// nothing.
" )\n"
" )\n"
" (set! v1-5 '#f)\n"
@@ -887,7 +887,7 @@ TEST_F(FormRegressionTest, TypeOf) {
std::string type = "(function object object)";
std::string expected =
"(begin\n"
" (set! v1-1 (type-of a0-0))\n"
" (set! v1-1 (rtype-of a0-0))\n"
" (set! t9-0 (-> v1-1 methods-by-name print))\n" // print method.
" (set! v0-0 (call! a0-0))\n"
" (ret-value v0-0)\n"