Changeset 358 for trunk/src/lua/lua_nova.cc
- Timestamp:
- 04/29/15 14:53:06 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lua/lua_nova.cc
r323 r358 83 83 lua_pushvalue( L, itype ); 84 84 lua_pushvalue( L, iid ); 85 lua_push string( L, "." );85 lua_pushliteral( L, "." ); 86 86 lua_pushvalue( L, ifield ); 87 87 lua_concat( L, 3 ); … … 292 292 { 293 293 // storage.__counter++ 294 lua_push string( L, "__counter" );294 lua_pushliteral( L, "__counter" ); 295 295 lua_pushvalue( L, -1 ); 296 296 lua_rawget( L, 1 ); … … 303 303 304 304 // element.nid = __counter 305 lua_push string( L, "nid" );305 lua_pushliteral( L, "nid" ); 306 306 lua_pushinteger( L, count ); 307 307 lua_rawset( L, 2 ); … … 322 322 323 323 // element.id = element.id 324 lua_push string( L, "id" );324 lua_pushliteral( L, "id" ); 325 325 lua_rawget( L, 2 ); 326 326 if ( lua_isnil( L, -1 ) ) … … 413 413 414 414 lua_pushvalue( L, 1 ); 415 lua_push string( L, "." );415 lua_pushliteral( L, "." ); 416 416 lua_pushvalue( L, 2 ); 417 417 lua_concat( L, 3 ); // new ident index 5 … … 449 449 450 450 lua_pushvalue( L, 1 ); 451 lua_push string( L, "." );451 lua_pushliteral( L, "." ); 452 452 lua_pushvalue( L, 2 ); 453 453 lua_concat( L, 3 ); // new ident index 6 … … 579 579 if ( lua_type( L, 1 ) == LUA_TSTRING ) 580 580 { 581 // TODO: Optimzie 581 582 lua_getglobal( L, lua_tostring( L, 1 ) ); 582 583 lua_replace( L, 1 ); … … 809 810 } 810 811 811 void nv::lua::register_storage( state* a_state, const string& name, const string&constructor_name )812 void nv::lua::register_storage( state* a_state, string_ref name, string_ref constructor_name ) 812 813 { 813 814 // TODO: error checking … … 816 817 // TODO: check if nova is loaded 817 818 lua_pushcfunction( L, nova_register_storage ); 818 lua_push string( L, name.c_str() );819 lua_pushlstring( L, name.data(), name.size() ); 819 820 lua_call( L, 1, 1 ); 820 lua_setglobal( L, constructor_name. c_str() );821 lua_setglobal( L, constructor_name.data() ); 821 822 lua_settop( L, stack ); 822 823 }
Note: See TracChangeset
for help on using the changeset viewer.