Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Reference()

void System.Linq.Expressions.Compiler.VariableBinder.Reference ( ParameterExpression node,
VariableStorageKind storage )
inlineprivate

Definition at line 212 of file VariableBinder.cs.

213 {
214 CompilerScope compilerScope = null;
215 foreach (CompilerScope scope in _scopes)
216 {
217 if (scope.Definitions.ContainsKey(node))
218 {
219 compilerScope = scope;
220 break;
221 }
222 scope.NeedsClosure = true;
223 if (scope.IsMethod)
224 {
226 }
227 }
228 if (compilerScope == null)
229 {
230 throw Error.UndefinedVariable(node.Name, node.Type, CurrentLambdaName);
231 }
232 if (storage == VariableStorageKind.Hoisted)
233 {
234 if (node.IsByRef)
235 {
236 throw Error.CannotCloseOverByRef(node.Name, CurrentLambdaName);
237 }
238 compilerScope.Definitions[node] = VariableStorageKind.Hoisted;
239 }
240 }
readonly Stack< CompilerScope > _scopes

References System.Linq.Expressions.Compiler.VariableBinder._scopes, System.Linq.Expressions.Error.CannotCloseOverByRef(), System.Collections.Generic.Dictionary< TKey, TValue >.ContainsKey(), System.Linq.Expressions.Compiler.VariableBinder.CurrentLambdaName, System.Linq.Expressions.Compiler.CompilerScope.Definitions, System.Linq.Expressions.Compiler.CompilerScope.IsMethod, and System.Linq.Expressions.Error.UndefinedVariable().

Referenced by System.Linq.Expressions.Compiler.VariableBinder.VisitParameter(), and System.Linq.Expressions.Compiler.VariableBinder.VisitRuntimeVariables().