various bug improvements
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Tue, 8 Sep 2020 21:44:31 +0000 (16:44 -0500)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Tue, 8 Sep 2020 21:44:31 +0000 (16:44 -0500)
Makefile
core/js/webgl.js
core/js/webgl.onyx
docs/plan
misc/onyx.vim
onyx
progs/odin_example.onyx
src/onyxchecker.c
src/onyxsymres.c

index 4778e4beac75d78cb2eb4ae56afce244e4aa3789..8754d4eeb0779f3a48958b4cd49c601db6938f80 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-RELEASE=0
+RELEASE=1
 
 OBJ_FILES=\
        build/onyxlex.o \
index 1199e8969f6625fe7027fe7d1cf61b1bbcf325f6..a8e727dfe49a8d57dfba92324069d7819a647e48 100644 (file)
@@ -57,6 +57,10 @@ WebGl_Wasm = {
         const data = new DataView(WASM_MEMORY.buffer, bufferdata, bufferlen);
         this.gl.bufferSubData(target, offset, data);
     },
+    canvasSize(width, height) {
+        this.canvas.width = width;
+        this.canvas.height = height;
+    },
     checkFrameBufferStatus(target) { return this.gl.checkFrameBufferStatus(target); },
     clear(bit) { this.gl.clear(bit); },
     clearColor(r, g, b, a) { this.gl.clearColor(r, g, b, a); },
index a4d2afea05961f699df163269a515cb8df000f4b..dbbe978b84e0156ddd9938b4aeb5a3bcaf8b8023 100644 (file)
@@ -740,6 +740,7 @@ bufferDataWithData             :: proc (target: GLenum, buffer: Buffer, usage: G
 bufferDataNoData               :: proc (target: GLenum, size: GLsizeiptr, usage: GLenum) #foreign "gl" "bufferDataNoData" ---
 bufferData                     :: proc #overloaded { bufferDataWithData, bufferDataNoData }
 bufferSubData                  :: proc (target: GLenum, offset: GLsizei, data: Buffer) #foreign "gl" "bufferSubData" ---
+canvasSize                     :: proc (width: GLsizei, height: GLsizei) #foreign "gl" "canvasSize" ---
 checkFrameBufferStatus         :: proc (target: GLenum) -> GLenum #foreign "gl" "checkFrameBufferStatus" ---
 clear                          :: proc (mask: GLbitfield) #foreign "gl" "clear" ---
 clearColor                     :: proc (red: GLclampf, green: GLclampf, blue: GLclampf, alpha: GLclampf) #foreign "gl" "clearColor" ---
index 04eadb19412ecc9be696c974dd959172d81fff60..61ec68d568c5d7075ce077d5127d5adc76661dc1 100644 (file)
--- a/docs/plan
+++ b/docs/plan
@@ -262,6 +262,10 @@ HOW:
         [ ] Add SIMD intrinsics
             - This also requires adding the v128 SIMD type
 
+        [ ] Add threading intrinsics
+            - This will actually be fairly easy since I think all that is needed is
+                to implement the intrinsics.
+
         [ ] Type parameterized structs
 
         [ ] Array literals
index 1f1c588eba7376a96609578cd2815d83449c806c..e037825fb8743d14f8d26ac0a73552785ce67aeb 100644 (file)
@@ -31,6 +31,7 @@ syn keyword onyxConstant        true false null
 syn keyword onyxCommentStart    contained TODO NOTE BUG HACK
 
 syn region onyxComment          start="//" end="$" keepend contains=onyxCommentStart
+syn region onyxComment          start="/\*" end="\*/" contains=onyxCommentStart
 
 syn region onyxDirective        start="#" end=" "
 
diff --git a/onyx b/onyx
index 8338bfe5fdb70ee372bd3e6f7222d4c62cabe05b..a68a99c184e98d83735ad196e968018426c8bd1c 100755 (executable)
Binary files a/onyx and b/onyx differ
index 7fc7dbcd9361368af8640e79479f4ff4d94cd1ca..62a688d88d5d6375ac2edfdb27fcfd5c95328869 100644 (file)
@@ -63,6 +63,8 @@ main :: proc (args: [] cstring) {
     print("\n");
     print_bar(^bar);
     print_foo(^bar.foo);
+    print(bar.foo.data1);
+    print("\n");
 
     program := "+ + * s - /";
     accumulator := 0;
index d8862bd0cbb6311074443949fa6883117b3c3d66..469a1ca6f79be597357c3d0265ddad267e1b21d0 100644 (file)
@@ -1138,6 +1138,8 @@ b32 check_expression(AstTyped** pexpr) {
 
         case Ast_Kind_Polymorphic_Proc: break;
 
+        case Ast_Kind_Package: break;
+
         case Ast_Kind_Error: break;
 
         default:
index 987aab01e480f8d13dec4795ac0514674844dde2..9394f9c2e7640713a88afe20c7ae6d00d8f2bc4d 100644 (file)
@@ -666,6 +666,8 @@ static void symres_enum(AstEnumType* enum_node) {
                 return;
             }
 
+            (*value)->value->type = enum_node->backing_type;
+
         } else {
             AstNumLit* num = onyx_ast_node_new(semstate.node_allocator, sizeof(AstNumLit), Ast_Kind_NumLit);
             num->value.l = next_assign_value;