2024-08-24 23:55:11 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
|
|
|
#include "result.hpp"
|
|
|
|
|
|
|
|
enum class StdlibFunctionId : uint64_t {
|
|
|
|
Unknown,
|
|
|
|
Print,
|
|
|
|
PrintLn,
|
|
|
|
Prn,
|
2024-09-29 19:55:45 +00:00
|
|
|
Slurp,
|
2024-09-29 20:43:23 +00:00
|
|
|
Spit,
|
2024-08-27 19:19:47 +00:00
|
|
|
Assert,
|
2024-08-28 20:51:25 +00:00
|
|
|
Dict,
|
2024-08-28 22:57:01 +00:00
|
|
|
List,
|
2024-09-01 15:13:28 +00:00
|
|
|
Array,
|
2024-08-28 22:57:01 +00:00
|
|
|
Get,
|
2024-09-18 18:53:12 +00:00
|
|
|
Set,
|
2024-09-05 22:22:45 +00:00
|
|
|
SrcLoc,
|
2024-09-10 02:18:00 +00:00
|
|
|
Size,
|
2024-09-15 15:21:58 +00:00
|
|
|
Map,
|
2024-09-24 17:47:11 +00:00
|
|
|
Error,
|
2024-09-24 19:53:26 +00:00
|
|
|
Raise,
|
2024-10-13 18:13:33 +00:00
|
|
|
Reraise,
|
2024-09-27 01:33:41 +00:00
|
|
|
Task,
|
2024-10-01 19:30:06 +00:00
|
|
|
Guard,
|
|
|
|
Serialize,
|
|
|
|
Deserialize,
|
2024-10-06 18:27:05 +00:00
|
|
|
Disassemble,
|
2024-09-27 01:33:41 +00:00
|
|
|
Max,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum class StdlibTaskId : uint64_t {
|
|
|
|
Unknown,
|
|
|
|
Print,
|
2024-09-29 19:55:45 +00:00
|
|
|
ReadFile,
|
2024-09-29 20:43:23 +00:00
|
|
|
WriteFile,
|
2024-08-24 23:55:11 +00:00
|
|
|
Max,
|
|
|
|
};
|
|
|
|
|
|
|
|
class Value;
|
|
|
|
class Symbol;
|
|
|
|
class Array;
|
2024-09-15 14:39:12 +00:00
|
|
|
class StackFrame;
|
2024-09-27 01:33:41 +00:00
|
|
|
class Continuation;
|
2024-08-24 23:55:11 +00:00
|
|
|
|
|
|
|
Result<const char*> get_stdlib_function_name(StdlibFunctionId fun_id);
|
|
|
|
Result<StdlibFunctionId> get_stdlib_function(const Symbol& name);
|
2024-09-15 14:39:12 +00:00
|
|
|
Result<StackFrame> call_stdlib_function(StdlibFunctionId fun_id,
|
|
|
|
const StackFrame& stack);
|
2024-09-27 01:33:41 +00:00
|
|
|
|
|
|
|
Result<const char*> get_stdlib_task_name(StdlibTaskId task_id);
|
|
|
|
Result<StdlibTaskId> get_stdlib_task(const Symbol& name);
|
|
|
|
Result<Value> call_stdlib_task(StdlibTaskId task_id, const Array& params);
|