mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-27 09:50:03 +00:00
v0.3 Release
This commit is contained in:
+6
-4
@@ -41,7 +41,7 @@ main :: proc() {
|
|||||||
|
|
||||||
// Divisor based modulo operator
|
// Divisor based modulo operator
|
||||||
{
|
{
|
||||||
x: i128 = -5;
|
x: i128 = -15;
|
||||||
y: i128 = 2;
|
y: i128 = 2;
|
||||||
|
|
||||||
fmt.println(x % y); // Dividend based
|
fmt.println(x % y); // Dividend based
|
||||||
@@ -73,6 +73,7 @@ main :: proc() {
|
|||||||
id: u64,
|
id: u64,
|
||||||
position: [vector 2]f32,
|
position: [vector 2]f32,
|
||||||
name: string,
|
name: string,
|
||||||
|
|
||||||
Tree{leaf_count: int},
|
Tree{leaf_count: int},
|
||||||
Frog{ribbit_volume: f32},
|
Frog{ribbit_volume: f32},
|
||||||
}
|
}
|
||||||
@@ -81,7 +82,7 @@ main :: proc() {
|
|||||||
e = Entity.Frog{ribbit_volume = 0.5, name = "Trevor"};
|
e = Entity.Frog{ribbit_volume = 0.5, name = "Trevor"};
|
||||||
|
|
||||||
if frog, ok := e.(Entity.Frog); ok {
|
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
|
// Panics if the type assertion fails
|
||||||
@@ -153,7 +154,7 @@ main :: proc() {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
Float32Data :: bit_field {
|
Float32Data :: bit_field #align 4 {
|
||||||
fraction: 23,
|
fraction: 23,
|
||||||
exponent: 8,
|
exponent: 8,
|
||||||
sign: 1,
|
sign: 1,
|
||||||
@@ -182,7 +183,7 @@ main :: proc() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Goals for v0.4 and further
|
// 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
|
// - Safe array with bounds checking
|
||||||
// - Map type for self documentation
|
// - Map type for self documentation
|
||||||
// - u128 i128 acting like core types
|
// - u128 i128 acting like core types
|
||||||
@@ -196,4 +197,5 @@ main :: proc() {
|
|||||||
// - Foreign variables
|
// - Foreign variables
|
||||||
// * Documentation Generation System for code
|
// * Documentation Generation System for code
|
||||||
// * General Documentation for Odin
|
// * General Documentation for Odin
|
||||||
|
// * Attributes
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-4
@@ -30,10 +30,10 @@ TypeInfoEnumValue :: raw_union {
|
|||||||
}
|
}
|
||||||
// NOTE(bill): This must match the compiler's
|
// NOTE(bill): This must match the compiler's
|
||||||
CallingConvention :: enum {
|
CallingConvention :: enum {
|
||||||
ODIN = 0,
|
Odin = 0,
|
||||||
C = 1,
|
C = 1,
|
||||||
STD = 2,
|
Std = 2,
|
||||||
FAST = 3,
|
Fast = 3,
|
||||||
}
|
}
|
||||||
|
|
||||||
TypeInfoRecord :: struct #ordered {
|
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_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); }
|
__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 {
|
__assert :: proc(file: string, line, column: int, msg: string) #inline {
|
||||||
fmt.fprintf(os.stderr, "%s(%d:%d) Runtime assertion: %s\n",
|
fmt.fprintf(os.stderr, "%s(%d:%d) Runtime assertion: %s\n",
|
||||||
file, line, column, msg);
|
file, line, column, msg);
|
||||||
|
|||||||
@@ -3880,7 +3880,6 @@ AstNodeArray parse_stmt_list(AstFile *f) {
|
|||||||
AstNodeArray list = make_ast_node_array(f);
|
AstNodeArray list = make_ast_node_array(f);
|
||||||
|
|
||||||
while (f->curr_token.kind != Token_case &&
|
while (f->curr_token.kind != Token_case &&
|
||||||
// f->curr_token.kind != Token_default &&
|
|
||||||
f->curr_token.kind != Token_CloseBrace &&
|
f->curr_token.kind != Token_CloseBrace &&
|
||||||
f->curr_token.kind != Token_EOF) {
|
f->curr_token.kind != Token_EOF) {
|
||||||
AstNode *stmt = parse_stmt(f);
|
AstNode *stmt = parse_stmt(f);
|
||||||
|
|||||||
Reference in New Issue
Block a user