def normal(state, text, i, formats, user_data):
 m = space_pat.match(text, i)
 if (m is not None):
  return [(len(m.group()), None)]
 cdo = cdo_pat.match(text, i)
 if (cdo is not None):
  state.parse = IN_COMMENT_NORMAL
  return [(len(cdo.group()), formats[u'comment'])]
 if (text[i] == u'"'):
  state.parse = IN_DQS
  return [(1, formats[u'string'])]
 if (text[i] == u"'"):
  state.parse = IN_SQS
  return [(1, formats[u'string'])]
 if (text[i] == u'{'):
  state.parse = IN_CONTENT
  state.blocks += 1
  return [(1, formats[u'bracket'])]
 for (token, fmt, name) in sheet_tokens:
  m = token.match(text, i)
  if (m is not None):
   return [(len(m.group()), formats[fmt])]
 return [((len(text) - i), formats[u'unknown-normal'])]

def normal ( state , text , i , formats , user_data ) : m = space_pat . match ( text , i ) if ( m is not None ) : return [ ( len ( m . group ( ) ) , None ) ] cdo = cdo_pat . match ( text , i ) if ( cdo is not None ) : state . parse = IN_COMMENT_NORMAL return [ ( len ( cdo . group ( ) ) , formats [ u'comment' ] ) ] if ( text [ i ] == u'"' ) : state . parse = IN_DQS return [ ( 1 , formats [ u'string' ] ) ] if ( text [ i ] == u"'" ) : state . parse = IN_SQS return [ ( 1 , formats [ u'string' ] ) ] if ( text [ i ] == u'{' ) : state . parse = IN_CONTENT state . blocks += 1 return [ ( 1 , formats [ u'bracket' ] ) ] for ( token , fmt , name ) in sheet_tokens : m = token . match ( text , i ) if ( m is not None ) : return [ ( len ( m . group ( ) ) , formats [ fmt ] ) ] return [ ( ( len ( text ) - i ) , formats [ u'unknown-normal' ] ) ]
process will try to reset to normal priority .