def formpivot(self): ''' -> * -> #tag.match -> form:prop -> form ''' self.ignore(whitespace) self.nextmust('->') self.ignore(whitespace) if self.nextchar() == '#': match = self.tagmatch() return s_ast.PivotToTags(kids=(match,)) # check for pivot out syntax if self.nextchar() == '*': self.offs += 1 return s_ast.PivotOut() prop = self.absprop() return s_ast.FormPivot(kids=(prop,))
def formjoin(self): self.ignore(whitespace) self.nextmust('-+>') self.ignore(whitespace) # check for pivot out syntax if self.nextchar() == '*': self.offs += 1 return s_ast.PivotOut(isjoin=True) prop = self.absprop() return s_ast.FormPivot(kids=(prop,), isjoin=True)
'exprnot': s_ast.UnaryExprNode, 'exprcmp': s_ast.ExprNode, 'exprproduct': s_ast.ExprNode, 'exprsum': s_ast.ExprNode, 'filtoper': s_ast.FiltOper, 'forloop': s_ast.ForLoop, 'whileloop': s_ast.WhileLoop, 'formjoin_formpivot': lambda kids: s_ast.FormPivot(kids, isjoin=True), 'formjoin_pivotout': lambda _: s_ast.PivotOut(isjoin=True), 'formjoinin_pivotin': lambda kids: s_ast.PivotIn(kids, isjoin=True), 'formjoinin_pivotinfrom': lambda kids: s_ast.PivotInFrom(kids, isjoin=True), 'formpivot_': s_ast.FormPivot, 'formpivot_pivotout': s_ast.PivotOut, 'formpivot_pivottotags': s_ast.PivotToTags, 'formpivot_jointags': lambda kids: s_ast.PivotToTags(kids, isjoin=True), 'formpivotin_':