Returns the length of the line's margin.
(self, line: str)
| 179 | fail('IndentStack expected indents, but none are defined.') |
| 180 | |
| 181 | def measure(self, line: str) -> int: |
| 182 | """ |
| 183 | Returns the length of the line's margin. |
| 184 | """ |
| 185 | if '\t' in line: |
| 186 | fail('Tab characters are illegal in the Argument Clinic DSL.') |
| 187 | stripped = line.lstrip() |
| 188 | if not len(stripped): |
| 189 | # we can't tell anything from an empty line |
| 190 | # so just pretend it's indented like our current indent |
| 191 | self._ensure() |
| 192 | return self.indents[-1] |
| 193 | return len(line) - len(stripped) |
| 194 | |
| 195 | def infer(self, line: str) -> int: |
| 196 | """ |
no test coverage detected