pyrser/passes/topython.py
def visit_RepOptional(self, node: parsing.RepOptional) -> ([ast.stmt] or
                                                               ast.expr):
        """Generates python code for an optional clause.

        <code for the clause>
        """
        cl_ast = self.visit(node.pt)
        if isinstance(cl_ast, ast.expr):
            return ast.BoolOp(ast.Or(), [cl_ast, ast.Name('True', ast.Load())])
        self.in_optional += 1
        cl_ast = self.visit(node.pt)
        self.in_optional -= 1
        return cl_ast
def visit_RepOptional(self, node: parsing.RepOptional) -> ([ast.stmt] or
                                                               ast.expr):
        cl_ast = self.visit(node.pt)
        if isinstance(cl_ast, ast.expr):
            return ast.BoolOp(ast.Or(), [cl_ast, ast.Name('True', ast.Load())])
        self.in_optional += 1
        cl_ast = self.visit(node.pt)
        self.in_optional -= 1
        return cl_ast
def visit_RepOptional ( self , node : parsing . RepOptional ) -> ( [ ast . stmt ] or ast . expr ) : cl_ast = self . visit ( node . pt ) if isinstance ( cl_ast , ast . expr ) : return ast . BoolOp ( ast . Or ( ) , [ cl_ast , ast . Name ( 'True' , ast . Load ( ) ) ] ) self . in_optional += 1 cl_ast = self . visit ( node . pt ) self . in_optional -= 1 return cl_ast
Generates python code for an optional clause.

        <code for the clause>
Generates python code for an optional clause .