Ejemplo n.º 1
0
        protected override IPhpValue VisitAssignExpression(CsharpAssignExpression src)
        {
            var l  = TransValue(src.Left);
            var r  = TransValue(src.Right);
            var op = src.OptionalOperator;

            if (op == "+")
            {
                var vt = (src as IValue).ValueType;
                if (vt == typeof(string))
                {
                    op = ".";
                }
            }
            var a = new PhpAssignExpression(l, r, op);

            return(SimplifyPhpExpression(a));
        }
Ejemplo n.º 2
0
        private IValue internalVisit_AssignWithPrefix(BinaryExpressionSyntax node, string _operator)
        {
            var symbolInfo = ModelExtensions.GetSymbolInfo(state.Context.RoslynModel, node);
            // var typex = GetResultTypeForBinaryExpression(symbolInfo);
            //TypeInfo ti = ModelExtensions.GetTypeInfo(state.Context.RoslynModel, node);

            //TypeInfo eti = ModelExtensions.GetTypeInfo(state.Context.RoslynModel, node.Expression);
            var eti2 = state.Context.RoslynModel.GetTypeInfo2(node);

            if (!eti2.Conversion1.HasValue || !eti2.Conversion1.Value.IsIdentity)
            {
                throw new NotSupportedException();
            }
            //if (symbolInfo.Symbol.IsImplicitlyDeclared)
            //    throw new Exception();
            var l = Visit(node.Left);
            var r = Visit(node.Right);
            var a = new CsharpAssignExpression(l, r, _operator);

            return(Simplify(a));
        }
Ejemplo n.º 3
0
        protected override IPyStatement[] VisitAssignExpression(CsharpAssignExpression src)
        {
            var translatedValue = TransValue(src);

            return(MkArray(translatedValue));
        }