def checkSubIndent(s,l,t): cur_col = col(l,s) if cur_col > indent_stack[-1]: indent_stack.append(cur_col) else: raise ParseException(s, l, "not a subentry")
def checkUnindent(s,l,t): if l >= len(s): return cur_col = col(l,s) if not(cur_col < indent_stack[-1] and cur_col <= indent_stack[-2]): raise ParseException(s, l, "not an unindent")
def checkPeerIndent(s,l,t): cur_col = col(l,s) if cur_col != indent_stack[-1]: if (not indent_stack) or cur_col > indent_stack[-1]: raise ParseFatalException(s, l, "illegal nesting") raise ParseException(s, l, "not a peer entry")