MCPcopy Create free account
hub / github.com/cdgriffith/Box / handle

Function handle

box/comments.py:145–157  ·  view source on GitHub ↗
(token, path)

Source from the content-addressed store, hash-verified

143 pending.extend(_token_lines(token.value)[:-1])
144
145 def handle(token, path):
146 if token is None or id(token) in seen:
147 return
148 seen.add(id(token))
149 value = token.value
150 if value.startswith("\n"):
151 rest = value[1:]
152 else:
153 # The first line is the end of line comment, the following lines belong to the next key
154 first, _, rest = value.partition("\n")
155 entry(path)["eol"] = first.strip()[1:].strip()
156 if rest:
157 pending.extend(_token_lines(rest)[:-1]) # comment tokens end with a newline
158
159 root_comment = getattr(root.ca, "comment", None)
160 if root_comment and len(root_comment) > 1 and root_comment[1]:

Callers 1

walkFunction · 0.85

Calls 3

entryFunction · 0.85
_token_linesFunction · 0.85
extendMethod · 0.80

Tested by

no test coverage detected