diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-08-28 07:52:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-28 07:52:04 +0200 |
commit | 758642488d29f696f1e4114bd2250248db65d2d1 (patch) | |
tree | a9828035d2587d63a868daeff8fc349728bd84c2 /modules | |
parent | b9fa78bd8c77e5f33b0a21cbd5b193eea07947b9 (diff) | |
parent | a8826ad3b8cececd6e49fc2caaed56b3f220333d (diff) |
Merge pull request #31731 from YeldhamDev/break_continue_safe
Make 'break' and 'continue' be marked as safe
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gdscript/gdscript_parser.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index a07b575c6e..07f364c85b 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -2767,12 +2767,12 @@ void GDScriptParser::_parse_block(BlockNode *p_block, bool p_static) { _mark_line_as_safe(tokenizer->get_token_line()); tokenizer->advance(); if (tokenizer->get_token() == GDScriptTokenizer::TK_SEMICOLON) { - // Ignore semicolon after 'pass' + // Ignore semicolon after 'pass'. tokenizer->advance(); } } break; case GDScriptTokenizer::TK_PR_VAR: { - //variale declaration and (eventual) initialization + // Variable declaration and (eventual) initialization. tokenizer->advance(); int var_line = tokenizer->get_token_line(); @@ -3171,6 +3171,7 @@ void GDScriptParser::_parse_block(BlockNode *p_block, bool p_static) { } break; case GDScriptTokenizer::TK_CF_CONTINUE: { + _mark_line_as_safe(tokenizer->get_token_line()); tokenizer->advance(); ControlFlowNode *cf_continue = alloc_node<ControlFlowNode>(); cf_continue->cf_type = ControlFlowNode::CF_CONTINUE; @@ -3182,6 +3183,7 @@ void GDScriptParser::_parse_block(BlockNode *p_block, bool p_static) { } break; case GDScriptTokenizer::TK_CF_BREAK: { + _mark_line_as_safe(tokenizer->get_token_line()); tokenizer->advance(); ControlFlowNode *cf_break = alloc_node<ControlFlowNode>(); cf_break->cf_type = ControlFlowNode::CF_BREAK; |