samuel / go-thrift

A native Thrift package for Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Syntax error on list when `[` is in new line

jameshong92 opened this issue · comments

Example:

struct Foo {
  1: optional list<string> Bar = 
  [
    "hello",
    "world"
  ]
}

Returns:

$ generator example.thrift $GOPATH/src
example.thrift:1:1 (0): rule SyntaxError: parser: syntax error

This only happens if you're defining a list within a struct, and doesn't happen with list const.
Example:

const list<string> Bar = 
[
  "hello",
  "world"
]

Works as expected.