* logging allocator. Wraps any allocator and prints what kind of allocations are happening.
* many math functions.
* basics of reading environment variables
+* Relative file inclusion using "./" at the start of the path
+* Basics of "notes" in the code. Basically special comments that allow you to easily search in the code.
+ Currently this is not something very useful in the language, but I wanted a way to write searchable
+ notes without having to parse comments. The syntax is "@Note".
Removals:
If the string starts with './', it should be considered relative.
This will make it easier for modules to include their files, regardless of
how the project is set up.
+
+ ✔ This has been done
Token_Type_Literal_True,
Token_Type_Literal_False,
+ Token_Type_Note,
+
Token_Type_Count,
} TokenType;
- match: '#[a-zA-Z_]+'
scope: keyword.other.onyx
+ - match: '@[a-zA-Z0-9_]+'
+ scope: meta.toc-list.task-tag.note.onyx
+
- match: '\$[a-zA-Z0-9_]+'
scope: constant.other.onyx
"true",
"false",
+ "NOTE"
+
"TOKEN_TYPE_COUNT"
};
goto token_parsed;
}
+ if (*tokenizer->curr == '@') {
+ INCREMENT_CURR_TOKEN(tokenizer);
+ u32 len = 2;
+ while (char_is_alphanum(*(tokenizer->curr + 1)) || *(tokenizer->curr + 1) == '_') {
+ len++;
+ INCREMENT_CURR_TOKEN(tokenizer);
+ }
+
+ tk.type = Token_Type_Note;
+ tk.length = len;
+ INCREMENT_CURR_TOKEN(tokenizer);
+ goto token_parsed;
+ }
+
// Number literal
if (char_is_num(*tokenizer->curr)
|| (*(tokenizer->curr) == '.' && char_is_num(*(tokenizer->curr + 1)))) {
parser->prev = parser->curr;
// :LinearTokenDependent
parser->curr++;
- while (parser->curr->type == Token_Type_Comment) parser->curr++;
+ while (parser->curr->type == Token_Type_Comment || parser->curr->type == Token_Type_Note)
+ parser->curr++;
}
static OnyxToken* find_matching_paren(OnyxToken* paren) {
i32 matched = 1;
+ // BUG: This does not take into consideration comments and notes that can occur between any tokens.
fori (i, 0, n) {
TokenType expected_type = va_arg(va, TokenType);
if (peek_token(i)->type != expected_type) {