godot/modules/gdscript
Tan Wang Leng 7b1423a61e gdscript_parser: Fix "unreachable code" false positive for loops
Depending on the conditional statements of the 'for' and 'while' loops,
their body may not even execute once. For example:

    func a():
        var arr = []
        for i in arr:
            return i
        # can be reached, but analysis says cannot
        return -1

    func b():
        var should_loop = false
        while should_loop:
           return 1
        # can be reached, but analysis says cannot
        return 0

The parser will complain that the statements after the comment cannot
be reached, but it is clearly possible for our scenario. This is
because the parser falsely assumes that the loop body will always
execute at least once.

Fix the code to remove this assumption for both of those loops.
2020-05-16 20:02:55 +08:00
..
doc_classes [Core] Rename linear_interpolate to lerp 2020-04-29 04:02:49 -04:00
editor Style: Enforce braces around if blocks and loops 2020-05-14 21:57:34 +02:00
icons Fix missing module editor icons 2020-03-08 19:32:25 +02:00
language_server Fix incorrect capabilities notification in LSP 2020-05-15 23:55:49 +02:00
config.py DocData: Skip unexposed classes 2020-04-20 12:51:10 +02:00
gdscript_compiler.cpp Style: Enforce braces around if blocks and loops 2020-05-14 21:57:34 +02:00
gdscript_compiler.h Style: Enforce braces around if blocks and loops 2020-05-14 21:57:34 +02:00
gdscript_editor.cpp Style: Enforce braces around if blocks and loops 2020-05-14 21:57:34 +02:00
gdscript_function.cpp Style: Enforce braces around if blocks and loops 2020-05-14 21:57:34 +02:00
gdscript_function.h Style: Enforce braces around if blocks and loops 2020-05-14 21:57:34 +02:00
gdscript_functions.cpp Style: Enforce braces around if blocks and loops 2020-05-14 21:57:34 +02:00
gdscript_functions.h Reworked signal connection system, added support for Callable and Signal objects and made them default. 2020-02-20 08:24:50 +01:00
gdscript_parser.cpp gdscript_parser: Fix "unreachable code" false positive for loops 2020-05-16 20:02:55 +08:00
gdscript_parser.h break, continue outside of a loop, match statement handled 2020-05-15 03:16:50 +05:30
gdscript_tokenizer.cpp Style: Enforce braces around if blocks and loops 2020-05-14 21:57:34 +02:00
gdscript_tokenizer.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
gdscript.cpp Style: Enforce braces around if blocks and loops 2020-05-14 21:57:34 +02:00
gdscript.h Style: Enforce braces around if blocks and loops 2020-05-14 21:57:34 +02:00
register_types.cpp Style: Enforce braces around if blocks and loops 2020-05-14 21:57:34 +02:00
register_types.h Adding missing include guards to header files identified by LGTM. 2020-03-23 04:52:36 -04:00
SCsub SCons: Format buildsystem files with psf/black 2020-03-30 09:05:53 +02:00