def checkrefval(mod, errs):
    for fp_text in (node for node in mod if node[0] == "fp_text"):
        if fp_text[1] not in ("reference", "value"):
            continue
        layer = [n for n in fp_text if n[0] == "layer"][0]
        if layer[1] != "F.Fab":
            errs.append("Value and Reference fields must be on F.Fab")
        if fp_text[1] == "reference" and fp_text[2] != "REF**":
            errs.append("Reference field must contain REF**")
        if fp_text[1] == "value" and not mod[1].startswith(fp_text[2]):
            errs.append("Value field must contain module name")