diff --git a/code/demo.odin b/code/demo.odin index e21d689c1..bd0710a1e 100644 --- a/code/demo.odin +++ b/code/demo.odin @@ -41,7 +41,7 @@ main :: proc() { // Divisor based modulo operator { - x: i128 = -5; + x: i128 = -15; y: i128 = 2; fmt.println(x % y); // Dividend based @@ -73,6 +73,7 @@ main :: proc() { id: u64, position: [vector 2]f32, name: string, + Tree{leaf_count: int}, Frog{ribbit_volume: f32}, } @@ -81,7 +82,7 @@ main :: proc() { e = Entity.Frog{ribbit_volume = 0.5, name = "Trevor"}; if frog, ok := e.(Entity.Frog); ok { - fmt.printf("%s the frog ribbit's at %f\n", frog.name, frog.ribbit_volume); + fmt.printf("%s the frog ribbits at %f\n", frog.name, frog.ribbit_volume); } // Panics if the type assertion fails @@ -153,7 +154,7 @@ main :: proc() { - Float32Data :: bit_field { + Float32Data :: bit_field #align 4 { fraction: 23, exponent: 8, sign: 1, @@ -182,7 +183,7 @@ main :: proc() { } // Goals for v0.4 and further - // * Compile as C++and use some of its constructs for sanity e.g. overloading + // * Compile as C++ and use some of its constructs for sanity e.g. overloading // - Safe array with bounds checking // - Map type for self documentation // - u128 i128 acting like core types @@ -196,4 +197,5 @@ main :: proc() { // - Foreign variables // * Documentation Generation System for code // * General Documentation for Odin + // * Attributes } diff --git a/core/_preload.odin b/core/_preload.odin index 4e5d9e9e4..3426fd16a 100644 --- a/core/_preload.odin +++ b/core/_preload.odin @@ -30,10 +30,10 @@ TypeInfoEnumValue :: raw_union { } // NOTE(bill): This must match the compiler's CallingConvention :: enum { - ODIN = 0, + Odin = 0, C = 1, - STD = 2, - FAST = 3, + Std = 2, + Fast = 3, } TypeInfoRecord :: struct #ordered { @@ -326,7 +326,6 @@ __complex64_ne :: proc(a, b: complex64) -> bool #inline { return real(a) != re __complex128_eq :: proc(a, b: complex128) -> bool #inline { return real(a) == real(b) && imag(a) == imag(b); } __complex128_ne :: proc(a, b: complex128) -> bool #inline { return real(a) != real(b) || imag(a) != imag(b); } - __assert :: proc(file: string, line, column: int, msg: string) #inline { fmt.fprintf(os.stderr, "%s(%d:%d) Runtime assertion: %s\n", file, line, column, msg); diff --git a/src/parser.c b/src/parser.c index 4c7cc50af..18aa32a0f 100644 --- a/src/parser.c +++ b/src/parser.c @@ -3880,7 +3880,6 @@ AstNodeArray parse_stmt_list(AstFile *f) { AstNodeArray list = make_ast_node_array(f); while (f->curr_token.kind != Token_case && - // f->curr_token.kind != Token_default && f->curr_token.kind != Token_CloseBrace && f->curr_token.kind != Token_EOF) { AstNode *stmt = parse_stmt(f);