def _docf(self, tag, val):
if tag == '<STR_LIT:type>':<EOL><INDENT>fq_val = val<EOL>if '<STR_LIT:.>' not in val:<EOL><INDENT>fq_val = self.cur_namespace.name + '<STR_LIT:.>' + fq_val<EOL><DEDENT>return '<STR_LIT>'.format(self.args.types_package, 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>if '<STR_LIT:.>' in val:<EOL><INDENT>return '<STR_LIT>'.format(fmt_func(val, version=version))<EOL><DEDENT>else:<EOL><INDENT>return '<STR_LIT>'.format(<EOL>self.cur_namespace.name, fmt_func(val, version=version))<EOL><DEDENT><DEDENT>elif tag == '<STR_LIT>':<EOL><INDENT>anchor, link = val.rsplit('<STR_LIT:U+0020>', <NUM_LIT:1>)<EOL>return '<STR_LIT>'.format(anchor, link)<EOL><DEDENT>elif tag == '<STR_LIT>':<EOL><INDENT>if val == '<STR_LIT:null>':<EOL><INDENT>return '<STR_LIT:None>'<EOL><DEDENT>elif val == '<STR_LIT:true>' or val == '<STR_LIT:false>':<EOL><INDENT>return '<STR_LIT>'.format(val.capitalize())<EOL><DEDENT>else:<EOL><INDENT>return val<EOL><DEDENT><DEDENT>elif tag == '<STR_LIT>':<EOL><INDENT>return '<STR_LIT>'.format(val)<EOL><DEDENT>else:<EOL><INDENT>raise RuntimeError('<STR_LIT>' % tag)<EOL><DEDENT>
Callback used as the handler argument to process_docs(). This converts
Babel doc references to Sphinx-friendly annotations.