Browse Source

Fix build.bat

gingerBill 4 years ago
parent
commit
0c5fa2cdd5
2 changed files with 7 additions and 9 deletions
  1. 3 5
      build.bat
  2. 4 4
      core/odin/parser/parser.odin

+ 3 - 5
build.bat

@@ -68,12 +68,10 @@ set linker_settings=%libs% %linker_flags%
 del *.pdb > NUL 2> NUL
 del *.ilk > NUL 2> NUL
 
-rem cl %compiler_settings% "src\main.cpp" "src\libtommath.cpp" /link %linker_settings% -OUT:%exe_name%
-cl %compiler_settings% "src\main.cpp" "src\libtommath.cpp" /link %linker_settings% -OUT:%exe_name% ^
-	&& odin run examples/demo -vet
+cl %compiler_settings% "src\main.cpp" "src\libtommath.cpp" /link %linker_settings% -OUT:%exe_name%
 
-rem if %errorlevel% neq 0 goto end_of_build
-rem if %release_mode% EQU 0 odin check examples/all
+if %errorlevel% neq 0 goto end_of_build
+if %release_mode% EQU 0 odin check examples/all
 
 del *.obj > NUL 2> NUL
 

+ 4 - 4
core/odin/parser/parser.odin

@@ -850,8 +850,8 @@ parse_for_stmt :: proc(p: ^Parser) -> ^ast.Stmt {
 			cond = nil;
 
 
-			if f.curr_tok.kind == .Open_Brace || f.curr_tok.kind == .Do {
-				error(p, f.curr_tok.pos, "Expected ';', followed by a condition expression and post statement, got %s", token.tokens[f.curr_tok.kind]);
+			if p.curr_tok.kind == .Open_Brace || p.curr_tok.kind == .Do {
+				error(p, p.curr_tok.pos, "Expected ';', followed by a condition expression and post statement, got %s", tokenizer.tokens[p.curr_tok.kind]);
 			} else {
 				if p.curr_tok.kind != .Semicolon {
 					cond = parse_simple_stmt(p, nil);
@@ -2448,12 +2448,12 @@ parse_operand :: proc(p: ^Parser, lhs: bool) -> ^ast.Expr {
 	case .Open_Bracket:
 		open := expect_token(p, .Open_Bracket);
 		count: ^ast.Expr;
-		switch p.curr_tok.kind {
+		#partial switch p.curr_tok.kind {
 		case .Pointer:
 			tok := expect_token(p, .Pointer);
 			close := expect_token(p, .Close_Bracket);
 			elem := parse_type(p);
-			t := ast.new(ast.Multi_Pointer_Type, open.pos, elem.end_pos);
+			t := ast.new(ast.Multi_Pointer_Type, open.pos, elem.end);
 			t.open = open.pos;
 			t.pointer = tok.pos;
 			t.close = close.pos;