From 09de857f465b5f178be4b44dd8a64248061bb20b Mon Sep 17 00:00:00 2001 From: Jordan Orelli Date: Sun, 21 Oct 2012 13:15:41 -0400 Subject: [PATCH] added support for period-initial floats --- lex.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lex.go b/lex.go index b3fcf99..1d28262 100644 --- a/lex.go +++ b/lex.go @@ -106,6 +106,9 @@ func lexOpenParen(l *lexer) (stateFn, error) { return lexCloseParen, nil case ';': return lexComment, nil + case '.': + l.keep() + return lexFloat, nil } if isDigit(l.cur) { l.keep() @@ -131,6 +134,9 @@ func lexWhitespace(l *lexer) (stateFn, error) { return lexCloseParen, nil case ';': return lexComment, nil + case '.': + l.keep() + return lexFloat, nil } if isDigit(l.cur) { l.keep()