diff --git a/src/Libraries/NRefactory/Project/Src/Lexer/VBNet/Lexer.cs b/src/Libraries/NRefactory/Project/Src/Lexer/VBNet/Lexer.cs index beac28ac61..60a8bc0354 100644 --- a/src/Libraries/NRefactory/Project/Src/Lexer/VBNet/Lexer.cs +++ b/src/Libraries/NRefactory/Project/Src/Lexer/VBNet/Lexer.cs @@ -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 diff --git a/src/Libraries/NRefactory/Test/Lexer/VBNet/ImplicitLineContinuationTests.cs b/src/Libraries/NRefactory/Test/Lexer/VBNet/ImplicitLineContinuationTests.cs index 944d4470d2..5b7f78ed63 100644 --- a/src/Libraries/NRefactory/Test/Lexer/VBNet/ImplicitLineContinuationTests.cs +++ b/src/Libraries/NRefactory/Test/Lexer/VBNet/ImplicitLineContinuationTests.cs @@ -161,6 +161,30 @@ End Class"; ); } + [Test] + public void LineContinuationAfterAttributes() + { + string code = @" +Public Class TestContinuation + + 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) {