public override void RebuildScope(FunctionInfo functionInfo, Dictionary <string, VariableDescriptor> transferedVariables, int scopeBias) { _initializer?.RebuildScope(functionInfo, transferedVariables, scopeBias); _condition?.RebuildScope(functionInfo, transferedVariables, scopeBias); _body?.RebuildScope(functionInfo, transferedVariables, scopeBias); _post?.RebuildScope(functionInfo, transferedVariables, scopeBias); }
public override void RebuildScope(FunctionInfo functionInfo, Dictionary <string, VariableDescriptor> transferedVariables, int scopeBias) { _scope?.RebuildScope(functionInfo, transferedVariables, scopeBias); var tempVariables = new Dictionary <string, VariableDescriptor>(); _body?.RebuildScope(functionInfo, tempVariables, scopeBias + 1); if (!(_body is CodeBlock block)) { return; } var variables = new List <VariableDescriptor>(); foreach (var variable in tempVariables) { if ((variable.Value is ParameterDescriptor) || !(variable.Value.initializer is FunctionDefinition)) { transferedVariables.Add(variable.Key, variable.Value); } else { variables.Add(variable.Value); } } block._variables = variables.ToArray(); block._suppressScopeIsolation = block._variables.Length == 0 ? SuppressScopeIsolationMode.Suppress : SuppressScopeIsolationMode.DoNotSuppress; }
public override void RebuildScope(FunctionInfo functionInfo, Dictionary <string, VariableDescriptor> transferedVariables, int scopeBias) { body.RebuildScope(functionInfo, transferedVariables, scopeBias); if (catchBody != null) { VariableDescriptor variableToRestore = null; if (transferedVariables != null) { transferedVariables.TryGetValue(catchVariableDesc.name, out variableToRestore); transferedVariables[catchVariableDesc.name] = catchVariableDesc; } catchBody.RebuildScope(functionInfo, transferedVariables, scopeBias); if (transferedVariables != null) { if (variableToRestore != null) { transferedVariables[variableToRestore.name] = variableToRestore; } else { transferedVariables.Remove(catchVariableDesc.name); } } } finallyBody?.RebuildScope(functionInfo, transferedVariables, scopeBias); }
public override void RebuildScope(FunctionInfo functionInfo, Dictionary <string, VariableDescriptor> transferedVariables, int scopeBias) { image.RebuildScope(functionInfo, transferedVariables, scopeBias); for (var i = 0; i < cases.Length; i++) { if (cases[i].statement != null) { cases[i].statement.RebuildScope(functionInfo, transferedVariables, scopeBias); } } for (var i = 0; i < lines.Length; i++) { lines[i]?.RebuildScope(functionInfo, transferedVariables, scopeBias); } }
public override void RebuildScope(FunctionInfo functionInfo, Dictionary <string, VariableDescriptor> transferedVariables, int scopeBias) { if (_reexportSourceModuleName != null) { return; } if (_internalDefinition != null) { _internalDefinition.RebuildScope(functionInfo, transferedVariables, scopeBias); } else { for (var i = 0; i < _map.Count; i++) { _map[i].Value.RebuildScope(functionInfo, transferedVariables, scopeBias); } } }
public override void RebuildScope(FunctionInfo functionInfo, Dictionary <string, VariableDescriptor> transferedVariables, int scopeBias) { _variable.RebuildScope(functionInfo, transferedVariables, scopeBias); _source.RebuildScope(functionInfo, transferedVariables, scopeBias); _body?.RebuildScope(functionInfo, transferedVariables, scopeBias); }
public override void RebuildScope(FunctionInfo functionInfo, Dictionary <string, VariableDescriptor> transferedVariables, int scopeBias) { statement.RebuildScope(functionInfo, transferedVariables, scopeBias); }