29 from omniidl
import idlvisitor, idlast, idltype
32 li = s.rsplit(old, occurrence)
46 for c
in reversed(comments):
47 if line - c.line() != 1:
54 if isinstance(node, idlast.Attribute):
55 for i
in node.identifiers():
56 print (i +
" documentation may be ill-formed.")
58 print (node.identifier() +
" documentation may be ill-formed.")
62 if isinstance(node, idlast.Operation):
63 with open(node.file())
as fp:
64 for _
in range(node.line()-1): fp.readline()
66 texts.append(
"\nPrototype:\t"+ line)
71 texts.append(
" \t"+ line)
74 if len(texts)==0:
return None 75 text =
''.join (texts)
76 id = node.identifier() +
"__doc__" 84 node.scopedName()[:-1] + [ id, ],
85 _rreplace (node.repoId(), node.identifier(), id, 1),
95 if const
is None:
return 96 if isinstance(parent, idlast.Module):
97 parent._Module__definitions.append(const)
98 elif isinstance(parent, idlast.Interface):
99 parent._Interface__declarations.append(const)
100 parent._Interface__contents.append(const)
101 elif isinstance(parent, idlast.AST):
102 parent._AST__declarations.append(const)
104 print (
"Doc ignored: " + comment.text())
108 for n
in node.declarations():
109 if not output_inline
and not n.mainFile():
continue 111 if isinstance(n, idlast.Module)
or isinstance(n, idlast.Interface):
116 for n
in node.definitions():
117 if not output_inline
and not n.mainFile():
continue 119 if isinstance(n, idlast.Module)
or isinstance(n, idlast.Interface):
124 for c
in node.callables():
128 ccv = CommentToConstVisitor ()
131 run_parent (tree, args)
def _rreplace(s, old, new, occurrence)