mirror of
				https://github.com/Reuh/anselme.git
				synced 2025-10-27 16:49:31 +00:00 
			
		
		
		
	Merge state on vm:eval, new aliases need to be merged
This commit is contained in:
		
							parent
							
								
									721464218c
								
							
						
					
					
						commit
						607313d5ce
					
				
					 3 changed files with 18 additions and 9 deletions
				
			
		|  | @ -32,9 +32,13 @@ local common | |||
| common = { | ||||
| 	--- merge interpreter state with global state | ||||
| 	merge_state = function(state) | ||||
| 		local global_vars = state.interpreter.global_state.variables | ||||
| 		local global = state.interpreter.global_state | ||||
| 		for alias, fqm in pairs(state.aliases) do | ||||
| 			global.aliases[alias] = fqm | ||||
| 			state.aliases[alias] = nil | ||||
| 		end | ||||
| 		for var, value in pairs(state.variables) do | ||||
| 			global_vars[var] = value | ||||
| 			global.variables[var] = value | ||||
| 			state.variables[var] = nil | ||||
| 		end | ||||
| 	end, | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue