diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2013-12-27 01:38:43 -0800 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2013-12-27 01:38:43 -0800 |
commit | 6ce4b344e45baaa06bf593a5c0983da7a22eb64e (patch) | |
tree | 2358b60e771c42d29aeb26a03dd95f22cbd8ca15 /parse_tree.h | |
parent | a6ca809a4e4873f3fd16e4a763001a109afc2185 (diff) |
Hook up for statements, if statements, and function definition in new
parser
Diffstat (limited to 'parse_tree.h')
-rw-r--r-- | parse_tree.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/parse_tree.h b/parse_tree.h index 9a5d7c23..91cab426 100644 --- a/parse_tree.h +++ b/parse_tree.h @@ -65,7 +65,11 @@ enum parse_flag_include_comments = 1 << 1, /* Indicate that the tokenizer should accept incomplete tokens */ - parse_flag_accept_incomplete_tokens = 1 << 2 + parse_flag_accept_incomplete_tokens = 1 << 2, + + /* Indicate that the parser should not generate the terminate token, allowing an 'unfinished' tree where some nodes may have no productions. */ + parse_flag_leave_unterminated = 1 << 3 + }; typedef unsigned int parse_tree_flags_t; @@ -124,7 +128,7 @@ public: wcstring describe(void) const; /* Constructor */ - explicit parse_node_t(parse_token_type_t ty) : type(ty), source_start(-1), source_length(0), parent(NODE_OFFSET_INVALID), child_start(0), child_count(0) + explicit parse_node_t(parse_token_type_t ty) : type(ty), source_start(-1), source_length(0), parent(NODE_OFFSET_INVALID), child_start(0), child_count(0), production_idx(-1) { } @@ -244,7 +248,9 @@ public: for_header = FOR var_name IN argument_list while_header = WHILE job begin_header = BEGIN - function_header = FUNCTION function_name argument_list + +# Functions take arguments, and require at least one (the name) + function_header = FUNCTION argument argument_list # A boolean statement is AND or OR or NOT |