Skip to content

Commit 498c535

Browse files
authored
Merge pull request #2359 from retailcoder/next
Additional tests (ref. #2206)
2 parents a998eed + 7491a5d commit 498c535

File tree

2 files changed

+31
-8
lines changed

2 files changed

+31
-8
lines changed

RetailCoder.VBE/API/ParserState.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ public sealed class ParserState : IParserState, IDisposable
5252
private RubberduckParserState _state;
5353
private AttributeParser _attributeParser;
5454
private RubberduckParser _parser;
55-
private Sinks _sinks;
5655
private VBE _vbe;
5756

5857
public ParserState()
@@ -156,10 +155,6 @@ public void Dispose()
156155
_state.StateChanged -= _state_StateChanged;
157156
}
158157

159-
if (_sinks != null)
160-
{
161-
_sinks.Dispose();
162-
}
163158

164159
_vbe.Release();
165160
_disposed = true;

RubberduckTests/Grammar/VBAParserTests.cs

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1503,13 +1503,41 @@ End Type
15031503
AssertTree(parseResult.Item1, parseResult.Item2, "//udtMember", matches => matches.Count == 13);
15041504
}
15051505

1506+
1507+
[TestMethod]
1508+
public void TestNestedParensForLiteralExpression()
1509+
{
1510+
//Assert.Inconclusive("See issue #2206");
1511+
const string code = @"
1512+
Sub Test()
1513+
Dim foo As Integer
1514+
foo = ((42) + ((12)))
1515+
End Sub
1516+
";
1517+
var parseResult = Parse(code);
1518+
AssertTree(parseResult.Item1, parseResult.Item2, "//literalExpression", matches => matches.Count == 2);
1519+
}
1520+
1521+
[TestMethod]
1522+
public void TestParensForByValSingleArg()
1523+
{
1524+
//Assert.Inconclusive("See issue #2206");
1525+
const string code = @"
1526+
Sub Test()
1527+
DoSomething (foo)
1528+
End Sub
1529+
";
1530+
var parseResult = Parse(code);
1531+
AssertTree(parseResult.Item1, parseResult.Item2, "//argumentExpression", matches => matches.Count == 1);
1532+
}
1533+
15061534
[TestMethod]
1507-
public void TestNestedParensForByValArgument()
1535+
public void TestParensForByValFirstArg()
15081536
{
1509-
Assert.Inconclusive("See issue #");
1537+
Assert.Inconclusive("See issue #2206");
15101538
const string code = @"
15111539
Sub Test()
1512-
DoSomething (foo), (bar)
1540+
DoSomething (foo), bar
15131541
End Sub
15141542
";
15151543
var parseResult = Parse(code);

0 commit comments

Comments
 (0)