INNER CODE UNIT · Python

end_line

Cooler2/ApusGameEngine · tools/normalize_indent.py:137

        end_line   = -1

        for k in range(j, n):
            ks   = lines[k].strip().lower()
            kind = get_indent(lines[k])

            if not found_open:
                # Abort conditions: crossed into a sibling or parent scope
                if kind <= proc_indent and k > j:
                    if _PROC_RE.match(ks) or ks in _SECTION_KW:
                        break
                # Detect the body `begin` (must be at the right indent level)
                if kind == proc_indent + 1 and (ks == 'begin' or ks.startswith('begin ')):
                    found_open = True
                    depth = 1  # the opening begin counts as +1
            else:
                depth += _block_delta(lines[k])
                if depth <= 0:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…