The number of the beginning of line is after in
self._files[ self._current_filename ]['current_rownum'] (except in case of EOF).
- @return: the content of this line or None if EOF
- @rtype: str or None
+ @return: the content of this line as a list of tokens or None if EOF
+ @rtype: list or None
"""
filename = self._current_filename
# Tokens without quotings
match = re.search( r'^([^"\s]+)', line )
if match is not None:
+
token = match.group(1)
- if token == ';':
- res_array.append( ';' )
+
+ # Split token by ';' or '{' or '}'
+ if token == ';' or token == '{' or token == '}':
+ res_array.append( token )
else:
- semicolon_match = re.search( r';$', token )
- if semicolon_match is not None:
- token = re.sub( r';$', '', token )
- res_array.append( token )
- res_array.append( ';' )
- else:
- res_array.append( token )
+ while token != '':
+ specialchar_match = re.search( r'^([^;{}]*)([;{}])', token )
+ if specialchar_match is not None:
+ first = specialchar_match.group(1)
+ specialchar = specialchar_match.group(2)
+ if first is not None and first != '':
+ res_array.append( first )
+ res_array.append( specialchar )
+ token = re.sub( r'^[^;{}]*[;{}]', '', token )
+ else:
+ res_array.append( token )
+ token = ''
+
line = re.sub( r'^[^"\s]+\s*', '', line )
continue