"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/onyx",
- "args": ["progs/mvp.onyx"],
+ "args": ["progs/minimal.onyx"],
"stopAtEntry": true,
"cwd": "${workspaceFolder}",
"environment": [],
bh_file_contents bh_file_read_contents_bh_file(bh_allocator alloc, bh_file* file);
bh_file_contents bh_file_read_contents_direct(bh_allocator alloc, const char* filename);
-i32 bh_file_contents_delete(bh_file_contents* contents);
+i32 bh_file_contents_free(bh_file_contents* contents);
#endif
return fc;
}
-b32 bh_file_contents_delete(bh_file_contents* contents) {
+b32 bh_file_contents_free(bh_file_contents* contents) {
bh_free(contents->allocator, contents->data);
contents->length = 0;
return 1;
ONYX_TYPE_INFO_KIND_VOID,
ONYX_TYPE_INFO_KIND_BOOL,
- ONYX_TYPE_INFO_KIND_UINT8,
- ONYX_TYPE_INFO_KIND_UINT16,
ONYX_TYPE_INFO_KIND_UINT32,
ONYX_TYPE_INFO_KIND_UINT64,
- ONYX_TYPE_INFO_KIND_INT8,
- ONYX_TYPE_INFO_KIND_INT16,
ONYX_TYPE_INFO_KIND_INT32,
ONYX_TYPE_INFO_KIND_INT64,
--- /dev/null
+#ifndef ONYXWASM_H
+#define ONYXWASM_H
+
+#define BH_NO_STRING
+#include "bh.h"
+
+#include "onyxparser.h"
+
+enum WasmType {
+ WASM_TYPE_INT32 = 0x7F,
+ WASM_TYPE_INT64 = 0x7E,
+ WASM_TYPE_FLOAT32 = 0x7D,
+ WASM_TYPE_FLOAT64 = 0x7C
+};
+
+typedef struct OnyxWasmModule {
+
+} OnyxWasmModule;
+
+OnyxWasmModule onyx_wasm_generate_module(bh_allocator alloc, OnyxAstNode* program);
+
+#endif
/* a and b are both i32, so i32 + i32 is i32 so d is i32 */
d: const = a + b;
+ e: i32 = 10 as i32;
+
return ((c as i32) * d) as i64;
}
bh_arena_free(&ast_arena);
onyx_parser_free(&parser);
onyx_tokenizer_free(&tokenizer);
- bh_file_contents_delete(&fc);
+ bh_file_contents_free(&fc);
return 0;
}