mirror of
https://github.com/open-goal/jak-project.git
synced 2024-10-20 21:27:52 -04:00
09142d1712
* generate object, but not supported in linker yet * add link and tests * update types
30 lines
782 B
C++
30 lines
782 B
C++
#pragma once
|
|
|
|
#include <optional>
|
|
#include <string>
|
|
#include <vector>
|
|
#include <unordered_map>
|
|
#include "Object.h"
|
|
|
|
namespace goos {
|
|
bool get_va(const goos::Object& rest, std::string* err_string, goos::Arguments* result);
|
|
bool va_check(
|
|
const goos::Arguments& args,
|
|
const std::vector<std::optional<goos::ObjectType>>& unnamed,
|
|
const std::unordered_map<std::string, std::pair<bool, std::optional<goos::ObjectType>>>& named,
|
|
std::string* err_string);
|
|
|
|
template <typename T>
|
|
void for_each_in_list(const goos::Object& list, T f) {
|
|
const goos::Object* iter = &list;
|
|
while (iter->is_pair()) {
|
|
auto lap = iter->as_pair();
|
|
f(lap->car);
|
|
iter = &lap->cdr;
|
|
}
|
|
|
|
assert(iter->is_empty_list());
|
|
}
|
|
|
|
int list_length(const goos::Object& list);
|
|
} // namespace goos
|