MCPcopy Create free account
hub / github.com/catboost/catboost / DoKeyword

Method DoKeyword

tools/enum_parser/parse_enum/parse_enum.cpp:245–277  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

243 }
244
245 void DoKeyword(const TText& text) override {
246 if (text.Data == "enum") {
247 Y_ENSURE(!InEnum, "Enums cannot be nested. ");
248 InEnum = true;
249 EnumPos = text.Offset;
250 CurrentEnum.Clear();
251 CurrentEnum.Scope = Scope;
252 ScopeDeclaration = true;
253 NextScopeName = ENUM;
254 //PrintScope();
255 } else if (text.Data == "class") {
256 if (InEnum) {
257 CurrentEnum.EnumClass = true;
258 return;
259 }
260 NextScopeName = CLASS;
261 ScopeDeclaration = true;
262 //PrintScope();
263 } else if (text.Data == "struct") {
264 if (InEnum) {
265 CurrentEnum.EnumClass = true;
266 return;
267 }
268 NextScopeName = STRUCT;
269 ScopeDeclaration = true;
270 //PrintScope();
271 } else if (text.Data == "namespace") {
272 NextScopeName = NAMESPACE;
273 LastScope.clear();
274 ScopeDeclaration = true;
275 //PrintScope();
276 }
277 }
278
279 void DoName(const TText& text) override {
280 if (!ScopeDeclaration) {

Callers

nothing calls this directly

Calls 2

ClearMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected