aboutsummaryrefslogtreecommitdiff
path: root/parse.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-03-26 14:02:48 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-03-26 14:02:48 -0400
commit135e23094c42b33acdd05dd522bbe0fd691b9eee (patch)
tree68a675393083286a79d3f66e6f57aa4ac1ebd212 /parse.c
parent59b62035c1304b4c6c39b6d546b9c5187e8d0738 (diff)
Improve codegen for table/array iteration by inlining the iteration
macros
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/parse.c b/parse.c
index a8ef5cd3..5355f91e 100644
--- a/parse.c
+++ b/parse.c
@@ -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;