public override IPhpValue Simplify(IPhpExpressionSimplifier s)
 {
     var _expression = SimplifyForFieldAcces(expression, s);
     if (arguments == null || arguments.Length == 0)
     {
         if (EqualCode(_expression, expression))
             return this;
         return new PhpElementAccessExpression(_expression, null);
     }
     var _arguments = arguments.Select(i => StripBracketsAndSimplify(i, s)).ToArray();
     var candidate = new PhpElementAccessExpression(_expression, _arguments);
     if (EqualCode(candidate, this))
         return this;
     return candidate;
 }
Beispiel #2
0
        public override IPhpValue Simplify(IPhpExpressionSimplifier s)
        {
            var _expression = SimplifyForFieldAcces(expression, s);

            if (arguments == null || arguments.Length == 0)
            {
                if (EqualCode(_expression, expression))
                {
                    return(this);
                }
                return(new PhpElementAccessExpression(_expression, null));
            }
            var _arguments = arguments.Select(i => StripBracketsAndSimplify(i, s)).ToArray();
            var candidate  = new PhpElementAccessExpression(_expression, _arguments);

            if (EqualCode(candidate, this))
            {
                return(this);
            }
            return(candidate);
        }