Skip to content

Commit 66a77ec

Browse files
committed
Add red test reproducing lineSpecialForm grammar bug
see #4875
1 parent 2925035 commit 66a77ec

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

RubberduckTests/Grammar/VBAParserTests.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3779,6 +3779,22 @@ End Type
37793779
AssertTree(parseResult.Item1, parseResult.Item2, "//unrestrictedIdentifier", matches => matches.Count == 1);
37803780
}
37813781

3782+
[Test]
3783+
[Category("Parser")]
3784+
public void LineSpecialForm_WithLineContinuations()
3785+
{
3786+
// Taken from opened issue https://github.com/rubberduck-vba/Rubberduck/issues/4875
3787+
const string code = @"
3788+
Sub Whatever()
3789+
Section.Parent.Line ((.Left + .Width + SectionProperties.VerticalLineMargin), _
3790+
PageHeaderHeight + tmpTopMargin + Abs(Section.Parent.Top)) _
3791+
-Step(0, Section.Parent.Height)
3792+
End Sub
3793+
";
3794+
var parseResult = Parse(code);
3795+
AssertTree(parseResult.Item1, parseResult.Item2, "//lineSpecialForm", matches => matches.Count == 1);
3796+
}
3797+
37823798

37833799
[Test]
37843800
[Category("Parser")]

0 commit comments

Comments
 (0)