MCPcopy
hub / github.com/raspberrypi/documentation / _count_dollars_before_index

Method _count_dollars_before_index

scripts/ninja_syntax.py:128–135  ·  view source on GitHub ↗

Returns the number of '$' characters right in front of s[i].

(self, s, i)

Source from the content-addressed store, hash-verified

126 self._line('default %s' % ' '.join(as_list(paths)))
127
128 def _count_dollars_before_index(self, s, i):
129 """Returns the number of '$' characters right in front of s[i]."""
130 dollar_count = 0
131 dollar_index = i - 1
132 while dollar_index > 0 and s[dollar_index] == '$':
133 dollar_count += 1
134 dollar_index -= 1
135 return dollar_count
136
137 def _line(self, text, indent=0):
138 """Write 'text' word-wrapped at self.width characters."""

Callers 1

_lineMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected