mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
update scanner comment and test float with trailing dot
This commit is contained in:
parent
7ffeeeede3
commit
be8b976ba1
2 changed files with 4 additions and 2 deletions
|
|
@ -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,
|
||||
},
|
||||
},
|
||||
) {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue