diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-03-18 13:49:42 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-03-18 13:49:42 -0400 |
| commit | d39e0aca2ef9f9be6027eaaf42f6c6ed8ab064db (patch) | |
| tree | 123bca951daf40a0d1c66fb38e53599fa23d44c6 /parse.c | |
| parent | 6027e3981432f464133370486c36c077215f3e6d (diff) | |
Implement parsing of 'pass'
Diffstat (limited to 'parse.c')
| -rw-r--r-- | parse.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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)) |
