1 write to _writer
VisualBasicSyntaxGenerator (1)
147 references to _writer
VisualBasicSyntaxGenerator (147)
Tests\TestWriter.vb (147)
34_writer.WriteLine("' Tests for parse trees.")
35_writer.WriteLine("' DO NOT HAND EDIT")
36_writer.WriteLine()
42_writer.WriteLine()
43_writer.WriteLine("Namespace Microsoft.CodeAnalysis.VisualBasic.UnitTests")
44_writer.WriteLine()
46_writer.WriteLine("Partial Public Class GeneratedTests")
47_writer.WriteLine()
49_writer.WriteLine("#region ""Green Factory Calls""")
51_writer.WriteLine("#end region")
52_writer.WriteLine()
54_writer.WriteLine("#region ""Green Factory Tests""")
56_writer.WriteLine("#end region")
57_writer.WriteLine()
59_writer.WriteLine("#region ""Green Rewriter Tests""")
61_writer.WriteLine("#end region")
62_writer.WriteLine()
64_writer.WriteLine("#region ""Green Visitor Tests""")
66_writer.WriteLine("#end region")
67_writer.WriteLine()
69_writer.WriteLine("#region ""Red Factory Calls""")
71_writer.WriteLine("#end region")
72_writer.WriteLine()
74_writer.WriteLine("#region ""Red Factory Tests""")
76_writer.WriteLine("#end region")
77_writer.WriteLine()
79_writer.WriteLine("#region ""Red Rewriter Tests""")
81_writer.WriteLine("#end region")
82_writer.WriteLine()
84_writer.WriteLine("End Class")
85_writer.WriteLine("End Namespace")
122_writer.Write(" Private Shared Function ")
127_writer.Write("GenerateGreen" + functionName)
129_writer.Write("GenerateRed" + functionName)
133_writer.WriteLine("() As " + namespacePrefix + nodeStructure.Name)
137_writer.WriteLine("() As SyntaxToken")
139_writer.WriteLine("() As SyntaxTrivia")
141_writer.WriteLine("() As {0}", StructureTypeName(nodeStructure))
213_writer.Write(" return ")
214callTokens.ForEach(AddressOf _writer.Write)
215_writer.WriteLine()
217_writer.WriteLine(" Dim exceptionTest as boolean = false")
221_writer.WriteLine(" Try")
225_writer.Write(callTokens(i))
227_writer.Write("Nothing")
231_writer.WriteLine(" catch e as ArgumentNullException")
232_writer.WriteLine(" exceptionTest = true")
233_writer.WriteLine(" End Try")
234_writer.WriteLine(" Debug.Assert(exceptionTest)")
235_writer.WriteLine(" exceptionTest = false")
236_writer.WriteLine()
242_writer.Write(" Dim node1 = ")
244_writer.Write(callTokens(i))
245If i = 0 Then _writer.Write("String.Empty, ")
247_writer.WriteLine()
249_writer.Write(" dim node2 = ")
250callTokens.ForEach(AddressOf _writer.Write)
251_writer.WriteLine()
253_writer.WriteLine(" Debug.Assert(node1.GetText() = String.Empty)")
254_writer.WriteLine(" Debug.Assert(node2.GetText() <> String.Empty)")
255_writer.WriteLine()
258_writer.WriteLine(" Try")
259_writer.WriteLine(" exceptionTest = false")
262_writer.Write(callTokens(i))
263If i = 0 Then _writer.Write("Nothing, ")
265_writer.WriteLine()
267_writer.WriteLine(" catch e as ArgumentNullException")
268_writer.WriteLine(" exceptionTest = true")
269_writer.WriteLine(" End Try")
270_writer.WriteLine(" Debug.Assert(exceptionTest)")
271_writer.WriteLine()
273_writer.WriteLine(" return node2")
275_writer.Write(" return ")
276callTokens.ForEach(AddressOf _writer.Write)
277_writer.WriteLine()
384_writer.Write(" return ")
385callTokens.ForEach(AddressOf _writer.Write)
386_writer.WriteLine()
389_writer.WriteLine(" Dim exceptionTest as boolean = false")
393_writer.WriteLine(" Try")
395_writer.Write(" ")
398_writer.Write(callTokens(i))
400_writer.Write("Nothing")
403_writer.WriteLine()
405_writer.WriteLine(" catch e as ArgumentNullException")
406_writer.WriteLine(" exceptionTest = true")
407_writer.WriteLine(" End Try")
408_writer.WriteLine(" Debug.Assert(exceptionTest)")
409_writer.WriteLine(" exceptionTest = false")
410_writer.WriteLine()
415_writer.WriteLine(" Try")
416_writer.Write(" ")
419_writer.Write(callTokens(i))
421_writer.Write("SyntaxFactory.Token(SyntaxKind.ExternalSourceKeyword)") ' this syntaxtoken should not be legal anywhere in the tests
424_writer.WriteLine()
426_writer.WriteLine(" catch e as ArgumentException")
427_writer.WriteLine(" exceptionTest = true")
428_writer.WriteLine(" End Try")
429_writer.WriteLine(" Debug.Assert(exceptionTest)")
430_writer.WriteLine(" exceptionTest = false")
431_writer.WriteLine()
436_writer.Write(" ")
439_writer.Write(callTokens(i))
441_writer.Write("New SyntaxToken(Nothing, New InternalSyntax.KeywordSyntax(SyntaxKind.None, Nothing, Nothing, """", Nothing, Nothing), 0, 0)")
444_writer.WriteLine()
445_writer.WriteLine()
448_writer.Write(" return ")
449callTokens.ForEach(AddressOf _writer.Write)
450_writer.WriteLine()
455_writer.WriteLine(" End Function")
456_writer.WriteLine()
483_writer.WriteLine(" <Fact>")
484_writer.Write(" Public Sub ")
486_writer.Write("Test{0}{1}", funcNamePart, FactoryName(nodeKind))
487_writer.WriteLine("()")
489_writer.WriteLine(" dim objectUnderTest = Generate{0}{1}()", funcNamePart, FactoryName(nodeKind))
494_writer.WriteLine(" AttachAndCheckDiagnostics(objectUnderTest)")
499_writer.WriteLine(" Assert.NotNull(objectUnderTest.{0})", LowerFirstCharacter(child.Name))
504_writer.WriteLine(" Dim withObj = objectUnderTest{0}", withStat)
505_writer.WriteLine(" Assert.Equal(withobj, objectUnderTest)")
509_writer.WriteLine(" End Sub")
510_writer.WriteLine()
535_writer.WriteLine(" <Fact>")
536_writer.Write(" Public Sub ")
538_writer.Write("Test{0}{1}Rewriter", funcNamePart, FactoryName(nodeKind))
539_writer.WriteLine("()")
541_writer.WriteLine(" dim oldNode = Generate{0}{1}()", funcNamePart, FactoryName(nodeKind))
542_writer.WriteLine(" Dim rewriter = New {0}IdentityRewriter()", funcNamePart)
543_writer.WriteLine(" Dim newNode = rewriter.Visit(oldNode)")
544_writer.WriteLine(" Assert.Equal(oldNode, newNode)")
545_writer.WriteLine(" End Sub")
546_writer.WriteLine()
572_writer.WriteLine(" <Fact>")
573_writer.Write(" Public Sub ")
575_writer.Write("Test" + funcNamePart + FactoryName(nodeKind) + "Visitor")
576_writer.WriteLine("()")
578_writer.WriteLine(" Dim oldNode = Generate" + funcNamePart + FactoryName(nodeKind) + "()")
579_writer.WriteLine(" Dim visitor = New " + funcNamePart + "NodeVisitor()")
580_writer.WriteLine(" visitor.Visit(oldNode)")
581_writer.WriteLine(" End Sub")
582_writer.WriteLine()
610_writer.Write("new InternalSyntax.SimpleIdentifierSyntax(SyntaxKind.IdentifierToken, Nothing, Nothing, ""text"",")
611_writer.Write("InternalSyntax.SyntaxFactory.SyntaxTrivia(SyntaxKind.WhitespaceTrivia, "" ""), ")
612_writer.Write("InternalSyntax.SyntaxFactory.SyntaxTrivia(SyntaxKind.WhitespaceTrivia, "" ""))")
615_writer.Write("new InternalSyntax.IntegerLiteralToken(""42"", LiteralBase.Decimal, TypeCharacter.None, 42,")
616_writer.Write("InternalSyntax.SyntaxFactory.SyntaxTrivia(SyntaxKind.WhitespaceTrivia, "" ""), ")
617_writer.Write("InternalSyntax.SyntaxFactory.SyntaxTrivia(SyntaxKind.WhitespaceTrivia, "" ""))")