[ 
https://issues.apache.org/jira/browse/THRIFT-5332?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17298403#comment-17298403
 ] 

Jens Geyer edited comment on THRIFT-5332 at 3/9/21, 10:33 PM:
--------------------------------------------------------------

According to [the 
code|https://github.com/apache/thrift/blob/cb094b80f2b5a6752063124a50c05f070e95c7a7/compiler/cpp/src/thrift/generate/t_generator.cc#L80]
 these are currently: 
{code:java}
std::string keywords[] = { "BEGIN", "END", "__CLASS__", "__DIR__", "__FILE__", 
"__FUNCTION__",
      "__LINE__", "__METHOD__", "__NAMESPACE__", "abstract", "alias", "and", 
"args", "as",
      "assert", "begin", "break", "case", "catch", "class", "clone", 
"continue", "declare",
      "def", "default", "del", "delete", "do", "dynamic", "elif", "else", 
"elseif", "elsif",
      "end", "enddeclare", "endfor", "endforeach", "endif", "endswitch", 
"endwhile", "ensure",
      "except", "exec", "finally", "float", "for", "foreach", "from", 
"function", "global",
      "goto", "if", "implements", "import", "in", "inline", "instanceof", 
"interface", "is",
      "lambda", "module", "native", "new", "next", "nil", "not", "or", 
"package", "pass",
      "public", "print", "private", "protected", "raise", "redo", "rescue", 
"retry", "register",
      "return", "self", "sizeof", "static", "super", "switch", "synchronized", 
"then", "this",
      "throw", "transient", "try", "undef", "unless", "unsigned", "until", 
"use", "var",
      "virtual", "volatile", "when", "while", "with", "xor", "yield" };
}
{code}


was (Author: jensg):
According to [the code|[thrift/t_generator.cc at 
cb094b80f2b5a6752063124a50c05f070e95c7a7 · apache/thrift 
(github.com)|https://github.com/apache/thrift/blob/cb094b80f2b5a6752063124a50c05f070e95c7a7/compiler/cpp/src/thrift/generate/t_generator.cc#L80]]
 these are currently: 

{code}
std::string keywords[] = { "BEGIN", "END", "__CLASS__", "__DIR__", "__FILE__", 
"__FUNCTION__",
      "__LINE__", "__METHOD__", "__NAMESPACE__", "abstract", "alias", "and", 
"args", "as",
      "assert", "begin", "break", "case", "catch", "class", "clone", 
"continue", "declare",
      "def", "default", "del", "delete", "do", "dynamic", "elif", "else", 
"elseif", "elsif",
      "end", "enddeclare", "endfor", "endforeach", "endif", "endswitch", 
"endwhile", "ensure",
      "except", "exec", "finally", "float", "for", "foreach", "from", 
"function", "global",
      "goto", "if", "implements", "import", "in", "inline", "instanceof", 
"interface", "is",
      "lambda", "module", "native", "new", "next", "nil", "not", "or", 
"package", "pass",
      "public", "print", "private", "protected", "raise", "redo", "rescue", 
"retry", "register",
      "return", "self", "sizeof", "static", "super", "switch", "synchronized", 
"then", "this",
      "throw", "transient", "try", "undef", "unless", "unsigned", "until", 
"use", "var",
      "virtual", "volatile", "when", "while", "with", "xor", "yield" };
}
{code}

> Question: list all the reserved words in thrift doc
> ---------------------------------------------------
>
>                 Key: THRIFT-5332
>                 URL: https://issues.apache.org/jira/browse/THRIFT-5332
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Documentation
>            Reporter: Songyi Li
>            Priority: Minor
>
> When I compile my thrift file with thrift 0.13, it reminds me that I can't 
> use reserved word 'in', but I can't find the word list in thrift doc 
> [https://thrift.apache.org/docs/idl.html 
> |https://thrift.apache.org/docs/idl.html]or any other pages in thrift website 
> which makes the rules not so "standard".
> So  I wonder, out of what consideration, thrift didn't list the reserved 
> words in doc and if you guys can write them in doc



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to