pascalabcnet/SyntaxVisitors/SugarVisitors/TupleVisitor.cs
Бондарев Иван 65a2566223 bug fix #347
add missing copyrights
change year in copyright
2017-02-19 14:29:24 +01:00

32 lines
1 KiB
C#

// Copyright (c) Ivan Bondarev, Stanislav Mihalkovich (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PascalABCCompiler.SyntaxTree;
namespace SyntaxVisitors.SugarVisitors
{
public class TupleVisitor : BaseChangeVisitor
{
public static TupleVisitor New
{
get { return new TupleVisitor(); }
}
public override void visit(tuple_node tup)
{
var dn = new dot_node(new dot_node(new ident("?System"), new ident("Tuple")), new ident("Create", tup.source_context));
var mc = new method_call(dn, tup.el, tup.source_context);
//var sug = new sugared_expression(tup, mc, tup.source_context); - нет никакой семантической проверки - всё - на уровне синтаксиса!
ReplaceUsingParent(tup, mc);
visit(mc);
}
}
}