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

Function update_name_style_config

CodeFormatLib/src/CodeFormatLib.cpp:651–684  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

649}
650
651int update_name_style_config(lua_State *L) {
652 int top = lua_gettop(L);
653
654 if (top != 1) {
655 return 0;
656 }
657
658 if (lua_istable(L, 1)) {
659 try {
660 InfoTree tree;
661 auto root = tree.GetRoot();
662 lua_pushnil(L);
663 while (lua_next(L, -2) != 0) {
664 if (lua_isstring(L, -2)) {
665 auto key = luaToString(L, -2);
666 root.AddChild(key, CreateFromLua(tree, L));
667 }
668 lua_pop(L, 1);
669 }
670
671 LuaCodeFormat::GetInstance().UpdateDiagnosticStyle(tree);
672 lua_pushboolean(L, true);
673 return 1;
674 } catch (std::exception &e) {
675 std::string err = e.what();
676 lua_settop(L, top);
677 lua_pushboolean(L, false);
678 lua_pushlstring(L, err.c_str(), err.size());
679 return 2;
680 }
681 }
682
683 return 0;
684}
685
686int name_style_analysis(lua_State *L) {
687 int top = lua_gettop(L);

Callers

nothing calls this directly

Calls 14

lua_gettopFunction · 0.85
lua_pushnilFunction · 0.85
lua_nextFunction · 0.85
lua_isstringFunction · 0.85
luaToStringFunction · 0.85
CreateFromLuaFunction · 0.85
lua_pushbooleanFunction · 0.85
lua_settopFunction · 0.85
lua_pushlstringFunction · 0.85
GetRootMethod · 0.80
AddChildMethod · 0.80
UpdateDiagnosticStyleMethod · 0.45

Tested by

no test coverage detected