diff options
Diffstat (limited to 'src/tokenizer.cpp')
| -rw-r--r-- | src/tokenizer.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/tokenizer.cpp b/src/tokenizer.cpp index 331d5a1a9..3363f7f35 100644 --- a/src/tokenizer.cpp +++ b/src/tokenizer.cpp @@ -144,7 +144,7 @@ i32 token_pos_cmp(TokenPos a, TokenPos b) { return (a.line < b.line) ? -1 : +1; } -b32 token_pos_are_equal(TokenPos a, TokenPos b) { +bool token_pos_are_equal(TokenPos a, TokenPos b) { return token_pos_cmp(a, b) == 0; } @@ -253,19 +253,19 @@ void compiler_error(char *fmt, ...) { -gb_inline b32 token_is_literal(Token t) { +gb_inline bool token_is_literal(Token t) { return gb_is_between(t.kind, Token__LiteralBegin+1, Token__LiteralEnd-1); } -gb_inline b32 token_is_operator(Token t) { +gb_inline bool token_is_operator(Token t) { return gb_is_between(t.kind, Token__OperatorBegin+1, Token__OperatorEnd-1); } -gb_inline b32 token_is_keyword(Token t) { +gb_inline bool token_is_keyword(Token t) { return gb_is_between(t.kind, Token__KeywordBegin+1, Token__KeywordEnd-1); } -gb_inline b32 token_is_comparison(Token t) { +gb_inline bool token_is_comparison(Token t) { return gb_is_between(t.kind, Token__ComparisonBegin+1, Token__ComparisonEnd-1); } -gb_inline b32 token_is_shift(Token t) { +gb_inline bool token_is_shift(Token t) { return t.kind == Token_Shl || t.kind == Token_Shr; } @@ -350,8 +350,6 @@ void advance_to_next_rune(Tokenizer *t) { } TokenizerInitError init_tokenizer(Tokenizer *t, String fullpath) { - PROF_PROC(); - TokenizerInitError err = TokenizerInit_None; char *c_str = gb_alloc_array(heap_allocator(), char, fullpath.len+1); @@ -432,7 +430,7 @@ gb_inline void scan_mantissa(Tokenizer *t, i32 base) { } -Token scan_number_to_token(Tokenizer *t, b32 seen_decimal_point) { +Token scan_number_to_token(Tokenizer *t, bool seen_decimal_point) { Token token = {}; token.kind = Token_Integer; token.string = make_string(t->curr, 1); @@ -507,7 +505,7 @@ exponent: } // Quote == " for string -b32 scan_escape(Tokenizer *t, Rune quote) { +bool scan_escape(Tokenizer *t, Rune quote) { isize len = 0; u32 base = 0, max = 0, x = 0; |