jak-project/test/goalc
water111 ef23fecd90
[goalc] default to non-immediate lambdas if not requested (#2604)
This fixes a long time issue with `lambda`. The `lambda` is a bit
overloaded in OpenGOAL: it's used in the implementation of `let`, and
also to define local anonymous functions.

```
(defmacro let (bindings &rest body)
  `((lambda :inline #t ,(apply first bindings) ,@body)
    ,@(apply second bindings)))
```

```
(defmacro defun (name bindings &rest body)
  (let ((docstring ""))
    (when (and (> (length body) 1) (string? (first body)))
      (set! docstring (first body))
      (set! body (cdr body)))
    `(define ,name ,docstring (lambda :name ,name ,bindings ,@body))))
```

In the first case of a `let`, a `return` from inside the `let` should
return from the functioning containing the `let`, not the scope of the
`lambda`. In the second case, we should return from the lambda. The way
we told the different between these cases was if the `lambda` was used
"immeidately", in the head of an expression (like it would be for the
`let` macro). But, this falsely triggers when an anonymous function is
used immediately: eg
```
((lambda () (return #f)))
```
should generate and call a real x86 function that returns immediately.

This should fix some death/mission failed stuff in jak 2.
2023-04-30 19:00:27 -04:00
..
framework [jak 2] ETIE (#2326) 2023-03-17 20:35:26 -04:00
source_generated Final polish on the integer tests, time to start converting the rest 2020-10-03 18:32:01 -04:00
source_templates [goalc] default to non-immediate lambdas if not requested (#2604) 2023-04-30 19:00:27 -04:00
CMakeLists.txt Cleanup goalc tests, fix jak2 kernel bugs (#1669) 2022-07-17 14:12:11 -04:00
README.md Create new categorized test classes, for the most part just a copy of current tests into new framework 2020-10-08 00:06:48 -04:00
test_arithmetic.cpp Cleanup goalc tests, fix jak2 kernel bugs (#1669) 2022-07-17 14:12:11 -04:00
test_collections.cpp Cleanup goalc tests, fix jak2 kernel bugs (#1669) 2022-07-17 14:12:11 -04:00
test_compiler.cpp Cleanup goalc tests, fix jak2 kernel bugs (#1669) 2022-07-17 14:12:11 -04:00
test_control_statements.cpp Cleanup goalc tests, fix jak2 kernel bugs (#1669) 2022-07-17 14:12:11 -04:00
test_debugger.cpp dbgr: allow dumping the backtrace to a file (#2284) 2023-02-27 18:54:23 -05:00
test_game_no_debug.cpp [jak2] goalc supports multiple projects (#1619) 2022-07-06 21:18:08 -04:00
test_goal_kernel.cpp Cleanup goalc tests, fix jak2 kernel bugs (#1669) 2022-07-17 14:12:11 -04:00
test_goal_kernel2.cpp Cleanup goalc tests, fix jak2 kernel bugs (#1669) 2022-07-17 14:12:11 -04:00
test_jak2_compiler.cpp [goalc] Fix error when putting #f in an array of symbols (#1804) 2022-08-26 15:54:29 -04:00
test_type_consistency.cpp d/config: re-organize decompiler/config and eliminate most of the duplication (#2185) 2023-03-08 20:07:26 -05:00
test_variables.cpp Cleanup goalc tests, fix jak2 kernel bugs (#1669) 2022-07-17 14:12:11 -04:00
test_vector_float.cpp Cleanup goalc tests, fix jak2 kernel bugs (#1669) 2022-07-17 14:12:11 -04:00
test_with_game.cpp [decomp] ctywide-obs (#2250) 2023-02-25 14:00:16 -05:00

Some Documentation

TODO!

TODO

  • If it can't make the file successfully, currently the tests just hang
  • How do i share the same fixture (compiler/thread instance), but with different Params. I don't think this is possible...maybe with templates?