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 {
|
func (s *Scanner) scanFraction(ch rune) rune {
|
||||||
if ch == '.' {
|
if ch == '.' {
|
||||||
ch = s.next()
|
ch = s.peek() // we peek just to see if we can move forward
|
||||||
msCh := s.scanMantissa(ch)
|
ch = s.scanMantissa(ch)
|
||||||
if msCh == ch {
|
|
||||||
s.unread()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return ch
|
return ch
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user