Пример #1
0
def p_treatment_9(p):
    """treatment : COLOR SEMY OF almostfullcharge
                 | COLOR SEMYDELIS opttreatment
                 | COLOR SEMY OF GROUPS OF grpcharge
                 | COLOR BEZANTY"""
    # The second is actually syntactically like ALTERED
    if len(p) == 5:
        p[0] = treatment.Semy(treatment.Treatment(p[1]), p[4])
    elif len(p) == 4:
        f = lookup(p[2])()
        f.tincture = p[3]
        p[0] = treatment.Semy(treatment.Treatment(p[1]), f)
    elif len(p) == 7:
        gp = blazon.BigRect()
        gp.tincture = treatment.Treatment("proper")
        gp.addCharge(copy.deepcopy(p[6]))
        p[0] = treatment.Semy(treatment.Treatment(p[1]), gp)
    else:  # len(p)==3
        p[0] = treatment.Semy(treatment.Treatment(p[1]), lookup(p[2])())
    if len(p) == 4 and not f.tincture:
        Globals.extracolorless.append(f)
Пример #2
0
def p_treatment_1(p):
    "treatment : COLOR"
    p[0] = treatment.Treatment(p[1])
    Globals.colors.append(p[0])
    fillin(p[0])
    extrafillin(p[0])
Пример #3
0
def p_treatment_9a(p):
    "treatment : COLOR SEMY OF charge CHARGED WITH grouporcharge"
    p[4].addCharge(p[7])
    p[0] = treatment.Semy(treatment.Treatment(p[1]), p[4])
Пример #4
0
def p_treatment_9a(p):
    """treatment : COLOR SEMY OF almostfullcharge CHARGED WITH almostfullcharge
               | COLOR SEMY OF almostfullcharge CHARGED WITH grpcharge"""
    p[4].addCharge(p[7])
    p[0] = treatment.Semy(treatment.Treatment(p[1]), p[4])