public override void VisitUnaryOperatorExpression(UnaryOperatorExpression unary)
        {
            base.VisitUnaryOperatorExpression(unary);

            Identifier identifier = unary.FindIdentifier();

            if (identifier == null)
            {
                return;
            }

            switch (unary.Operator)
            {
            case UnaryOperatorType.Increment:
            case UnaryOperatorType.Decrement:
                unary.ReplaceWith(GetAssignmentExpression(identifier, unary));
                break;

            case UnaryOperatorType.PostDecrement:
            case UnaryOperatorType.PostIncrement:

                var variable = new IdentifierExpression(identifier.Name);
                var name     = new PrimitiveExpression(identifier.Name);

                unary.ReplaceWith(GetHookExpression("LogPostfix", GetSubmissionId(), GetId(), unary.Clone(), name, variable));
                break;
            }
        }
Example #2
0
        public override void VisitUnaryOperatorExpression(UnaryOperatorExpression unary)
        {
            base.VisitUnaryOperatorExpression(unary);

            Identifier identifier = unary.FindIdentifier();

            if (identifier == null)
            {
                return;
            }

            switch (unary.Operator)
            {
            case UnaryOperatorType.Increment:
            case UnaryOperatorType.Decrement:
            case UnaryOperatorType.PostDecrement:
            case UnaryOperatorType.PostIncrement:
                this.lineMap[this.id++] = unary.StartLocation.Line;
                break;
            }
        }
Example #3
0
        public override void VisitUnaryOperatorExpression(UnaryOperatorExpression unary)
        {
            base.VisitUnaryOperatorExpression (unary);

            Identifier identifier = unary.FindIdentifier();
            if (identifier == null)
                return;

            switch (unary.Operator)
            {
                case UnaryOperatorType.Increment:
                case UnaryOperatorType.Decrement:
                    unary.ReplaceWith (GetAssignmentExpression (identifier, unary));
                    break;

                case UnaryOperatorType.PostDecrement:
                case UnaryOperatorType.PostIncrement:

                    var variable = new IdentifierExpression (identifier.Name);
                    var name = new PrimitiveExpression (identifier.Name);

                    unary.ReplaceWith (GetHookExpression ("LogPostfix", GetSubmissionId(), GetId(), unary.Clone(), name, variable));
                    break;
            }
        }
Example #4
0
        public override void VisitUnaryOperatorExpression(UnaryOperatorExpression unary)
        {
            base.VisitUnaryOperatorExpression (unary);

            Identifier identifier = unary.FindIdentifier();
            if (identifier == null)
                return;

            switch (unary.Operator)
            {
                case UnaryOperatorType.Increment:
                case UnaryOperatorType.Decrement:
                case UnaryOperatorType.PostDecrement:
                case UnaryOperatorType.PostIncrement:
                    this.lineMap[this.id++] = unary.StartLocation.Line;
                    break;
            }
        }