[C#] Use @ for keyword escaping (#6834)

This commit is contained in:
Derek Bailey
2021-09-09 10:29:27 -07:00
committed by GitHub
parent 1d063d87cf
commit 8fb8c2ce1d
19 changed files with 111 additions and 164 deletions

View File

@@ -190,7 +190,7 @@ class CSharpGenerator : public BaseGenerator {
std::unordered_set<std::string> keywords_;
std::string EscapeKeyword(const std::string &name) const {
return keywords_.find(name) == keywords_.end() ? name : name + "_";
return keywords_.find(name) == keywords_.end() ? name : "@" + name;
}
std::string Name(const FieldDef &field) const {