Module ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias alias alias ImportFrom alias alias ImportFrom alias ImportFrom alias alias alias alias alias ImportFrom alias ImportFrom alias ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Assign NameStore Str Expr Call NameLoad Call AttributeLoad SubscriptLoad NameLoad Index Str attr NameLoad Call NameLoad Str NameLoad Num Num keyword ListLoad Call NameLoad Str NameLoad Num Num Call NameLoad Str NameLoad Num Num Assign NameStore Str Expr Call NameLoad Call AttributeLoad SubscriptLoad NameLoad Index Str attr NameLoad Call NameLoad Str NameLoad Num Num keyword ListLoad Call NameLoad Str NameLoad Num Num Call NameLoad Str NameLoad Num Num Assign NameStore Str Expr Call NameLoad Call AttributeLoad SubscriptLoad NameLoad Index Str attr NameLoad Call NameLoad Str NameLoad Num Num keyword ListLoad Call NameLoad Str NameLoad Num Num Call NameLoad Str NameLoad Num Num decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Str Expr Call NameLoad Call AttributeLoad SubscriptLoad NameLoad Index Str attr NameLoad Call NameLoad Str NameLoad Num Call NameLoad NameLoad keyword ListLoad Call NameLoad Str NameLoad Num Call NameLoad NameLoad Assign NameStore Str Expr Call NameLoad Call AttributeLoad SubscriptLoad NameLoad Index Str attr NameLoad Call NameLoad Str NameLoad Num Num keyword ListLoad Call NameLoad Str NameLoad Num Num decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Str Expr Call NameLoad Call AttributeLoad SubscriptLoad NameLoad Index Str attr NameLoad Call NameLoad Str NameLoad Num Call NameLoad NameLoad keyword ListLoad Call NameLoad Str NameLoad Num Num Call NameLoad Str NameLoad Num Num keyword ListLoad Call NameLoad Str NameLoad Num Num Call NameLoad Str NameLoad Num Num Call NameLoad Str NameLoad Num Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call NameLoad Call AttributeLoad SubscriptLoad NameLoad Index Str attr Str Expr Call NameLoad Call AttributeLoad SubscriptLoad NameLoad Index Str attr Str Expr Call NameLoad Call AttributeLoad SubscriptLoad NameLoad Index Str attr Str Expr Call NameLoad Call AttributeLoad SubscriptLoad NameLoad Index Str attr Str Expr Call NameLoad Call AttributeLoad SubscriptLoad NameLoad Index Str attr Str Expr Call NameLoad Call AttributeLoad SubscriptLoad NameLoad Index Str attr Str Expr Call NameLoad Call AttributeLoad SubscriptLoad NameLoad Index Str attr Str Expr Call NameLoad Call AttributeLoad SubscriptLoad NameLoad Index Str attr Str Expr Call NameLoad Call AttributeLoad SubscriptLoad NameLoad Index Str attr Str Expr Call NameLoad Call AttributeLoad SubscriptLoad NameLoad Index Str attr Str Expr Call NameLoad Call AttributeLoad SubscriptLoad NameLoad Index Str attr Str Expr Call NameLoad Call AttributeLoad SubscriptLoad NameLoad Index Str attr Str Expr Call NameLoad Call AttributeLoad SubscriptLoad NameLoad Index Str attr Str Expr Call NameLoad Call AttributeLoad SubscriptLoad NameLoad Index Str attr Str Expr Call NameLoad Call AttributeLoad SubscriptLoad NameLoad Index Str attr Str Expr Call NameLoad Call AttributeLoad SubscriptLoad NameLoad Index Str attr Str Expr Call NameLoad Call AttributeLoad SubscriptLoad NameLoad Index Str attr Str Expr Call NameLoad Call AttributeLoad SubscriptLoad NameLoad Index Str attr Str Expr Call NameLoad Call AttributeLoad SubscriptLoad NameLoad Index Str attr Str Expr Call NameLoad Call AttributeLoad SubscriptLoad NameLoad Index Str attr Str Expr Call NameLoad Call AttributeLoad SubscriptLoad NameLoad Index Str attr Str Expr Call NameLoad Call AttributeLoad SubscriptLoad NameLoad Index Str attr Str Expr Call NameLoad Call AttributeLoad NameLoad attr Str decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Str Assign TupleStore NameStore NameStore Call AttributeLoad Call NameLoad attr NameLoad Assign NameStore Str Expr Call NameLoad Call AttributeLoad NameLoad attr NameLoad Call NameLoad Str NameLoad Num Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call NameLoad NameLoad AttributeLoad Call NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Str Assign TupleStore NameStore NameStore Call AttributeLoad Call NameLoad attr NameLoad Assign NameStore Str Expr Call NameLoad Call AttributeLoad NameLoad attr NameLoad Call NameLoad Str NameLoad Num Num keyword ListLoad Call NameLoad Str NameLoad Num Num decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call NameLoad NameLoad Call NameLoad Str Str Num Num keyword ListLoad Call NameLoad Str Str Num Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad Str Assign NameStore Call AttributeLoad Call NameLoad NameLoad attr Expr Call NameLoad SubscriptLoad NameLoad Index Num Str Expr Call NameLoad CompareIn BinOpMod Str IfExp CompareGtE NameLoad TupleLoad Num Str Str NameLoad Expr Call NameLoad CompareIn Str NameLoad Expr Call NameLoad CompareIn Str NameLoad Expr Call NameLoad Call NameLoad NameLoad Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad Str Assign NameStore Str Expr Call NameLoad Call AttributeLoad NameLoad attr NameLoad keyword Num Call NameLoad Str NameLoad Num Num keyword ListLoad Call NameLoad Str NameLoad Num Num Call NameLoad Str NameLoad Num Num Call NameLoad Str NameLoad Num Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call NameLoad NameLoad NameLoad Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad Str Expr Call NameLoad Call NameLoad Call NameLoad Call AttributeLoad Call NameLoad NameLoad attr ListLoad Str Str BinOpMod Str IfExp CompareGtE NameLoad TupleLoad Num Str Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad Str Expr Call NameLoad CompareIsNot Call AttributeLoad NameLoad attr Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad Str Expr Call NameLoad NameLoad AttributeLoad NameLoad attr Str Expr Call NameLoad CompareIsNot Call AttributeLoad NameLoad attr Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad Str Expr Call NameLoad NameLoad AttributeLoad NameLoad attr Str Assign NameStore Str Expr Call NameLoad Call AttributeLoad NameLoad attr Str Call NameLoad Str NameLoad Num Num keyword ListLoad Call NameLoad Str NameLoad Num Num Call NameLoad Str NameLoad Num Num decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad Str Expr Call NameLoad NameLoad AttributeLoad NameLoad attr Str Assign NameStore Str Expr Call NameLoad Call NameLoad Call AttributeLoad NameLoad attr NameLoad Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad Str Expr Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call NameLoad Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad Str Expr Call NameLoad CompareIsNot Call AttributeLoad NameLoad attr Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Raise Call NameLoad Str Assign NameStore Call NameLoad Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad Call NameLoad Str attr Str decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad Call NameLoad Str attr Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad Str keyword Lambda arguments args NameParam NameParam defaults IfExp Call AttributeLoad SubscriptLoad NameLoad Index NameLoad attr BinOpAdd NameLoad Num NameLoad Assign NameStore Str Expr Call NameLoad Call AttributeLoad NameLoad attr NameLoad Call NameLoad Str NameLoad Num Num keyword ListLoad Call NameLoad Str NameLoad Num Num Call NameLoad Str NameLoad Num Num Call NameLoad Str NameLoad Num Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad Str keyword Lambda arguments args NameParam NameParam NameParam NameParam NameParam defaults Call AttributeLoad SubscriptLoad NameLoad Index Str attr NameLoad NameLoad NameLoad NameLoad Assign NameStore Str Expr Call NameLoad Call AttributeLoad NameLoad attr NameLoad Call NameLoad Str NameLoad Num Num keyword ListLoad Call NameLoad Str NameLoad Num Num Call NameLoad Str NameLoad Num Num Call NameLoad Str NameLoad Num Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad Call NameLoad Str keyword Call NameLoad Call NameLoad Str Call NameLoad Str keyword Str attr Str Assign NameStore Str Expr Call NameLoad Call AttributeLoad NameLoad attr NameLoad Call NameLoad Str NameLoad Num Num keyword ListLoad Call NameLoad Str NameLoad Num Num Call NameLoad Str NameLoad Num Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad Call NameLoad keyword Lambda arguments args NameParam NameParam defaults BinOpAdd NameLoad Num attr Str Assign NameStore Str Expr Call NameLoad Call AttributeLoad NameLoad attr NameLoad Call NameLoad Str NameLoad Num Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad Str Expr Call NameLoad Call AttributeLoad NameLoad attr Str Call NameLoad Str Str Num Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad Str FunctionDef arguments args NameParam defaults body Assign SubscriptStore NameLoad Index Str Num decorator_list Expr Call NameLoad NameLoad NameLoad ListLoad NameLoad FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad decorator_list Expr Call NameLoad NameLoad NameLoad ListLoad NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad Call NameLoad Str Call NameLoad Str Assign NameStore Call NameLoad Str Expr Call NameLoad Call AttributeLoad NameLoad attr NameLoad Call NameLoad Str NameLoad Num Num keyword ListLoad Call NameLoad Str NameLoad Num Num Call NameLoad Str NameLoad Num Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad Str Expr Call NameLoad NameLoad AttributeLoad NameLoad attr ListLoad Call NameLoad Str Call NameLoad Str decorator_list decorator_list
N/A sys version_info unittest TestCase nose SkipTest nose.tools eq_ assert_raises ok_ parsimonious.exceptions UndefinedLabel ParseError parsimonious.expressions Sequence parsimonious.grammar rule_grammar RuleVisitor Grammar TokenGrammar LazyReference parsimonious.nodes Node parsimonious.utils Token BootstrappingGrammarTests N/A TestCase N/A N/A Tests for the expressions in the grammar that parses the grammar
    definition syntax test_quantifier N/A N/A self N/A N/A N/A text * N/A N/A eq_ N/A N/A N/A rule_grammar N/A quantifier parse text N/A Node quantifier text 0 1 children N/A N/A Node text 0 1 N/A Node _ text 1 1 N/A text ? N/A N/A eq_ N/A N/A N/A rule_grammar N/A quantifier parse text N/A Node quantifier text 0 1 children N/A N/A Node text 0 1 N/A Node _ text 1 1 N/A text + N/A N/A eq_ N/A N/A N/A rule_grammar N/A quantifier parse text N/A Node quantifier text 0 1 children N/A N/A Node text 0 1 N/A Node _ text 1 1 N/A test_spaceless_literal N/A N/A self N/A N/A N/A text "anything but quotes#$*&^" N/A N/A eq_ N/A N/A N/A rule_grammar N/A spaceless_literal parse text N/A Node spaceless_literal text 0 N/A len text children N/A N/A Node text 0 N/A len text N/A text r"\"" N/A N/A eq_ N/A N/A N/A rule_grammar N/A spaceless_literal parse text N/A Node spaceless_literal text 0 5 children N/A N/A Node text 0 5 N/A test_regex N/A N/A self N/A N/A N/A text ~"[a-zA-Z_][a-zA-Z_0-9]*"LI N/A N/A eq_ N/A N/A N/A rule_grammar N/A regex parse text N/A Node regex text 0 N/A len text children N/A N/A Node text 0 1 N/A Node spaceless_literal text 1 25 children N/A N/A Node text 1 25 N/A Node text 25 27 N/A Node _ text 27 27 N/A test_successes N/A N/A self N/A N/A N/A Make sure the PEG recognition grammar succeeds on various inputs. N/A N/A ok_ N/A N/A N/A rule_grammar N/A label parse _ N/A N/A ok_ N/A N/A N/A rule_grammar N/A label parse jeff N/A N/A ok_ N/A N/A N/A rule_grammar N/A label parse _THIS_THING N/A N/A ok_ N/A N/A N/A rule_grammar N/A atom parse some_label N/A N/A ok_ N/A N/A N/A rule_grammar N/A atom parse "some literal" N/A N/A ok_ N/A N/A N/A rule_grammar N/A atom parse ~"some regex"i N/A N/A ok_ N/A N/A N/A rule_grammar N/A quantified parse ~"some regex"i* N/A N/A ok_ N/A N/A N/A rule_grammar N/A quantified parse thing+ N/A N/A ok_ N/A N/A N/A rule_grammar N/A quantified parse "hi"? N/A N/A ok_ N/A N/A N/A rule_grammar N/A term parse this N/A N/A ok_ N/A N/A N/A rule_grammar N/A term parse that+ N/A N/A ok_ N/A N/A N/A rule_grammar N/A sequence parse this that? other N/A N/A ok_ N/A N/A N/A rule_grammar N/A ored parse this / that+ / "other" N/A N/A ok_ N/A N/A N/A rule_grammar N/A lookahead_term parse &this+ N/A N/A ok_ N/A N/A N/A rule_grammar N/A expression parse this N/A N/A ok_ N/A N/A N/A rule_grammar N/A expression parse this? that other* N/A N/A ok_ N/A N/A N/A rule_grammar N/A expression parse &this / that+ / "other" N/A N/A ok_ N/A N/A N/A rule_grammar N/A expression parse this / that? / "other"+ N/A N/A ok_ N/A N/A N/A rule_grammar N/A expression parse this? that other* N/A N/A ok_ N/A N/A N/A rule_grammar N/A rule parse this = that
 N/A N/A ok_ N/A N/A N/A rule_grammar N/A rule parse this = the? that other* 	
 N/A N/A ok_ N/A N/A N/A rule_grammar N/A rule parse the=~"hi*"
 N/A N/A ok_ N/A N/A rule_grammar parse 
            this = the? that other*
            that = "thing"
            the=~"hi*"
            other = "ahoy hoy"
             N/A N/A RuleVisitorTests N/A TestCase N/A N/A Tests for ``RuleVisitor``

    As I write these, Grammar is not yet fully implemented. Normally, there'd
    be no reason to use ``RuleVisitor`` directly.

     test_round_trip N/A N/A self N/A N/A N/A Test a simple round trip.

        Parse a simple grammar, turn the parse tree into a map of expressions,
        and use that to parse another piece of text.

        Not everything was implemented yet, but it was a big milestone and a
        proof of concept.

         N/A tree N/A N/A rule_grammar parse number = ~"[0-9]+"
 N/A N/A rules default_rule N/A N/A N/A RuleVisitor visit tree N/A text 98 N/A N/A eq_ N/A N/A default_rule parse text N/A Node number text 0 2 N/A test_undefined_rule N/A N/A self N/A N/A N/A Make sure we throw the right exception on undefined rules. N/A tree N/A N/A rule_grammar parse boy = howdy
 N/A N/A assert_raises UndefinedLabel N/A N/A RuleVisitor visit tree N/A test_optional N/A N/A self N/A N/A N/A tree N/A N/A rule_grammar parse boy = "howdy"?
 N/A N/A rules default_rule N/A N/A N/A RuleVisitor visit tree N/A howdy howdy N/A N/A eq_ N/A N/A default_rule parse howdy N/A Node boy howdy 0 5 children N/A N/A Node howdy 0 5 N/A N/A GrammarTests N/A TestCase N/A N/A Integration-test ``Grammar``: feed it a PEG and see if it works. test_expressions_from_rules N/A N/A self N/A N/A N/A Test the ``Grammar`` base class's ability to compile an expression
        tree from rules.

        That the correct ``Expression`` tree is built is already tested in
        ``RuleGrammarTests``. This tests only that the ``Grammar`` base class's
        ``_expressions_from_rules`` works.

         N/A greeting_grammar N/A Grammar greeting = "hi" / "howdy" N/A tree N/A N/A greeting_grammar parse hi N/A N/A eq_ tree N/A Node greeting hi 0 2 children N/A N/A Node hi 0 2 N/A test_unicode N/A N/A self N/A N/A N/A Assert that a ``Grammar`` can convert into a string-formatted series
        of rules. N/A grammar N/A Grammar 
                          bold_text  = bold_open text bold_close
                          text       = ~"[A-Z 0-9]*"i
                          bold_open  = "(("
                          bold_close = "))"
                           N/A lines N/A N/A N/A unicode grammar splitlines N/A N/A eq_ N/A lines N/A 0 bold_text = bold_open text bold_close N/A N/A ok_ N/A N/A text = ~"[A-Z 0-9]*"i%s N/A N/A version_info N/A 3 u lines N/A N/A ok_ N/A bold_open = "((" lines N/A N/A ok_ N/A bold_close = "))" lines N/A N/A eq_ N/A len lines 4 N/A test_match N/A N/A self N/A N/A N/A Make sure partial-matching (with pos) works. N/A grammar N/A Grammar 
                          bold_text  = bold_open text bold_close
                          text       = ~"[A-Z 0-9]*"i
                          bold_open  = "(("
                          bold_close = "))"
                           N/A s  ((boo))yah N/A N/A eq_ N/A N/A grammar match s pos 1 N/A Node bold_text s 1 8 children N/A N/A Node bold_open s 1 3 N/A Node text s 3 6 N/A Node bold_close s 6 8 N/A test_bad_grammar N/A N/A self N/A N/A N/A Constructing a Grammar with bad rules should raise ParseError. N/A N/A assert_raises ParseError Grammar just a bunch of junk N/A test_comments N/A N/A self N/A N/A N/A Test tolerance of comments and blank lines in and around rules. N/A grammar N/A Grammar # This is a grammar.

                          # It sure is.
                          bold_text  = stars text stars  # nice
                          text       = ~"[A-Z 0-9]*"i #dude


                          stars      = "**"
                          # Pretty good
                          #Oh yeah.# N/A N/A eq_ N/A list N/A sorted N/A N/A N/A str grammar splitlines N/A bold_text = stars text stars stars = "**" N/A text = ~"[A-Z 0-9]*"i%s N/A N/A version_info N/A 3 u N/A test_multi_line N/A N/A self N/A N/A N/A Make sure we tolerate all sorts of crazy line breaks and comments in
        the middle of rules. N/A grammar N/A Grammar 
            bold_text  = bold_open  # commenty comment
                         text  # more comment
                         bold_close
            text       = ~"[A-Z 0-9]*"i
            bold_open  = "((" bold_close =  "))"
             N/A N/A ok_ N/A N/A N/A grammar parse ((booyah)) None N/A test_not N/A N/A self N/A N/A N/A Make sure "not" predicates get parsed and work properly. N/A grammar N/A Grammar not_arp = !"arp" ~"[a-z]+" N/A N/A assert_raises ParseError N/A grammar parse arp N/A N/A ok_ N/A N/A N/A grammar parse argle None N/A test_lookahead N/A N/A self N/A N/A N/A grammar N/A Grammar starts_with_a = &"a" ~"[a-z]+" N/A N/A assert_raises ParseError N/A grammar parse burp N/A s arp N/A N/A eq_ N/A N/A grammar parse arp N/A Node starts_with_a s 0 3 children N/A N/A Node s 0 0 N/A Node s 0 3 N/A test_parens N/A N/A self N/A N/A N/A grammar N/A Grammar sequence = "chitty" (" " "bang")+ N/A N/A assert_raises ParseError N/A grammar parse chitty bangbang N/A s chitty bang bang N/A N/A eq_ N/A str N/A N/A grammar parse s <Node called "sequence" matching "chitty bang bang">
    <Node matching "chitty">
    <Node matching " bang bang">
        <Node matching " bang">
            <Node matching " ">
            <Node matching "bang">
        <Node matching " bang">
            <Node matching " ">
            <Node matching "bang"> N/A test_resolve_refs_order N/A N/A self N/A N/A N/A Smoke-test a circumstance where lazy references don't get resolved. N/A grammar N/A Grammar 
            expression = "(" terms ")"
            terms = term+
            term = number
            number = ~r"[0-9]+"
             N/A N/A N/A grammar parse (34) N/A test_infinite_loop N/A N/A self N/A N/A N/A Smoke-test a grammar that was causing infinite loops while building.

        This was going awry because the "int" rule was never getting marked as
        resolved, so it would just keep trying to resolve it over and over.

         N/A N/A Grammar 
            digits = digit+
            int = digits
            digit = ~"[0-9]"
            number = int
            main = number
             N/A test_right_recursive N/A N/A self N/A N/A N/A Right-recursive refs should resolve. N/A grammar N/A Grammar 
            digits = digit digits?
            digit = ~r"[0-9]"
             N/A N/A ok_ N/A N/A N/A grammar parse 12 None N/A test_badly_circular N/A N/A self N/A N/A N/A Uselessly circular references should be detected by the grammar
        compiler. N/A N/A SkipTest We have yet to make the grammar compiler detect these. N/A grammar N/A Grammar 
            foo = bar
            bar = foo
             N/A test_parens_with_leading_whitespace N/A N/A self N/A N/A N/A Make sure a parenthesized expression is allowed to have leading
        whitespace when nested directly inside another. N/A N/A N/A N/A Grammar foo = ( ("c") ) parse c N/A test_single_quoted_literals N/A N/A self N/A N/A N/A N/A N/A N/A Grammar foo = 'a' '"' parse a" N/A test_simple_custom_rules N/A N/A self N/A N/A N/A Run 2-arg custom-coded rules through their paces. N/A grammar N/A Grammar 
            bracketed_digit = start digit end
            start = '['
            end = ']' digit N/A N/A N/A text pos N/A N/A N/A N/A N/A text N/A pos isdigit N/A pos 1 None N/A s [6] N/A N/A eq_ N/A N/A grammar parse s N/A Node bracketed_digit s 0 3 children N/A N/A Node start s 0 1 N/A Node digit s 1 2 N/A Node end s 2 3 N/A test_complex_custom_rules N/A N/A self N/A N/A N/A Run 5-arg custom rules through their paces.

        Incidentally tests returning an actual Node from the custom rule.

         N/A grammar N/A Grammar 
            bracketed_digit = start digit end
            start = '['
            end = ']'
            real_digit = '6' digit N/A N/A N/A text pos cache error grammar N/A N/A N/A N/A grammar N/A real_digit match_core text pos cache error N/A s [6] N/A N/A eq_ N/A N/A grammar parse s N/A Node bracketed_digit s 0 3 children N/A N/A Node start s 0 1 N/A Node real_digit s 1 2 N/A Node end s 2 3 N/A test_lazy_custom_rules N/A N/A self N/A N/A N/A Make sure LazyReferences manually shoved into custom rules are
        resolved.

        Incidentally test passing full-on Expressions as custom rules and
        having a custom rule as the default one.

         N/A grammar N/A N/A N/A Grammar 
            four = '4'
            five = '5' forty_five N/A Sequence N/A LazyReference four N/A LazyReference five name forty_five default forty_five N/A s 45 N/A N/A eq_ N/A N/A grammar parse s N/A Node forty_five s 0 2 children N/A N/A Node four s 0 1 N/A Node five s 1 2 N/A test_unconnected_custom_rules N/A N/A self N/A N/A N/A Make sure custom rules that aren't hooked to any other rules still
        get included in the grammar and that lone ones get set as the
        default.

        Incidentally test Grammar's `rules` default arg.

         N/A grammar N/A N/A N/A Grammar one_char N/A N/A N/A text pos N/A N/A pos 1 default one_char N/A s 4 N/A N/A eq_ N/A N/A grammar parse s N/A Node one_char s 0 1 N/A test_lazy_default_rule N/A N/A self N/A N/A N/A Make sure we get an actual rule set as our default rule, even when
        the first rule has forward references and is thus a LazyReference at
        some point during grammar compilation.

         N/A grammar N/A Grammar 
            styled_text = text
            text        = "hi"
             N/A N/A eq_ N/A N/A grammar parse hi N/A Node text hi 0 2 N/A test_immutable_grammar N/A N/A self N/A N/A N/A Make sure that a Grammar is immutable after being created. N/A grammar N/A Grammar 
            foo = 'bar'
         mod_grammar N/A N/A grammar N/A N/A N/A N/A grammar N/A foo 1 N/A N/A N/A assert_raises TypeError mod_grammar N/A grammar mod_grammar N/A N/A grammar N/A N/A N/A new_grammar N/A Grammar 
                baz = 'biff'
             N/A N/A N/A grammar update new_grammar N/A N/A N/A assert_raises AttributeError mod_grammar N/A grammar N/A N/A TokenGrammarTests N/A TestCase N/A N/A Tests for the TokenGrammar class and associated machinery test_parse_success N/A N/A self N/A N/A N/A Token literals should work. N/A s N/A N/A Token token1 N/A Token token2 N/A grammar N/A TokenGrammar 
            foo = token1 "token2"
            token1 = "token1"
             N/A N/A eq_ N/A N/A grammar parse s N/A Node foo s 0 2 children N/A N/A Node token1 s 0 1 N/A Node s 1 2 N/A test_parse_failure N/A N/A self N/A N/A N/A Parse failures should work normally with token literals. N/A grammar N/A TokenGrammar 
            foo = "token1" "token2"
             N/A N/A assert_raises ParseError N/A grammar parse N/A N/A Token tokenBOO N/A Token token2 N/A N/A