- match: '//'
scope: punctuation.definition.comment.onyx
push: line_comment
+ - match: '/\*'
+ scope: punctuation.definition.comment.onyx
+ push: block_comment
# Keywords are if, else for and while.
# Note that blackslashes don't need to be escaped within single quoted
- meta_scope: comment.line.onyx
- match: $
pop: true
+
+ block_comment:
+ - meta_scope: comment.block.onyx
+ - match: '\*/'
+ pop: true
+ - match: '/\*'
+ push: block_comment
\ No newline at end of file
}
+/* TODO: Make this work at some point
+ compose :: proc (a: $A, f: proc (A) -> $B, g: proc (B) -> $C) -> C {
+ return a |> f() |> g();
+ }
+*/
+
+
SOA :: struct {
b : [..] i64;
goto token_parsed;
}
+ if (*tokenizer->curr == '/' && *(tokenizer->curr + 1) == '*') {
+ tokenizer->curr += 2;
+ tk.type = Token_Type_Comment;
+ tk.text = tokenizer->curr;
+
+ i32 comment_depth = 1;
+
+ while (comment_depth > 0 && tokenizer->curr != tokenizer->end) {
+ if (*tokenizer->curr == '/' && *(tokenizer->curr + 1) == '*') {
+ tokenizer->curr += 2;
+ comment_depth += 1;
+ }
+
+ else if (*tokenizer->curr == '*' && *(tokenizer->curr + 1) == '/') {
+ tokenizer->curr += 2;
+ comment_depth -= 1;
+ }
+
+ else {
+ INCREMENT_CURR_TOKEN(tokenizer);
+ }
+ }
+
+ goto token_parsed;
+ }
+
// String literal
if (*tk.text == '"') {
u64 len = 0;
}
else if (parser->curr->type == '$') {
+ bh_arr(AstPolyParam) pv = NULL;
+
if (poly_vars == NULL)
onyx_report_error(parser->curr->pos, "polymorphic variable not valid here.");
+ else
+ pv = *poly_vars;
- bh_arr(AstPolyParam) pv = *poly_vars;
consume_token(parser);
AstNode* symbol_node = make_node(AstNode, Ast_Kind_Symbol);