@@ -122,14 +122,14 @@ void ExtensionPoint::Initialize(lua_State *L) {
122122 lua_rawset (L, LUA_REGISTRYINDEX);
123123}
124124
125- bool ExtensionPoint::QueryVariable (lua_State *L, Idx<Variable> variable, const char *typeName, int object, int depth) {
125+ bool ExtensionPoint::QueryVariableGeneric (lua_State *L, Idx<Variable> variable, const char *typeName, int object, int depth, const char * queryFunction ) {
126126 bool result = false ;
127127 object = lua_absindex (L, object);
128128 const int t = lua_gettop (L);
129129 lua_getglobal (L, ExtensionTable.c_str ());
130130
131131 if (lua_istable (L, -1 )) {
132- lua_getfield (L, -1 , " queryVariable " );
132+ lua_getfield (L, -1 , queryFunction );
133133 if (lua_isfunction (L, -1 )) {
134134 pushVariable (L, variable);
135135 lua_pushvalue (L, object);
@@ -140,7 +140,7 @@ bool ExtensionPoint::QueryVariable(lua_State *L, Idx<Variable> variable, const c
140140 result = lua_toboolean (L, -1 );
141141 } else {
142142 const auto err = lua_tostring (L, -1 );
143- printf (" query error: %s\n " , err);
143+ printf (" query error in %s : %s\n " , queryFunction , err);
144144 }
145145 }
146146 }
@@ -149,6 +149,14 @@ bool ExtensionPoint::QueryVariable(lua_State *L, Idx<Variable> variable, const c
149149 return result;
150150}
151151
152+ bool ExtensionPoint::QueryVariable (lua_State *L, Idx<Variable> variable, const char *typeName, int object, int depth) {
153+ return QueryVariableGeneric (L, variable, typeName, object, depth, " queryVariable" );
154+ }
155+
156+ bool ExtensionPoint::QueryVariableCustom (lua_State *L, Idx<Variable> variable, const char *typeName, int object, int depth) {
157+ return QueryVariableGeneric (L, variable, typeName, object, depth, " queryVariableCustom" );
158+ }
159+
152160lua_State *ExtensionPoint::QueryParentThread (lua_State *L) {
153161 lua_State *PL = nullptr ;
154162 const int t = lua_gettop (L);
0 commit comments