Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(9)  |  Call(8)  |  Derive(0)  |  Import(1)

src/m/i/MiniParse-0.2.0/MiniParse/Meta/Drawable/tests.py   MiniParse(Download)
from MiniParse.Meta.Drawable.Repetition import Repetition
from MiniParse.Meta.Drawable.Alternative import Alternative
from MiniParse.Meta.Drawable.Restriction import Restriction
from MiniParse.Meta.Drawable.NonTerminal import NonTerminal
from MiniParse.Meta.Drawable.Terminal import Terminal
    def testRestrictionWithShorterException(self):
        self.rules = [
            Rule("restriction", Restriction(Terminal("long base branch"), Terminal("exception")))
        ]
 
    def testRestrictionWithLongerException(self):
        self.rules = [
            Rule("restriction", Restriction(Terminal("base"), Terminal("long exception branch")))
    def testCommonRestrictionBeforeRepetition(self):
        a = builder.makeSequence([Restriction(Terminal("d"), Terminal("e")), Repetition(Null, Restriction(Terminal("d"), Terminal("e")))])
        b = Repetition(Restriction(Terminal("d"), Terminal("e")), Null)
        self.assertEqual(a, b)