示例#1
0
class Label(Grammar):
    grammar = (G(b'_("', WORD(b'^"'), b'")') | G(b"_('", WORD(b"^'"), b"')")
               | Variable)
示例#2
0
class InlineEditGrammar(Grammar):
    grammar = (OR(G(OR(b"field", b"create"), OPTIONAL(Label)), b"search"),
               b"from", Variable, OPTIONAL(b"for", Variable),
               OPTIONAL(b"in", Variable), b"withtemplate", Variable,
               OPTIONAL(b"withhelp", Label))
    grammar_whitespace = True
示例#3
0
class Variable(Grammar):
    grammar = (G(b'"', WORD(b'^"'), b'"') | G(b"'", WORD(b"^'"), b"'")
               | WORD(b"a-zA-Z_", b"a-zA-Z0-9_."))