File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -84,9 +84,13 @@ def __iter__(self):
8484 def __repr__ (self ):
8585 return f'{ _letlrhstostr (self .lhs )} -> { _letlrhstostr (self .rhs )} '
8686
87+ def is_epsilon (self ):
88+ """Returns ``True`` if the right-hand side is the tuple ``(ε,)``."""
89+ return self .rhs == (ε ,)
90+
8791 @classmethod
8892 def from_string (cls , prods , context_free = True ): # pragma: no cover
89- """Deprecated. Use Productions.from_string"""
93+ """Deprecated. Use Productions.from_string. """
9094 deprecation_warning ('The function "from_string" has been moved to Productions.' )
9195 return Productions .from_string (prods , context_free )
9296
@@ -103,7 +107,7 @@ def such_that(cls, **kwargs):
103107 rhs_is_suffix_of: returns a predicate that is ``True`` weather the the argument value ends with the production.
104108
105109 Returns:
106- A predicate (that is a one-argument function that retuns ``True`` or ``False``) that is ``True`` weather the production
110+ A predicate (that is a one-argument function that returns ``True`` or ``False``) that is ``True`` weather the production
107111 given as argument satisfies all the predicates given by the named arguments.
108112
109113 Example:
You can’t perform that action at this time.
0 commit comments