iafan / goplayspace

Advanced Go Playground frontend written in Go, with syntax highlighting, turtle graphics mode, and more
https://goplay.space
Other
981 stars 63 forks source link

binary constants are not accepted #48

Open halmai opened 1 week ago

halmai commented 1 week ago

Binary const declaration like const b = 0b100 does not work.

package main

import (
    "fmt"
)

func main() {
    const a = 100
    const b = 0b100

    fmt.Println(a + b)
}

This code reports an error message while it should run properly:

9:13: expected ';', found 'IDENT' b100 (and 2 more errors)
halmai commented 1 week ago

Here is the sample code in the editor: https://goplay.space/#S6RBEz3asW7