let numbers be written with decimals
This commit is contained in:
parent
9f17543d3e
commit
898be71f05
1 changed files with 7 additions and 0 deletions
7
lexer.go
7
lexer.go
|
|
@ -291,6 +291,13 @@ func (l *Lexer) NextToken() (Token, error) {
|
||||||
l.advance()
|
l.advance()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if the number has a float-part
|
||||||
|
if l.accept('.') {
|
||||||
|
for unicode.IsDigit(l.peek()) {
|
||||||
|
l.advance()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return l.makeToken(TokenNumber), nil
|
return l.makeToken(TokenNumber), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue