code: def parseText(self):
      UNPARSED = 0
      PARSED = 1
      parsed_block = [(UNPARSED, self.text)]
      for regex, func in self.regexes:
          index = 0
          while index < len(parsed_block):
              label, text = parsed_block[index]
  
              # Already been parsed
              if label == PARSED:
                  index += 1
                  continue
  
              match = re.search(regex, text)
              if match:
                  parsed_block.pop(index)
                  start = match.start(0)
                  end = match.end(0)
  
                  f = self.formatter.clone()
                  merge = func(match, f)
  
                  if merge:
                      merged = text[:start] + f.dump() + text[end:]
                      parsed_block.insert(index, (UNPARSED, merged))
                  else:
                      if text[:start]:
                          parsed_block.insert(
                              index, (UNPARSED, text[:start])
                          )
  
                      index += 1
                      parsed_block.insert(index, (PARSED, f.dump()))
  
                      index += 1
                      if text[end:]:
                          parsed_block.insert(
                              index, (UNPARSED, text[end:])
                          )
  
              else:
                  index += 1
  
      self.lines += [i for _, i in parsed_block]
      self.text = " ".join(self.lines)
  
imports: import re
label_desc: Use image node_id 2 for calling the Parser obj's underlying member method code with example usage: obj.parseText() without return types