def RightAssoc(*pairs): return lambda subexpr: \ recur(lambda expr: seclude(subexpr + alt([peg + expr + oper for peg, oper in pairs]).maybe()))
def Node(margin): return P.seclude(P.match(r'( {%d,})' % margin) + swallow(lambda indent: (line + Node(len(indent)+1).star()) >> P.hug))
def LeftAssoc(*pairs): return lambda subexpr: \ seclude(subexpr + alt([peg + subexpr + oper for peg, oper in pairs]).star())