Siegfried Pammer 16 years ago
parent
commit
fe198da3f5
  1. 3
      src/Libraries/NRefactory/Project/Src/Lexer/VBNet/Lexer.cs
  2. 24
      src/Libraries/NRefactory/Test/Lexer/VBNet/ImplicitLineContinuationTests.cs

3
src/Libraries/NRefactory/Project/Src/Lexer/VBNet/Lexer.cs

@ -436,7 +436,8 @@ namespace ICSharpCode.NRefactory.Parser.VB @@ -436,7 +436,8 @@ namespace ICSharpCode.NRefactory.Parser.VB
// 6th rule
// after a greater-than (>) in a non-file-level attribute context
if (prevTokenKind == Tokens.GreaterThan && ef.InContext(Context.Attribute))
// HACK cannot detect if token was end of attribute, just allow all GreaterThan tokens
if (prevTokenKind == Tokens.GreaterThan)
return true;
// 7th rule

24
src/Libraries/NRefactory/Test/Lexer/VBNet/ImplicitLineContinuationTests.cs

@ -161,6 +161,30 @@ End Class"; @@ -161,6 +161,30 @@ End Class";
);
}
[Test]
public void LineContinuationAfterAttributes()
{
string code = @"<TestFixture>
Public Class TestContinuation
<Test>
Public Sub TestMethod
Assert.Fail
End Sub
End Class";
ILexer lexer = GenerateLexer(new StringReader(code));
CheckTokens(
lexer, Tokens.LessThan, Tokens.Identifier, Tokens.GreaterThan,
Tokens.Public, Tokens.Class, Tokens.Identifier, Tokens.EOL,
Tokens.LessThan, Tokens.Identifier, Tokens.GreaterThan,
Tokens.Public, Tokens.Sub, Tokens.Identifier, Tokens.EOL,
Tokens.Identifier, Tokens.Dot, Tokens.Identifier, Tokens.EOL,
Tokens.End, Tokens.Sub, Tokens.EOL,
Tokens.End, Tokens.Class
);
}
#region Helpers
ILexer GenerateLexer(StringReader sr)
{

Loading…
Cancel
Save