MCPcopy Index your code
hub / github.com/python/cpython / add_line

Method add_line

Tools/c-analyzer/c_parser/parser/_info.py:27–42  ·  view source on GitHub ↗
(self, line, lno=None)

Source from the content-addressed store, hash-verified

25 return f'{type(self).__name__}({", ".join(args)})'
26
27 def add_line(self, line, lno=None):
28 if lno is None:
29 lno = self.end + 1
30 else:
31 if isinstance(lno, FileInfo):
32 fileinfo = lno
33 if fileinfo.filename != self.filename:
34 raise NotImplementedError((fileinfo, self.filename))
35 lno = fileinfo.lno
36 # XXX
37 #if lno < self.end:
38 # raise NotImplementedError((lno, self.end))
39 line = line.lstrip()
40 self.text += ' ' + line
41 self.line = line
42 self.end = lno
43
44
45class SourceInfo:

Callers 1

_add_lineMethod · 0.80

Calls 1

lstripMethod · 0.45

Tested by

no test coverage detected