rum
rum copied to clipboard
float array with comma (,)
There is a bug in lexer that when creating a comma float array it crash return (go bracktrace)
>>> (print array(1,3))
panic: strconv.ParseFloat: parsing "1,3": invalid syntax
goroutine 43 [running]:
github.com/gin-lang/gin/parser.(*lexer).stateIdentifier(0xc420104360, 0xc42010c480)
/home/avelino/src/github.com/gin-lang/gin/parser/lexer.go:152 +0xa19
github.com/gin-lang/gin/parser.(*lexer).(github.com/gin-lang/gin/parser.stateIdentifier)-fm(0xc42010c480)
/home/avelino/src/github.com/gin-lang/gin/parser/lexer.go:172 +0x2a
github.com/gin-lang/gin/parser.(*lexer).run(0xc420104360)
/home/avelino/src/github.com/gin-lang/gin/parser/lexer.go:246 +0x3a
created by github.com/gin-lang/gin/parser.newLexer
/home/avelino/src/github.com/gin-lang/gin/parser/lexer.go:280 +0x28e
exit status 2
~/src/github.com/gin-lang/gin (master) $ 6h24m
▶ go run gin.go
>>> (print array(1.3))
1.3
<nil>
>>>
as in clisp comma is illegal outside of backquote, you should write (print array(1 3))
anyway, the error message needs to be improved.
Do we need another separator besides the white space?