diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-03-26 14:02:48 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-03-26 14:02:48 -0400 |
| commit | 135e23094c42b33acdd05dd522bbe0fd691b9eee (patch) | |
| tree | 68a675393083286a79d3f66e6f57aa4ac1ebd212 /parse.c | |
| parent | 59b62035c1304b4c6c39b6d546b9c5187e8d0738 (diff) | |
Improve codegen for table/array iteration by inlining the iteration
macros
Diffstat (limited to 'parse.c')
| -rw-r--r-- | parse.c | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -1112,8 +1112,7 @@ PARSER(parse_pass) { PARSER(parse_skip) { const char *start = pos; if (!match_word(&pos, "skip")) return NULL; - spaces(&pos); - const char* target; + const char *target; if (match_word(&pos, "for")) target = "for"; else if (match_word(&pos, "while")) target = "while"; else target = get_id(&pos); @@ -1124,8 +1123,7 @@ PARSER(parse_skip) { PARSER(parse_stop) { const char *start = pos; if (!match_word(&pos, "stop")) return NULL; - spaces(&pos); - const char* target; + const char *target; if (match_word(&pos, "for")) target = "for"; else if (match_word(&pos, "while")) target = "while"; else target = get_id(&pos); @@ -1136,7 +1134,6 @@ PARSER(parse_stop) { PARSER(parse_return) { const char *start = pos; if (!match_word(&pos, "return")) return NULL; - spaces(&pos); ast_t *value = optional(ctx, &pos, parse_expr); ast_t *ret = NewAST(ctx->file, start, pos, Return, .value=value); return ret; |
