scanner: peek instead of next.
This commit is contained in:
parent
00e06fb432
commit
dd848e3dab
@ -212,11 +212,8 @@ func (s *Scanner) scanMantissa(ch rune) rune {
|
||||
|
||||
func (s *Scanner) scanFraction(ch rune) rune {
|
||||
if ch == '.' {
|
||||
ch = s.next()
|
||||
msCh := s.scanMantissa(ch)
|
||||
if msCh == ch {
|
||||
s.unread()
|
||||
}
|
||||
ch = s.peek() // we peek just to see if we can move forward
|
||||
ch = s.scanMantissa(ch)
|
||||
}
|
||||
return ch
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user