INNER CODE UNIT · Python

j

Cooler2/ApusGameEngine · tools/normalize_indent.py:117

        j = i + 1
        while j < n and not lines[j].strip():
            j += 1
        if j >= n:
            continue

        nxt_s   = lines[j].strip().lower()
        nxt_ind = get_indent(lines[j])

        # Body follows when var/begin/const/type appear exactly one level deeper
        body_starters = ('var', 'begin', 'const', 'type')
        if not (nxt_ind == proc_indent + 1 and
                (nxt_s in body_starters or nxt_s.startswith('begin '))):
            continue

        # Scan forward to find the body `begin` (at exactly proc_indent+1)
        # and then its matching `end`.
        # Abort if we cross another proc/section at the same or higher level.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…