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

Method Parse

CodeFormatCore/src/Config/LuaStyle.cpp:47–415  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45 }
46
47void LuaStyle::Parse(std::map<std::string, std::string, std::less<>> &configMap) {
48 IF_EXIST(indent_style) {
49 if (value == "tab") {
50 indent_style = IndentStyle::Tab;
51 } else if (value == "space") {
52 indent_style = IndentStyle::Space;
53 }
54 }
55
56 NUMBER_OPTION(indent_size)
57
58 NUMBER_OPTION(tab_width)
59
60 IF_EXIST(quote_style) {
61 if (value == "single") {
62 quote_style = QuoteStyle::Single;
63 } else if (value == "double") {
64 quote_style = QuoteStyle::Double;
65 }
66 }
67
68 // for editorconfig Domain-Specific Properties
69 IF_EXIST(qoute_type) {
70 if (value == "single") {
71 quote_style = QuoteStyle::Single;
72 } else if (value == "double") {
73 quote_style = QuoteStyle::Double;
74 }
75 }
76
77 IF_EXIST(table_separator_style) {
78 if (value == "none") {
79 table_separator_style = TableSeparatorStyle::None;
80 } else if (value == "comma") {
81 table_separator_style = TableSeparatorStyle::Comma;
82 } else if (value == "semicolon") {
83 table_separator_style = TableSeparatorStyle::Semicolon;
84 } else if (value == "only_kv_colon") {
85 table_separator_style = TableSeparatorStyle::OnlyKVColon;
86 }
87 }
88
89 IF_EXIST(max_line_length) {
90 if (IsNumber(value)) {
91 max_line_length = std::stoi(value);
92 } else if (value == "unset") {
93 max_line_length = 998;
94 }
95 }
96
97 IF_EXIST(end_of_line) {
98 if (value == "crlf") {
99 end_of_line = EndOfLine::CRLF;
100 } else if (value == "lf") {
101 end_of_line = EndOfLine::LF;
102 } else if (value == "cr") {
103 end_of_line = EndOfLine::CR;
104 } else if (value == "auto" || value == "unset") {

Callers 15

CheckSingleFileMethod · 0.45
mainFunction · 0.45
ReformatSingleFileMethod · 0.45
RangeReformatMethod · 0.45
SetDefaultCodeStyleMethod · 0.45
ReformatMethod · 0.45
RangeFormatMethod · 0.45
TypeFormatMethod · 0.45
DiagnosticMethod · 0.45
SetDefaultCodeStyleMethod · 0.45
ReformatMethod · 0.45

Calls 6

IF_EXISTFunction · 0.85
IsNumberFunction · 0.85
LineSpaceClass · 0.85
GetParamMethod · 0.80
countMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected