Fix compile errors when compiling for msvc

This commit is contained in:
Krzosa Karol
2022-05-26 16:55:07 +02:00
parent c88b38cc44
commit 3cd79040bc
6 changed files with 48 additions and 32 deletions

View File

@@ -35,10 +35,17 @@ token_get(S64 i = 0){
return result;
}
function Token *
token_is_scope(){
Token *token = token_get();
if(lex_is_scope(token)) return token;
return 0;
}
function Token *
token_next(){
Token *token = token_get();
if(token_is_scope(token)) pctx->indent = token->indent;
if(lex_is_scope(token)) pctx->indent = token->indent;
pctx->token_iter++;
return token;
}
@@ -172,7 +179,7 @@ parse_block(){
Token *token = token_get();
if(token_match_keyword(keyword_return)){
AST_NEW(Return, AST_RETURN, token);
if(!token_is_scope(token_get())) result->expr = parse_expr();
if(!token_is_scope()) result->expr = parse_expr();
stmts.add(result);
}
else{