Skip to content
Prev Previous commit
Next Next commit
[fix] handle comma exponent
refs #29
  • Loading branch information
ibizaman committed Dec 26, 2014
commit 1d276fe33d22933ef8c5b7c386d013959547f71c
2 changes: 1 addition & 1 deletion baron/grouper.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def group_generator(sequence):
(current == "." and iterator.show_next() and re.match(r'^\d+[jJ]?$', iterator.show_next())):
current += next(iterator)

if iterator.show_next() and re.match(r'^\d*[jJ]?$', iterator.show_next()) and re.match(r'^\d*[jJ]?$', iterator.show_next()).group():
while iterator.show_next() and re.match(r'^\d*[jJeE]?$', iterator.show_next()) and re.match(r'^\d*[jJeE]?$', iterator.show_next()).group():
current += next(iterator)

if re.match(r'^\d+\.$', current) and iterator.show_next() and re.match(r'^\d*[eE]\d*$', iterator.show_next()):
Expand Down
1 change: 1 addition & 0 deletions tests/test_grouper.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,3 +200,4 @@ def test_float_exponant():
assert group(['1', '.', 'e', '-', '2']) == ['1.e-2']
assert group(['1', '.', 'e', '2']) == ['1.e2']
assert group(['1', '.', 'e2']) == ['1.e2']
assert group(['.', '3', 'e', '5', '5']) == ['.3e55']