| 10 | #include <vector> |
| 11 | |
| 12 | class LuaStyle { |
| 13 | public: |
| 14 | LuaStyle() = default; |
| 15 | |
| 16 | void Parse(std::map<std::string, std::string, std::less<>> &configMap); |
| 17 | // [basic] |
| 18 | /* |
| 19 | * 缩进风格 |
| 20 | */ |
| 21 | IndentStyle indent_style = IndentStyle::Space; |
| 22 | |
| 23 | /* |
| 24 | * 缩进的空白数 |
| 25 | */ |
| 26 | std::size_t indent_size = 4; |
| 27 | |
| 28 | /* |
| 29 | * tab的width |
| 30 | */ |
| 31 | std::size_t tab_width = 4; |
| 32 | |
| 33 | QuoteStyle quote_style = QuoteStyle::None; |
| 34 | |
| 35 | ContinuationIndent continuation_indent; |
| 36 | |
| 37 | TableSeparatorStyle table_separator_style = TableSeparatorStyle::Comma; |
| 38 | |
| 39 | std::size_t max_line_length = 120; |
| 40 | #ifndef _WINDOWS |
| 41 | EndOfLine end_of_line = EndOfLine::LF; |
| 42 | #else |
| 43 | EndOfLine end_of_line = EndOfLine::CRLF; |
| 44 | #endif |
| 45 | |
| 46 | TrailingTableSeparator trailing_table_separator = TrailingTableSeparator::Keep; |
| 47 | |
| 48 | CallArgParentheses call_arg_parentheses = CallArgParentheses::Keep; |
| 49 | |
| 50 | bool detect_end_of_line = true; |
| 51 | |
| 52 | bool insert_final_newline = true; |
| 53 | |
| 54 | // [Space] |
| 55 | bool space_around_table_field_list = true; |
| 56 | |
| 57 | bool space_before_attribute = true; |
| 58 | |
| 59 | bool space_before_function_open_parenthesis = false; |
| 60 | |
| 61 | bool space_before_function_call_open_parenthesis = false; |
| 62 | |
| 63 | bool space_before_closure_open_parenthesis = false; |
| 64 | |
| 65 | SpaceBeforeSingleArg space_before_function_call_single_arg; |
| 66 | |
| 67 | bool space_before_open_square_bracket = false; |
| 68 | |
| 69 | bool space_inside_function_call_parentheses = false; |
no test coverage detected