Compare commits

...

2 Commits

Author SHA1 Message Date
Ginger Bill 4afb3f8fa4 Fix line comments at the end of file 2017-01-05 22:35:32 +00:00
Ginger Bill 207b252f23 Fix checking termination of a procedure 2017-01-05 22:32:19 +00:00
4 changed files with 72 additions and 7 deletions
+1 -1
View File
@@ -4,7 +4,7 @@
set exe_name=odin.exe
:: Debug = 0, Release = 1
set release_mode=0
set release_mode=1
set compiler_flags= -nologo -Oi -TC -fp:fast -fp:except- -Gm- -MP -FC -GS- -EHsc- -GR-
+67 -2
View File
@@ -1,5 +1,70 @@
#foreign_system_library "winmm" when ODIN_OS == "windows";
#import win32 "sys/windows.odin" when ODIN_OS == "windows";
#import "fmt.odin";
main :: proc() {
fmt.println("Hellope!");
timeGetTime :: proc() -> u32 #foreign #dll_import
GetSystemTimeAsFileTime :: proc(SystemTimeAsFileTime : ^win32.FILETIME) #foreign #dll_import
GetCommandLineArguments :: proc() -> []string {
argString := win32.GetCommandLineA();
fullArgString := to_odin_string(argString);
// Count Spaces
for r : fullArgString {
fmt.println(r);
}
}
to_odin_string :: proc(c: ^byte) -> string {
s: string;
s.data = c;
while (c + s.count)^ != 0 {
s.count += 1;
}
return s;
}
//("Hellope!\x00" as string).data
MAGIC_VALUE :: 0xCA5E713F;
timing_file_header :: struct #ordered {
MagicValue : u32;
}
timing_file_date :: struct #ordered {
E : [2]u32;
}
timing_file_entry_flag :: enum {
Complete = 0x1,
NoErrors = 0x2,
}
timing_file_entry :: struct #ordered {
StarDate : timing_file_date;
Flags : u32;
MillisecondsElapsed : u32;
}
timing_entry_array :: struct #ordered {
Entries : []timing_file_entry;
}
GetClock :: proc () -> u32 {
return timeGetTime();
}
GetDate :: proc() -> timing_file_date {
Result : timing_file_date;
FileTime : win32.FILETIME;
GetSystemTimeAsFileTime(^FileTime);
Result.E[0] = FileTime.lo;
Result.E[1] = FileTime.hi;
return Result;
}
main :: proc () {
EntryClock := GetClock();
GetCommandLineArguments();
}
+3 -3
View File
@@ -128,14 +128,14 @@ bool check_is_terminating(AstNode *node) {
case_end;
case_ast_node(ws, WhileStmt, node);
if (ws->cond == NULL && !check_has_break(ws->body, true)) {
return true;
if (ws->cond != NULL && !check_has_break(ws->body, true)) {
return check_is_terminating(ws->body);
}
case_end;
case_ast_node(rs, ForStmt, node);
if (!check_has_break(rs->body, true)) {
return true;
return check_is_terminating(rs->body);
}
case_end;
+1 -1
View File
@@ -899,7 +899,7 @@ Token tokenizer_get_token(Tokenizer *t) {
break;
case '/': {
if (t->curr_rune == '/') {
while (t->curr_rune != '\n') {
while (t->curr_rune != '\n' && t->curr_rune != GB_RUNE_EOF) {
advance_to_next_rune(t);
}
token.kind = Token_Comment;