diff --git a/pql/parser_test.go b/pql/parser_test.go index 23582594b..e5bda9ca9 100644 --- a/pql/parser_test.go +++ b/pql/parser_test.go @@ -82,7 +82,7 @@ func TestParser_Parse(t *testing.T) { // Parse with float arguments. t.Run("WithFloatArgs", func(t *testing.T) { - q, err := pql.ParseString(`MyCall( key=12.25, foo= 13.167)`) + q, err := pql.ParseString(`MyCall( key=12.25, foo= 13.167, bar=2., baz=0.9)`) if err != nil { t.Fatal(err) } else if !reflect.DeepEqual(q.Calls[0], @@ -91,6 +91,8 @@ func TestParser_Parse(t *testing.T) { Args: map[string]interface{}{ "key": 12.25, "foo": 13.167, + "bar": 2., + "baz": 0.9, }, }, ) { diff --git a/pql/scanner.go b/pql/scanner.go index 7cbbcc85b..6fa0da377 100644 --- a/pql/scanner.go +++ b/pql/scanner.go @@ -140,7 +140,7 @@ func (s *Scanner) scanIdent() (tok Token, pos Pos, lit string) { return IDENT, pos, lit } -// scanNumber consumes consecutive integer digits. +// scanNumber consumes consecutive digits and up to one '.' character. func (s *Scanner) scanNumber() (tok Token, pos Pos, lit string) { pos = s.pos tok = NUMBER