Пример #1
0
def p_relation_comment(p):
    "relation : class_ref ID multi REL multi class_ref ID mls"
    if not (p[4] == '--'):
        LOGGER.warning(
            "DEPRECATION: use of %s in relation definition is deprecated, use -- (in %s)"
            % (p[4], Location(file, p.lineno(4))))
    rel = DefineRelation((p[1], p[2], p[3]), (p[6], p[7], p[5]))
    rel.comment = p[8]
    p[0] = rel
    attach_lnr(p, 2)
Пример #2
0
def p_relation_deprecated_comment(p: YaccProduction) -> None:
    "relation : class_ref ID multi REL multi class_ref ID MLS"
    if not (p[4] == "--"):
        LOGGER.warning(
            "DEPRECATION: use of %s in relation definition is deprecated, use -- (in %s)"
            % (p[4], Location(file, p.lineno(4))))
    rel = DefineRelation((p[1], p[2], p[3]), (p[6], p[7], p[5]))
    rel.comment = str(p[8])
    p[0] = rel
    attach_lnr(p, 2)
    deprecated_relation_warning(p)