Lines Matching refs:self

114     def __missing__(self, key):
127 def __init__(self, indentwidth, tabwidth):
128 self.indentwidth = indentwidth
129 self.tabwidth = tabwidth
131 def set_code(self, s):
133 self.code = s
134 self.study_level = 0
136 def find_good_parse_start(self, is_char_in_string):
149 code, pos = self.code, None
188 def set_lo(self, lo):
193 assert lo == 0 or self.code[lo-1] == '\n'
195 self.code = self.code[lo:]
197 def _study1(self):
202 Creates self.{goodlines, continuation}.
204 if self.study_level >= 1:
206 self.study_level = 1
212 code = self.code
227 self.goodlines = goodlines = [0]
323 self.continuation = continuation
331 def get_continuation_type(self):
332 self._study1()
333 return self.continuation
335 def _study2(self):
341 self.stmt_start, stmt_end
343 self.stmt_bracketing
349 self.lastch
351 self.lastopenbracketpos
354 if self.study_level >= 2:
356 self._study1()
357 self.study_level = 2
360 code, goodlines = self.code, self.goodlines
381 self.stmt_start, self.stmt_end = p, q
454 self.lastch = lastch
455 self.lastopenbracketpos = stack[-1] if stack else None
456 self.stmt_bracketing = tuple(bracketing)
458 def compute_bracket_indent(self):
463 self._study2()
464 assert self.continuation == C_BRACKET
465 j = self.lastopenbracketpos
466 code = self.code
486 extra = self.indentwidth
487 return len(code[i:j].expandtabs(self.tabwidth)) + extra
489 def get_num_lines_in_stmt(self):
495 self._study1()
496 goodlines = self.goodlines
499 def compute_backslash_indent(self):
505 self._study2()
506 assert self.continuation == C_BACKSLASH
507 code = self.code
508 i = self.stmt_start
553 return len(code[self.stmt_start:i].expandtabs(\
554 self.tabwidth)) + 1
556 def get_base_indent_string(self):
560 self._study2()
561 i, n = self.stmt_start, self.stmt_end
563 code = self.code
568 def is_block_opener(self):
570 self._study2()
571 return self.lastch == ':'
573 def is_block_closer(self):
575 self._study2()
576 return _closere(self.code, self.stmt_start) is not None
578 def get_last_stmt_bracketing(self):
583 self._study2()
584 return self.stmt_bracketing