aboutsummaryrefslogtreecommitdiffhomepage
path: root/parse_tree.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-12-27 01:38:43 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-12-27 01:38:43 -0800
commit6ce4b344e45baaa06bf593a5c0983da7a22eb64e (patch)
tree2358b60e771c42d29aeb26a03dd95f22cbd8ca15 /parse_tree.cpp
parenta6ca809a4e4873f3fd16e4a763001a109afc2185 (diff)
Hook up for statements, if statements, and function definition in new
parser
Diffstat (limited to 'parse_tree.cpp')
-rw-r--r--parse_tree.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/parse_tree.cpp b/parse_tree.cpp
index e231eb9d..ad825a11 100644
--- a/parse_tree.cpp
+++ b/parse_tree.cpp
@@ -997,6 +997,12 @@ bool parse_t::parse_internal(const wcstring &str, parse_tree_flags_t parse_flags
queue[0] = queue[1];
queue[1] = next_parse_token(&tok);
+ /* If we are leaving things unterminated, then don't pass parse_token_type_terminate */
+ if (queue[0].type == parse_token_type_terminate && (parse_flags & parse_flag_leave_unterminated))
+ {
+ break;
+ }
+
/* Pass these two tokens. We know that queue[0] is valid; queue[1] may be invalid. */
this->parser->accept_tokens(queue[0], queue[1]);