Exemple #1
0
        public UstNode VisitAssignmentExpression(DslParser.AssignmentExpressionContext context)
        {
            Expression result;
            var        left  = (Expression)VisitExpression(context.expression(0));
            var        right = (Expression)VisitExpression(context.expression(1));

            result = new AssignmentExpression(left, right, context.GetTextSpan(), null);
            return(result);
        }
Exemple #2
0
        public PatternUst VisitAssignmentExpression(DslParser.AssignmentExpressionContext context)
        {
            PatternUst result;
            PatternUst left  = VisitExpression(context.expression(0));
            PatternUst right = VisitExpression(context.expression(1));

            if (left is PatternVarOrFieldDeclaration declaration)
            {
                declaration.Assignment.Right = right;
                result = declaration;
            }
            else
            {
                result = new PatternAssignmentExpression(left, right, context.GetTextSpan());
            }
            return(result);
        }