public IAccessorFrameInitializer On(string memberName) { if (_state == null && _current != null) { _current = (AccessorFrame)(_current.Expr.IsMember(memberName) ? _current.NextAccessor : null); } return(this); }
public FrameState(AccessorFrame winner, Func <IAccessorFrame, RuntimeObj, PExpr> indexCode, Func <IAccessorFrame, IReadOnlyList <RuntimeObj>, PExpr> callCode, IReadOnlyList <Expr> arguments) : base(winner, arguments) { _indexCode = indexCode; _callCode = callCode; }
public FunctionExprFrame(AccessorFrame callFrame, FunctionExpr e, IReadOnlyList <Closure> closures) : base(callFrame.Visitor, e) { _arguments = new ArgumentResolver(this, callFrame.Expr.Arguments); _closures = closures; // Registering closed variables. foreach (var c in _closures) { Visitor.ScopeManager.Register(c); } }
public IAccessorFrameInitializer OnCall(Func <IAccessorFrame, IReadOnlyList <RuntimeObj>, PExpr> code) { if (_state == null) { if (_current != null && _current.Expr is AccessorCallExpr) { _state = new FrameState(_current, null, code, _current.Expr.Arguments); } _current = _frame; } return(this); }
public IAccessorFrameInitializer OnIndex(Func <IAccessorFrame, RuntimeObj, PExpr> code) { if (_state == null) { if (_current != null && _current.Expr is AccessorIndexerExpr) { _state = new FrameState(_current, code, null, _current.Expr.Arguments); } _current = _frame; } return(this); }
public IAccessorFrameInitializer OnIndex(Func <IAccessorFrame, RuntimeObj, PExpr> code) { if (_state == null) { AccessorCallExpr c = _current?.Expr as AccessorCallExpr; if (c != null && c.IsIndexer && c.Arguments.Count == 1) { _state = new FrameState(_current, code, null, c.Arguments); } _current = _frame; } return(this); }
public FrameInitializer(AccessorFrame f) { _current = _frame = f; }