This repository has been archived by the owner on Dec 10, 2018. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
1、byte处理问题
thrift官网中说明,byte: An 8-bit signed integer。但是在parser.py文件的_cast_byte方法中却assert接收到的v为str类型。
2、include文件路径问题
这应该是一个建议,或者说值得改进的地方。
发现场景:thrift文件A中include了B文件,同时在B文件中include了C文件,B和C在同一个目录下,但同时和A不在同一目录下,这时如果只给了A的路径,则在解析B文件时对于include的C文件,就会报错,找不到C文件。
建议:parser.py文件中p_include方法,应该把当前解析的thrift文件所在路径加到include_dirs_中,而不是所有的thrift路径都需要调用parse方法时把所有thrift文件所在路径都添加进去,因为调用时用户并不一定知道其他文件include的文件都在哪些目录下。