go-thrift icon indicating copy to clipboard operation
go-thrift copied to clipboard

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

Open jameshong92 opened this issue 8 years ago • 0 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.

jameshong92 avatar Feb 23 '17 08:02 jameshong92