pyebnf/compiler.py
def _ast_op_repeat_to_code(self, opr, ignore_whitespace=False, **kwargs):
    """Convert an AST repeat op to python source code."""
    lines = ["one_or_more("]
    lines.extend(self._indent(self._ast_to_code(opr.operands[0])))
    lines[-1] += ","
    lines.append(self._indent("ignore_whitespace={}".format(bool(ignore_whitespace))))
    lines.append(")")
    return lines
def _ast_op_repeat_to_code(self, opr, ignore_whitespace=False, **kwargs):
    """Convert an AST repeat op to python source code."""
    lines = ["one_or_more("]
    lines.extend(self._indent(self._ast_to_code(opr.operands[0])))
    lines[-1] += ","
    lines.append(self._indent("ignore_whitespace={}".format(bool(ignore_whitespace))))
    lines.append(")")
    return lines
def _ast_op_repeat_to_code ( self , opr , ignore_whitespace = False , * * kwargs ) : lines = [ "one_or_more(" ] lines . extend ( self . _indent ( self . _ast_to_code ( opr . operands [ 0 ] ) ) ) lines [ - 1 ] += "," lines . append ( self . _indent ( "ignore_whitespace={}" . format ( bool ( ignore_whitespace ) ) ) ) lines . append ( ")" ) return lines
Convert an AST repeat op to python source code.
Convert an AST repeat op to python source code .