diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2015-12-15 14:59:03 -0800 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2015-12-19 11:17:13 -0800 |
commit | 8c707a4e2ffc30bae6d9ac3a28bd05fca0ff1195 (patch) | |
tree | 786b8ac916b5c873be902e8e3a1cbf9b38aaf53c /src/parse_constants.h | |
parent | 7188d94c1bdc483e6dca877631ca6dfa6af0ebbc (diff) |
Simplify parser implementation
Rather than returning a list of productions and an index,
return the relevant production directly from the rule function.
Also introduce a tag value (replacing production_idx) which tracks
information like command decorations, etc. with more clarity.
Diffstat (limited to 'src/parse_constants.h')
-rw-r--r-- | src/parse_constants.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/parse_constants.h b/src/parse_constants.h index 40ccc636..ce188d65 100644 --- a/src/parse_constants.h +++ b/src/parse_constants.h @@ -102,7 +102,9 @@ enum parse_keyword_t LAST_KEYWORD = parse_keyword_while } __packed; -/* Statement decorations. This matches the order of productions in decorated_statement */ +/* Node tag values */ + +/* Statement decorations, stored in node tag */ enum parse_statement_decoration_t { parse_statement_decoration_none, @@ -111,7 +113,7 @@ enum parse_statement_decoration_t parse_statement_decoration_exec }; -/* Boolean statement types */ +/* Boolean statement types, stored in node tag */ enum parse_bool_statement_type_t { parse_bool_and, @@ -119,6 +121,13 @@ enum parse_bool_statement_type_t parse_bool_not }; +/* Whether a statement is backgrounded */ +enum parse_optional_background_t +{ + parse_no_background, + parse_background +}; + /* Parse error code list */ enum parse_error_code_t { |