1
ļ»æ// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
2
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
7
using ICSharpCode.NRefactory.VB.Parser;
9
namespace ICSharpCode.NRefactory.VB.Tests.Lexer
12
public class LexerContextTests
15
public void SimpleGlobal()
26
public void VariableWithXmlLiteral()
64
public void MemberWithXmlLiteral()
68
Private xml As XElement = <b />
120
public void GlobalAttributeTest()
123
@"<assembly: CLSCompliant(True)>
133
enter TypeDeclaration
157
public void ClassAttributeTest()
170
enter TypeDeclaration
194
public void MethodAttributeTest()
205
enter TypeDeclaration
231
public void WithBlockTest()
243
enter TypeDeclaration
267
public void StatementsTest()
272
For i As Integer = 0 To 10
276
For Each x As Integer In list
289
enter TypeDeclaration
345
public void ClassTest()
348
@"Class MainClass ' a comment
349
Dim under_score_field As Integer
352
For Each loopVarName In collection
357
enter TypeDeclaration
400
public void CollectionInitializer()
403
' Created by SharpDevelop.
408
' To change this template use Tools | Options | Coding | Edit Standard Headers.
414
Imports System.Xml.Linq
418
Console.WriteLine(""Hello World!"")
421
Dim content = { 4, 5, New XAttribute(""a"", 3) }
423
Dim xml = <<%= name %> <%= content %> />
433
enter TypeDeclaration
540
public void Imports()
542
RunTest(@"Imports System
544
Imports System.Collections.Generic",
556
void RunTest(string code, string expectedOutput)
558
ExpressionFinder p = new ExpressionFinder();
559
VBLexer lexer = new VBLexer(new StringReader(code));
563
t = lexer.NextToken();
565
} while (t.Kind != Tokens.EOF);
567
Console.WriteLine(p.Output);
569
Assert.IsEmpty(p.Errors);
571
Assert.AreEqual(expectedOutput, p.Output);