| 7 | #include "CodeFormatCore/Diagnostic/DiagnosticBuilder.h" |
| 8 | |
| 9 | int main() { |
| 10 | std::string buffer = R"( |
| 11 | |
| 12 | require "check" |
| 13 | |
| 14 | )"; |
| 15 | |
| 16 | auto file = std::make_shared<LuaSource>(std::move(buffer)); |
| 17 | LuaLexer luaLexer(file); |
| 18 | luaLexer.SupportNonStandardSymbol(); |
| 19 | luaLexer.Parse(); |
| 20 | |
| 21 | LuaParser p(file, std::move(luaLexer.GetTokens())); |
| 22 | p.Parse(); |
| 23 | |
| 24 | LuaSyntaxTree t; |
| 25 | t.BuildTree(p); |
| 26 | std::cout << t.GetDebugView() << std::endl; |
| 27 | |
| 28 | LuaStyle s; |
| 29 | s.space_around_concat_operator = SpaceAroundStyle::None; |
| 30 | FormatBuilder b(s); |
| 31 | auto text = b.GetFormatResult(t); |
| 32 | std::cout<< text << std::endl; |
| 33 | // LuaDiagnosticStyle style; |
| 34 | // DiagnosticBuilder dd(s, style); |
| 35 | // dd.CodeStyleCheck(t); |
| 36 | // for (auto &diag: dd.GetDiagnosticResults(t)) { |
| 37 | // std::cout << diag.Message << std::endl; |
| 38 | // } |
| 39 | return 0; |
| 40 | } |
nothing calls this directly
no test coverage detected