allow passing sName for expressions

This commit is contained in:
Glenn Maynard
2006-09-23 02:09:58 +00:00
parent 09afb81741
commit 13f33de79a
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -539,11 +539,11 @@ bool LuaHelpers::RunScript( Lua *L, const RString &sExpression, const RString &s
return true; return true;
} }
bool LuaHelpers::RunExpression( Lua *L, const RString &sExpression ) bool LuaHelpers::RunExpression( Lua *L, const RString &sExpression, const RString &sName )
{ {
RString sFullExpression = "return " + sExpression; RString sFullExpression = "return " + sExpression;
bool bSuccess = LuaHelpers::RunScript( L, sFullExpression, "", 1 ); bool bSuccess = LuaHelpers::RunScript( L, sFullExpression, sName, 1 );
if( !bSuccess ) if( !bSuccess )
lua_pushnil( L ); lua_pushnil( L );
+1 -1
View File
@@ -58,7 +58,7 @@ namespace LuaHelpers
/* Run the given expression, returning a single value, and leave the return value on the /* Run the given expression, returning a single value, and leave the return value on the
* stack. On error, push nil. */ * stack. On error, push nil. */
bool RunExpression( Lua *L, const RString &sExpression ); bool RunExpression( Lua *L, const RString &sExpression, const RString &sName = "" );
bool RunScriptFile( const RString &sFile ); bool RunScriptFile( const RString &sFile );