2 using System.Collections.Generic;
9 namespace MonoTests.Visit
12 public class ASTVisitorTest
14 class TestVisitor : StructuralVisitor
26 //string content = @"class A { }";
33 completionList.Add (""delegate"" + sb, ""md-keyword"", GettextCatalog.GetString (""Creates anonymous delegate.""), ""delegate"" + sb + "" {"" + Document.Editor.EolMarker + stateTracker.Engine.ThisLineIndent + TextEditorProperties.IndentString + ""|"" + Document.Editor.EolMarker + stateTracker.Engine.ThisLineIndent +""};"");
39 var stream = new MemoryStream (Encoding.UTF8.GetBytes (content));
41 var ctx = new CompilerContext (new CompilerSettings (), new Report (new AssertReportPrinter ()));
43 ModuleContainer module = new ModuleContainer (ctx);
44 CSharpParser parser = new CSharpParser (
45 new SeekableStreamReader (stream, Encoding.UTF8),
46 new CompilationUnit ("name", "path", 0),
49 RootContext.ToplevelTypes = module;
50 Location.AddFile (ctx.Report, "asdfas");
51 Location.Initialize ();
52 parser.LocationsBag = new LocationsBag ();
55 var m = module.Types[0].Methods[0] as Method;
56 var s = m.Block.FirstStatement;
60 module.Accept (new TestVisitor ());