#NEWLINE# def __init__( self , code = '' ) : #NEWLINE# #INDENT# 'Initialize a new instance.' #NEWLINE# self . code = code #NEWLINE# self . marks = { #NEWLINE# #INDENT# WARNING : [ ] , #NEWLINE# ERROR : [ ] , #NEWLINE# #UNINDENT# } #NEWLINE# self . mark_style = 'outline' #NEWLINE# self . mark_flags = MARK_STYLES [ self . mark_style ] #NEWLINE# self . lines = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# self . line_offset = 0 #NEWLINE# self . char_offset = 0 #NEWLINE# self . newlines = newlines = [ 0 ] #NEWLINE# last = ( - 1 ) #NEWLINE# while True : #NEWLINE# #INDENT# last = code . find ( '\n' , ( last + 1 ) ) #NEWLINE# if ( last == ( - 1 ) ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# newlines . append ( ( self + 1 ) ) #NEWLINE# #UNINDENT# newlines . append ( len ( code ) )