def parseScan(self, scan):
setupScan = True<EOL>foundCharge = False<EOL>foundMass = False<EOL>foundTitle = False<EOL>scanObj = ScanObject()<EOL>scanObj.ms_level = <NUM_LIT:2><EOL>for row in scan.split('<STR_LIT:\n>'):<EOL><INDENT>if not row:<EOL><INDENT>continue<EOL><DEDENT>entry = row.strip().split('<STR_LIT:=>')<EOL>if len(entry) >= <NUM_LIT:2>:<EOL><INDENT>if entry[<NUM_LIT:0>] == '<STR_LIT>':<EOL><INDENT>scanObj.mass = float(entry[<NUM_LIT:1>])<EOL>foundMass = True<EOL><DEDENT>elif entry[<NUM_LIT:0>] == '<STR_LIT>':<EOL><INDENT>scanObj.charge = entry[<NUM_LIT:1>]<EOL>foundCharge = True<EOL><DEDENT>elif entry[<NUM_LIT:0>] == '<STR_LIT>':<EOL><INDENT>if self.titleMap:<EOL><INDENT>pos = entry[<NUM_LIT:1>].find('<STR_LIT:U+002C>')<EOL>title = self.titleMap[int(entry[<NUM_LIT:1>][:entry[<NUM_LIT:1>].find('<STR_LIT:U+002C>')])]<EOL><DEDENT>else:<EOL>
All input follows the BEGIN IONS row and ends before END IONS