Ejemplo n.º 1
0
 def __call__(self, buffer, start, end):
     after_indent = eat_indent(buffer, start, end)
     new_indent = count_indent(buffer, after_indent)
     if new_indent != self.processor.indent + 1:
         error(buffer, start, 'Indentation error')
     self.processor.indent = new_indent
     return after_indent
Ejemplo n.º 2
0
    def __call__(self, buffer, start, end):
        # Skip empty lines.
        thestart = start
        try:
            if buffer[thestart] != '\n':
                return thestart
            while buffer[thestart] == '\n':
                thestart += 1
        except IndexError:
            return thestart + 2 # +1/-1 hack #EOF

        # If the indent of the non-empty line matches, we are done.
        return eat_indent(buffer, thestart, end, self.processor.indent) + 1 # +1/-1 hack
Ejemplo n.º 3
0
    def __call__(self, buffer, start, end):
        # Skip empty lines.
        thestart = start
        try:
            if buffer[thestart] != '\n':
                return thestart
            while buffer[thestart] == '\n':
                thestart += 1
        except IndexError:
            return thestart + 2  # +1/-1 hack #EOF

        # If the indent of the non-empty line matches, we are done.
        return eat_indent(buffer, thestart, end,
                          self.processor.indent) + 1  # +1/-1 hack
Ejemplo n.º 4
0
 def __call__(self, buffer, start, end):
     if start > end:
         return start + 1
     after_indent = eat_indent(buffer, start, end)
     self.processor.indent = count_indent(buffer, after_indent)
     return after_indent + 1  # +1/-1 hack
Ejemplo n.º 5
0
 def __call__(self, buffer, start, end):
     if start > end:
         return start + 1
     after_indent = eat_indent(buffer, start, end)
     self.processor.indent = count_indent(buffer, after_indent)
     return after_indent + 1  # +1/-1 hack