rum icon indicating copy to clipboard operation
rum copied to clipboard

float array with comma (,)

Open avelino opened this issue 8 years ago • 2 comments

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>
>>>

avelino avatar Nov 26 '17 02:11 avelino

as in clisp comma is illegal outside of backquote, you should write (print array(1 3)) anyway, the error message needs to be improved.

crgimenes avatar Nov 26 '17 11:11 crgimenes

Do we need another separator besides the white space?

crgimenes avatar Feb 11 '18 13:02 crgimenes