added support for period-initial floats

master
Jordan Orelli 12 years ago
parent ee6c15a90f
commit 09de857f46

@ -106,6 +106,9 @@ func lexOpenParen(l *lexer) (stateFn, error) {
return lexCloseParen, nil return lexCloseParen, nil
case ';': case ';':
return lexComment, nil return lexComment, nil
case '.':
l.keep()
return lexFloat, nil
} }
if isDigit(l.cur) { if isDigit(l.cur) {
l.keep() l.keep()
@ -131,6 +134,9 @@ func lexWhitespace(l *lexer) (stateFn, error) {
return lexCloseParen, nil return lexCloseParen, nil
case ';': case ';':
return lexComment, nil return lexComment, nil
case '.':
l.keep()
return lexFloat, nil
} }
if isDigit(l.cur) { if isDigit(l.cur) {
l.keep() l.keep()

Loading…
Cancel
Save