DAddYE / igo

Intermediate GoLang source representation
http://play.igolang.io
139 stars 6 forks source link

Short function declaration bug (BadDecl) #9

Closed blaxill closed 10 years ago

blaxill commented 10 years ago

Using short function declaration seems to cause parsing error of next function.

package main

func hello(text string)
    fmt.Println(text)

func hello2(text string): fmt.Println(text)

func main()
    return

Gives

package main

func hello(text string) {
    fmt.Println(text)
}
func hello2(text string)    { fmt.Println(text) }

BadDecl

Note BadDecl instead of main function definition.

DAddYE commented 10 years ago

Thanks for pointing me this. Fixed and also improved a lot how comments are showed.

See: http://igo.herokuapp.com