from hutt import string from hutt.dsl import parser as parser_wrap char = parser_wrap.wrap(string.char) one_of = parser_wrap.wrap(string.one_of) none_of = parser_wrap.wrap(string.none_of) word = parser_wrap.wrap(string.word) literal = parser_wrap.wrap(string.literal)
def _decorator(f): return parser_wrap.wrap(combinators.mapf_star(parser._parser))(f)
def parser(f): return parser_wrap.wrap(gen.parser(f))
from hutt.dsl import parser as parser_wrap from kessel import combinators try_ = parser_wrap.wrap(combinators.try_) choice = parser_wrap.wrap(combinators.choice) sequence = parser_wrap.wrap(combinators.sequence) sequence_l = parser_wrap.wrap(combinators.sequence_l) sequence_r = parser_wrap.wrap(combinators.sequence_r) count = parser_wrap.wrap(combinators.count) option = parser_wrap.wrap(combinators.option) many = parser_wrap.wrap(combinators.many) many1 = parser_wrap.wrap(combinators.many1) between = parser_wrap.wrap(combinators.between) sep_by = parser_wrap.wrap(combinators.sep_by) sep_by1 = parser_wrap.wrap(combinators.sep_by1) eof = parser_wrap.Parser(combinators.eof) suppress_expect = parser_wrap.wrap(combinators.suppress_expect) def mapf(parser): def _decorator(f): return parser_wrap.wrap(combinators.mapf(parser._parser))(f) return _decorator def mapf_star(parser): def _decorator(f): return parser_wrap.wrap(combinators.mapf_star(parser._parser))(f) return _decorator
from hutt.dsl import parser as parser_wrap from kessel import primitives ParseError = primitives.ParseError unit = parser_wrap.wrap(primitives.unit) match = parser_wrap.wrap(primitives.match) any_ = parser_wrap.Parser(primitives.any_) error = parser_wrap.wrap(primitives.error) class Proxy(parser_wrap.Parser): def __init__(self): super(Proxy, self).__init__(primitives.Proxy()) def bind(self, parser): self._parser.bind(parser._parser)