private void _UpdateLastVariableAccess(VariableAccess variable, object value) { switch (variable.Operation) { case AccessType.LocalGet: case AccessType.LocalSet: //_FunctionStacks.Last().Locals.Push(variable); break; case AccessType.GlobalGet: case AccessType.GlobalSet: variableAccessStack.Clear(); break; } variableAccessStack.Push(variable); }
/// <summary> /// Creates a wrapper around a variable access expression which will register it /// </summary> public static Expr VariableAccess(CodeContext context, Expression variable, VariableAccess access) { return new VariableAccessExpression(context, variable, access).Reduce(); }
internal static Expr UpdateLastVariableAccess(CodeContext context, VariableAccess variable, Expr value) { return CallBackingMethod("_UpdateLastVariableAccess", context, Expr.Constant(variable), value); }
private readonly Expression _variable; //The expression representing the variable access #endregion Fields #region Constructors /// <summary> /// Creates a wrapper around a variable access expression which will register it /// </summary> public VariableAccessExpression(CodeContext context, Expression variable, VariableAccess access) { _context = context; _variable = variable; _access = access; }