def _parse_till_unescaped_char(stream, chars):
 rv = ''
 while True:
  escaped = False
  for char in chars:
   if EscapeCharToken.starts_here(stream, char):
    rv += (next(stream) + next(stream))
    escaped = True
  if (not escaped):
   char = next(stream)
   if (char in chars):
    break
   rv += char
 return (rv, char)

def _parse_till_unescaped_char ( stream , chars ) : rv = '' while True : escaped = False for char in chars : if EscapeCharToken . starts_here ( stream , char ) : rv += ( next ( stream ) + next ( stream ) ) escaped = True if ( not escaped ) : char = next ( stream ) if ( char in chars ) : break rv += char return ( rv , char )
returns all chars till a non-escaped char is found .