def parseFormattedText(text):
 state = _FormattingParser()
 for ch in text:
  state.process(ch)
 return state.complete()

def parseFormattedText ( text ) : state = _FormattingParser ( ) for ch in text : state . process ( ch ) return state . complete ( )
parse text containing irc formatting codes into structured information .