aboutsummaryrefslogtreecommitdiff
path: root/parse.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-03-18 13:49:42 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-03-18 13:49:42 -0400
commitd39e0aca2ef9f9be6027eaaf42f6c6ed8ab064db (patch)
tree123bca951daf40a0d1c66fb38e53599fa23d44c6 /parse.c
parent6027e3981432f464133370486c36c077215f3e6d (diff)
Implement parsing of 'pass'
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/parse.c b/parse.c
index f235bc82..14d18682 100644
--- a/parse.c
+++ b/parse.c
@@ -44,7 +44,7 @@ int op_tightness[] = {
static const char *keywords[] = {
"yes", "xor", "while", "when", "use", "then", "struct", "stop", "skip", "return",
- "or", "not", "no", "mod1", "mod", "lang", "in", "if", "func", "for", "extern",
+ "or", "not", "no", "mod1", "mod", "pass", "lang", "in", "if", "func", "for", "extern",
"enum", "else", "do", "and", "_mix_", "_min_", "_max_",
NULL,
};
@@ -1105,6 +1105,11 @@ PARSER(parse_text) {
return NewAST(ctx->file, start, pos, TextJoin, .lang=lang, .children=chunks);
}
+PARSER(parse_pass) {
+ const char *start = pos;
+ return match_word(&pos, "pass") ? NewAST(ctx->file, start, pos, Pass) : NULL;
+}
+
PARSER(parse_skip) {
const char *start = pos;
if (!match_word(&pos, "skip")) return NULL;
@@ -1187,6 +1192,7 @@ PARSER(parse_term_no_suffix) {
|| (term=parse_var(ctx, pos))
|| (term=parse_array(ctx, pos))
|| (term=parse_reduction(ctx, pos))
+ || (term=parse_pass(ctx, pos))
|| (term=parse_skip(ctx, pos))
|| (term=parse_stop(ctx, pos))
|| (term=parse_return(ctx, pos))