MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / ParseToWords

Method ParseToWords

CodeFormatCore/src/Diagnostic/Spell/Util.cpp:7–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5const int EOZ = -1;
6
7std::vector<Word> identify::ParseToWords(std::string_view identify) {
8 TextReader reader(identify);
9 std::vector<Word> words;
10 while (true) {
11 switch (Lex(reader)) {
12 case IdentifyType::Unknown: {
13 words.clear();
14 goto endLoop;
15 }
16 case IdentifyType::Ascii: {
17 auto range = reader.GetTokenRange();
18 if (range.Length > 3) {
19 auto text = reader.GetSaveText();
20 words.emplace_back(range, text);
21 }
22 break;
23 }
24 case IdentifyType::Ignore: {
25 break;
26 }
27 default:// end
28 {
29 goto endLoop;
30 }
31 }
32 }
33endLoop:
34 return words;
35}
36
37identify::IdentifyType identify::Lex(TextReader &reader) {
38 reader.ResetBuffer();

Callers

nothing calls this directly

Calls 3

GetSaveTextMethod · 0.80
clearMethod · 0.45
GetTokenRangeMethod · 0.45

Tested by

no test coverage detected