Line
struct LineOne logical line of code.
Implements Copyable, Movable
- Fields
lineno: Int: 1-based number of the first physical line.indent: Int: Leading spaces of the first physical line.code: String: The text, comments stripped, every string literal reduced to"".words: List[String]: Identifier tokens ofcode, in order.allow: List[String]: Rule ids named in a# lint: allow(...)comment on or just above it.starts: List[Int]: Offset incodewhere each physical line begins;starts[0]is 0.indents: List[Int]: Leading spaces of each physical line, parallel tostarts.
locate
def locate(self, at: Int) -> Tuple[Int, Int] The 1-based physical line and 1-based column of offset at in code, so a finding on a bracketed continuation points into the physical line it sits on.
has_word
def has_word(self, word: String) -> Bool allows
def allows(self, rule: String) -> Bool