Skip to content

Commit 3651e41

Browse files
committed
Added failing tests for multiple whitespace in front of asType in an array definition.
1 parent 841c10b commit 3651e41

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

RubberduckTests/Grammar/VBAParserTests.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2155,6 +2155,31 @@ End Sub
21552155
AssertTree(parseResult.Item1, parseResult.Item2, "//universalLetterRange", matches => matches.Count == 0);
21562156
}
21572157

2158+
[Category("Parser")]
2159+
[Test]
2160+
public void SLLParserDoesNotThrowForArrayDefinitionInModuleWithMultipleSpacesInFromtOfAsType()
2161+
{
2162+
const string code = @"
2163+
Dim Foo1(0 To 3) As Long
2164+
2165+
";
2166+
var parseResult = Parse(code);
2167+
AssertTree(parseResult.Item1, parseResult.Item2, "//variableSubStmt", matches => matches.Count == 1);
2168+
}
2169+
2170+
[Category("Parser")]
2171+
[Test]
2172+
public void SLLParserDoesNotThrowForArrayDefinitionInSubWithMultipleSpacesInFromtOfAsType()
2173+
{
2174+
const string code = @"
2175+
Sub Test()
2176+
Dim Foo2(0 To 3) As Long
2177+
End Sub
2178+
";
2179+
var parseResult = Parse(code);
2180+
AssertTree(parseResult.Item1, parseResult.Item2, "//variableSubStmt", matches => matches.Count == 1);
2181+
}
2182+
21582183
private Tuple<VBAParser, ParserRuleContext> Parse(string code, PredictionMode predictionMode = null)
21592184
{
21602185
var stream = new AntlrInputStream(code);

0 commit comments

Comments
 (0)