pascalabcnet/Yield/YieldConversionSyntax/YieldDesugarSyntaxTreeConverter.cs
2017-04-28 22:41:40 +03:00

40 lines
1.2 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PascalABCCompiler.SyntaxTree;
using SyntaxVisitors;
using PascalABCCompiler.SyntaxTreeConverters;
namespace YieldDesugarSyntaxTreeConverter
{
// Он перестал быть нужен, поскольку код YieldDesugarSyntaxTreeConverter.Convert был явно добавлен в StandardSyntaxTreeConverter.Convert
// Со временем этот проект надо исключить из решения, а YieldConversionSyntax.dll - исключить из инсталлята
public class YieldDesugarSyntaxTreeConverter : ISyntaxTreeConverter
{
public string Name { get; } = "YieldDesugar";
public syntax_tree_node Convert(syntax_tree_node root)
{
root.visit(new MarkMethodHasYieldAndCheckSomeErrorsVisitor());
ProcessYieldCapturedVarsVisitor.New.ProcessNode(root);
#if DEBUG
try
{
//root.visit(new SimplePrettyPrinterVisitor(@"d:\\zzz3.txt"));
}
catch
{
}
#endif
return root;
}
}
}