Lines Matching +full:pre +full:- +full:set

60     state.get_table(-2);  in get_global_tree()
61 if (state.is_nil(-1)) in get_global_tree()
64 config::tree& tree = **state.to_userdata< config::tree* >(-1); in get_global_tree()
70 /// Gets a fully-qualified tree key from the state.
85 PRE(state.is_string(field_index)); in get_tree_key()
94 tree_key = state.to_string(-1) + "." + state.to_string(field_index - 1); in get_tree_key()
108 /// \post state(-1) Contains the new table.
121 state.set_table(-3); in new_table_for_key()
125 state.set_table(-3); in new_table_for_key()
129 state.set_table(-3); in new_table_for_key()
131 state.set_metatable(-2); in new_table_for_key()
138 /// \pre state(-3) The table to index. If this is not _G, then the table
141 /// \pre state(-2) The field to index into the table. Must be a string.
142 /// \pre state(-1) The value to set the indexed table field to.
151 /// set on the key, or if the input table or index are invalid.
155 if (!state.is_table(-3)) in redirect_newindex()
157 if (!state.is_string(-2)) in redirect_newindex()
161 const std::string dotted_key = get_tree_key(state, -3, -2); in redirect_newindex()
164 tree.set_lua(dotted_key, state, -1); in redirect_newindex()
170 // Now really set the key in the Lua table, but prevent direct accesses from in redirect_newindex()
171 // the user by prefixing it. We do this to ensure that re-setting the same in redirect_newindex()
173 state.push_string("_" + state.to_string(-2)); in redirect_newindex()
174 state.push_value(-2); in redirect_newindex()
175 state.raw_set(-5); in redirect_newindex()
183 /// \pre state(-3) The table to index. If this is not _G, then the table
186 /// \pre state(-1) The field to index into the table. Must be a string.
196 if (!state.is_table(-2)) in redirect_index()
198 if (!state.is_string(-1)) in redirect_index()
202 // Query if the key has already been set by a call to redirect_newindex. in redirect_index()
203 state.push_string("_" + state.to_string(-1)); in redirect_index()
204 state.raw_get(-3); in redirect_index()
205 if (!state.is_nil(-1)) in redirect_index()
209 state.push_value(-1); // Duplicate the field name. in redirect_index()
210 state.raw_get(-3); // Get table[field] to see if it's defined. in redirect_index()
211 if (state.is_nil(-1)) { in redirect_index()
217 INV(state.is_table(-2)); in redirect_index()
218 INV(state.is_string(-1)); in redirect_index()
221 const std::string tree_key = get_tree_key(state, -2, -1); in redirect_index()
223 // Publish the pre-recorded value in the tree to the Lua state, in redirect_index()
227 state.push_string("_" + state.to_string(-1)); in redirect_index()
228 state.insert(-2); in redirect_index()
236 state.push_value(-1); in redirect_index()
237 state.insert(-4); in redirect_index()
239 state.raw_set(-3); in redirect_index()
250 /// Install wrappers for globals to set values in the configuration tree.
268 state.set_table(-3); in redirect()
272 state.set_table(-3); in redirect()
274 state.set_metatable(-1); in redirect()
280 state.set_table(-3); in redirect()