Qucs-S S-parameter Viewer & RF Synthesis Tools
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
parsimonious.tests.test_grammar.GrammarTests Class Reference
Inheritance diagram for parsimonious.tests.test_grammar.GrammarTests:
Inheritance graph
[legend]
Collaboration diagram for parsimonious.tests.test_grammar.GrammarTests:
Collaboration graph
[legend]

Public Member Functions

 method_rule (self, text, pos)
 
 test_expressions_from_rules (self)
 
 test_unicode (self)
 
 test_match (self)
 
 test_bad_grammar (self)
 
 test_comments (self)
 
 test_multi_line (self)
 
 test_not (self)
 
 test_lookahead (self)
 
 test_parens (self)
 
 test_resolve_refs_order (self)
 
 test_resolve_refs_completeness (self)
 
 test_infinite_loop (self)
 
 test_circular_toplevel_reference (self)
 
 test_right_recursive (self)
 
 test_badly_circular (self)
 
 test_parens_with_leading_whitespace (self)
 
 test_single_quoted_literals (self)
 
 test_simple_custom_rules (self)
 
 test_complex_custom_rules (self)
 
 test_lazy_custom_rules (self)
 
 test_unconnected_custom_rules (self)
 
 test_callability_of_routines (self)
 
 test_callability_custom_rules (self)
 
 test_lazy_default_rule (self)
 
 test_immutable_grammar (self)
 
 test_repr (self)
 
 test_rule_ordering_is_preserved (self)
 
 test_rule_ordering_is_preserved_on_shallow_copies (self)
 
 test_repetitions (self)
 
 test_equal (self)
 

Static Public Member Functions

 descriptor_rule (text, pos)
 

Public Attributes

 method_rule
 

Static Public Attributes

dict rules = {"descriptor_rule": descriptor_rule}
 

Detailed Description

Integration-test ``Grammar``: feed it a PEG and see if it works.

Member Function Documentation

◆ descriptor_rule()

parsimonious.tests.test_grammar.GrammarTests.descriptor_rule (   text,
  pos 
)
static
This is an example of a grammar rule implemented as a descriptor,
and is provided as a test fixture.

◆ method_rule()

parsimonious.tests.test_grammar.GrammarTests.method_rule (   self,
  text,
  pos 
)
This is an example of a grammar rule implemented as a method, and is
provided as a test fixture.

◆ test_bad_grammar()

parsimonious.tests.test_grammar.GrammarTests.test_bad_grammar (   self)
Constructing a Grammar with bad rules should raise ParseError.

◆ test_badly_circular()

parsimonious.tests.test_grammar.GrammarTests.test_badly_circular (   self)
Uselessly circular references should be detected by the grammar
compiler.

◆ test_callability_custom_rules()

parsimonious.tests.test_grammar.GrammarTests.test_callability_custom_rules (   self)
Confirms that functions, methods and method descriptors can all be
used to supply custom grammar rules.

◆ test_comments()

parsimonious.tests.test_grammar.GrammarTests.test_comments (   self)
Test tolerance of comments and blank lines in and around rules.

◆ test_complex_custom_rules()

parsimonious.tests.test_grammar.GrammarTests.test_complex_custom_rules (   self)
Run 5-arg custom rules through their paces.

Incidentally tests returning an actual Node from the custom rule.

◆ test_expressions_from_rules()

parsimonious.tests.test_grammar.GrammarTests.test_expressions_from_rules (   self)
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.

◆ test_immutable_grammar()

parsimonious.tests.test_grammar.GrammarTests.test_immutable_grammar (   self)
Make sure that a Grammar is immutable after being created.

◆ test_infinite_loop()

parsimonious.tests.test_grammar.GrammarTests.test_infinite_loop (   self)
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.

◆ test_lazy_custom_rules()

parsimonious.tests.test_grammar.GrammarTests.test_lazy_custom_rules (   self)
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.

◆ test_lazy_default_rule()

parsimonious.tests.test_grammar.GrammarTests.test_lazy_default_rule (   self)
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.

◆ test_match()

parsimonious.tests.test_grammar.GrammarTests.test_match (   self)
Make sure partial-matching (with pos) works.

◆ test_multi_line()

parsimonious.tests.test_grammar.GrammarTests.test_multi_line (   self)
Make sure we tolerate all sorts of crazy line breaks and comments in
the middle of rules.

◆ test_not()

parsimonious.tests.test_grammar.GrammarTests.test_not (   self)
Make sure "not" predicates get parsed and work properly.

◆ test_parens_with_leading_whitespace()

parsimonious.tests.test_grammar.GrammarTests.test_parens_with_leading_whitespace (   self)
Make sure a parenthesized expression is allowed to have leading
whitespace when nested directly inside another.

◆ test_resolve_refs_completeness()

parsimonious.tests.test_grammar.GrammarTests.test_resolve_refs_completeness (   self)
Smoke-test another circumstance where lazy references don't get resolved.

◆ test_resolve_refs_order()

parsimonious.tests.test_grammar.GrammarTests.test_resolve_refs_order (   self)
Smoke-test a circumstance where lazy references don't get resolved.

◆ test_right_recursive()

parsimonious.tests.test_grammar.GrammarTests.test_right_recursive (   self)
Right-recursive refs should resolve.

◆ test_simple_custom_rules()

parsimonious.tests.test_grammar.GrammarTests.test_simple_custom_rules (   self)
Run 2-arg custom-coded rules through their paces.

◆ test_unconnected_custom_rules()

parsimonious.tests.test_grammar.GrammarTests.test_unconnected_custom_rules (   self)
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.

◆ test_unicode()

parsimonious.tests.test_grammar.GrammarTests.test_unicode (   self)
Assert that a ``Grammar`` can convert into a string-formatted series
of rules.

The documentation for this class was generated from the following file: