Exemplo n.º 1
0
        public Increment(Expression op, IncrimentType type)
            : base(op, null, type == IncrimentType.Postincriment)
        {
            if (op == null)
            {
                throw new ArgumentNullException("op");
            }

            _type = type;
        }
Exemplo n.º 2
0
        public override bool Build(ref CodeNode _this, int expressionDepth, Dictionary <string, VariableDescriptor> variables, CodeContext codeContext, InternalCompilerMessageCallback message, FunctionInfo stats, Options opts)
        {
            _codeContext = codeContext;

            Parser.Build(ref _left, expressionDepth + 1, variables, codeContext | CodeContext.InExpression, message, stats, opts);
            if (expressionDepth <= 1 && _type == IncrimentType.Postincriment)
            {
                _type = IncrimentType.Preincriment;
            }
            var f = _left as VariableReference ?? ((_left is AssignmentOperatorCache) ? (_left as AssignmentOperatorCache).Source as VariableReference : null);

            if (f != null)
            {
                (f.Descriptor.assignments ??
                 (f.Descriptor.assignments = new System.Collections.Generic.List <Expression>())).Add(this);
            }
            return(false);
        }