Skip to content

Commit

Permalink
Be more permissive on what is in a specline token
Browse files Browse the repository at this point in the history
Allow anything except ,=", but need to skip whitespace when not in an identifier too then.
  • Loading branch information
mgalloy committed Apr 24, 2019
1 parent 3dde8c9 commit e20a412
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion epochs/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

TYPES = {'bool': bool, 'boolean': bool, 'float': float, 'int': int, 'str': str}

identifier_re = re.compile('[.\w\[\]]')
identifier_re = re.compile('[^,="]')
whitespace_re = re.compile('\s')
listtypes_re = re.compile('List\[(.*)\]')

Expand Down Expand Up @@ -59,6 +59,8 @@ def _parse_specline_tokens(specline: str) -> OptionSpec:
if in_quote:
identifier += c
else:
if whitespace_re.match(c) and identifier == '':
continue
if identifier_re.match(c):
identifier += c
elif c in {'=', ','}:
Expand Down

0 comments on commit e20a412

Please sign in to comment.