Skip to content

Commit

Permalink
Fix the issue where the parser fails on time attr with no space after…
Browse files Browse the repository at this point in the history
… = (uiri#266)

* Fix the issue where the parser fails on time attr with no space after =

like time=10:00:00

* Fix trailing whitespace in break

* Add tests for this issue
  • Loading branch information
salmangano authored and uiri committed Jan 3, 2020
1 parent 7d88a0d commit f4f0b84
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ hosts = [
"omega"
]

[meeting]
[meeting.inspace]
time = 10:00:00
[meeting.nospace]
time=10:00:00

[[fruit]]
name = "apple"

Expand Down
2 changes: 2 additions & 0 deletions toml/decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,8 @@ def load_line(self, line, currentlevel, multikey, multibackslash):
pass
if _load_date(pair[-1]) is not None:
break
if TIME_RE.match(pair[-1]):
break
i += 1
prev_val = pair[-1]
pair = line.split('=', i)
Expand Down

0 comments on commit f4f0b84

Please sign in to comment.