samuel / go-thrift

A native Thrift package for Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support parsing c++ specific and other esoteric syntax

samuel opened this issue · comments

For better compatibility with the standard parser should parse the rarer bits of the IDL.

https://thrift.apache.org/docs/idl

We have this in most of our Thrift definitions and makes the parser crash:

namespace py.twisted txthrift.service.common

This is the error it generates.

$ generator common.thrift go
<reader>:5:1 (94): rule SyntaxError: parser: syntax error

Also, I'm not sure this was an appropriate issue for this.

Interesting, I assume that's accepted by the official thrift tool? They're spec shows namespace scope as NamespaceScope ::= '*' | 'cpp' | 'java' | 'py' | 'perl' | 'rb' | 'cocoa' | 'csharp' but that's likely out of date. Following that the parser in this package just allows [a-z]+ . I'll change it to allow . in scopes.

Interesting, I assume that's accepted by the official thrift tool?

Yes it is. The output is different as well from regular Python, not just the namespace/import path. So there's definitely support for it.

I'll change it to allow . in scopes.

Super! It seems e7cab3d fixed my issue. Thanks!