示例#1
0
文件: rparse.py 项目: emidln/pathod
 def expr(klass):
     parts = [i.expr() for i in klass.comps]
     atom = pp.MatchFirst(parts)
     resp = pp.And(
         [Method.expr(), Sep,
          Path.expr(),
          pp.ZeroOrMore(Sep + atom)])
     return resp
示例#2
0
 def expr(klass):
     parts = [i.expr() for i in klass.comps]
     atom = pp.MatchFirst(parts)
     resp = pp.And([
         pp.MatchFirst([
             WS.expr() + pp.Optional(Sep + Code.expr()),
             Code.expr(),
         ]),
         pp.ZeroOrMore(Sep + atom)
     ])
     resp = resp.setParseAction(klass)
     return resp
示例#3
0
 def expr(klass):
     parts = [i.expr() for i in klass.comps]
     atom = pp.MatchFirst(parts)
     resp = pp.And([WF.expr(), Sep, pp.ZeroOrMore(Sep + atom)])
     resp = resp.setParseAction(klass)
     return resp