thrift-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James E. King III (JIRA)" <>
Subject [jira] [Commented] (THRIFT-4655) Parser fails on the word "from"
Date Thu, 25 Oct 2018 12:20:00 GMT


James E. King III commented on THRIFT-4655:

>From 0.11.0:
jking@ubuntu:/tmp$ ~/thrift/compiler/cpp/thrift --gen java foo.thrift
[FAILURE:generation:1] Cannot use reserved language keyword: "from"
These are reserved keywords in csharp and netcore, but not in Java.  I would not have expected
the compiler to complain unless generating csharp and netcore.
jking@ubuntu:~/thrift/compiler/cpp$ grep 'keyword' src/thrift/generate/*.cc | grep from
src/thrift/generate/  csharp_keywords["from"] = 1;
src/thrift/generate/    netcore_keywords["from"] = 1;

I suggest you use a different name for your structure member.  Thrift uses the ordinal position
and not the variable name for serdes, so changing the name will not make things incompatible
on the wire.  Code on either end will need to change next time it is compiled, that's all.

> Parser fails on the word "from"
> -------------------------------
>                 Key: THRIFT-4655
>                 URL:
>             Project: Thrift
>          Issue Type: Bug
>          Components: Compiler (General)
>    Affects Versions: 0.9.3
>            Reporter: felix wang
>            Priority: Major
>         Attachments: image-2018-10-25-17-08-31-856.png
> !image-2018-10-25-17-08-31-856.png!
> {color:#191f25}2018-10-25 04:04:42:[ERROR] thrift failed output: {color}
> {color:#191f25}[ERROR] thrift failed error: [ERROR:/tmp/pebble_idl_tmp/mkt/dis/1540454677417/idlPro/dis/src/main/thrift/mkt_dis_model_dto.thrift:887]
(last token was 'from'){color}
> {color:#191f25}[ERROR] Failed to execute goal
(thrift-java-sources) on project mkt-dis-idl: thrift did not exit cleanly. Review output for
more information. -> [Help 1]{color}
> {color:#191f25}[ERROR] {color}
> {color:#191f25}[ERROR] To see the full stack trace of the errors, re-run Maven with the
-e switch.{color}
> {color:#191f25}[ERROR] Re-run Maven using the -X switch to enable full debug logging.{color}
> {color:#191f25}[ERROR] {color}
> {color:#191f25}[ERROR] For more information about the errors and possible solutions,
please read the following articles:{color}
> {color:#191f25}[ERROR] [Help 1] {color}[]

This message was sent by Atlassian JIRA

View raw message