void ParseEnum(LexSection section, ref int caret, ref ProtectLevel protectionLevel) { int begin = caret; caret += "enum".Length; string name = ReadWord(section.data, ref caret); if (name == "class") { name = ReadWord(section.data, ref caret); } string block = ReadBlock(section.data, ref caret).Trim(' ', '{', '}', '\r', '\t', '\n'); string blockWithoutComments = RemoveComments(block); var content = Split(blockWithoutComments, ','); LexEnum newEnum = new LexEnum() { begin = begin, end = caret, data = section.data.Substring(begin, caret - begin), name = name }; content.ForEach(x => newEnum.content.Add(x.Trim(' ', '\n', '\t', '\r'))); section.enums.Add(newEnum); }
void ParseEnum(LexSection section, ref int caret, ref ProtectLevel protectionLevel) { int begin = caret; caret += "enum".Length; string name = ReadWord(section.data, ref caret); if (name == "class") name = ReadWord(section.data, ref caret); string block = ReadBlock(section.data, ref caret).Trim(' ', '{', '}', '\r', '\t', '\n'); string blockWithoutComments = RemoveComments(block); var content = Split(blockWithoutComments, ','); LexEnum newEnum = new LexEnum() { begin = begin, end = caret, data = section.data.Substring(begin, caret - begin), name = name }; content.ForEach(x => newEnum.content.Add(x.Trim(' ', '\n', '\t', '\r'))); section.enums.Add(newEnum); }