def fmt_tag(cur_namespace, tag, val):
if tag == '<STR_LIT:type>':<EOL><INDENT>fq_val = val<EOL>if '<STR_LIT:.>' not in val and cur_namespace is not None:<EOL><INDENT>fq_val = cur_namespace.name + '<STR_LIT:.>' + fq_val<EOL><DEDENT>return fq_val<EOL><DEDENT>elif tag == '<STR_LIT>':<EOL><INDENT>if '<STR_LIT::>' in val:<EOL><INDENT>val, version = val.split('<STR_LIT::>', <NUM_LIT:1>)<EOL>version = int(version)<EOL><DEDENT>else:<EOL><INDENT>version = <NUM_LIT:1><EOL><DEDENT>return fmt_func(val, version) + "<STR_LIT>"<EOL><DEDENT>elif tag == '<STR_LIT>':<EOL><INDENT>anchor, link = val.rsplit('<STR_LIT:U+0020>', <NUM_LIT:1>)<EOL>return '<STR_LIT>' % (anchor, link)<EOL><DEDENT>elif tag == '<STR_LIT>':<EOL><INDENT>return val<EOL><DEDENT>elif tag == '<STR_LIT>':<EOL><INDENT>return val<EOL><DEDENT>else:<EOL><INDENT>raise RuntimeError('<STR_LIT>' % tag)<EOL><DEDENT>
Processes a documentation reference.