}
```
+[ ] Polymorphic structs do not recognize default values for members.
+
[X] `TileData :: [TILE_DATA_WIDTH * TILE_DATA_HEIGHT] bool;` results in a
segfault because it is an invalid top level node, but that is not checked
before it is tried to be used.
2,
proc (a: f32) -> f32 { return ~~(a * 2); },
proc (b: f32) -> f64 { return ~~(b + 6); }));
-}
\ No newline at end of file
+
+
+ arr : [..] i32;
+ array.init(^arr);
+ defer array.free(^arr);
+
+
+ for i: 0 .. 10 do array.push(^arr, i);
+ print_array(arr);
+
+ array_map(arr, double);
+ print_array(arr);
+}
+
+array_map :: proc (arr: [..] $T, f: proc (T) -> T) {
+ for ^v: arr do *v = f(*v);
+}
+
+double :: proc (v: $V) -> V do return v * 2;
\ No newline at end of file
}
ParseResults onyx_parse(OnyxParser *parser) {
- // if (parser->curr->type == Token_Type_Keyword_Package) {
- // consume_token(parser);
-
- // OnyxToken* symbol = expect_token(parser, Token_Type_Symbol);
-
- // token_toggle_end(symbol);
- // Package *package = program_info_package_lookup_or_create(
- // parser->program,
- // symbol->text,
- // parser->program->global_scope,
- // parser->allocator);
- // token_toggle_end(symbol);
-
- // parser->package = package;
-
- // } else {
- // Package *package = program_info_package_lookup_or_create(
- // parser->program,
- // "main",
- // parser->program->global_scope,
- // parser->allocator);
-
- // parser->package = package;
- // }
+ // NOTE: Skip comments at the beginning of the file
+ if (parser->curr->type == Token_Type_Comment)
+ consume_token(parser);
parser->package = parse_package_name(parser)->package;
parser->file_scope = scope_create(parser->allocator, parser->package->private_scope, parser->tokenizer->tokens[0].pos);