Skip to content

Commit adf77c2

Browse files
authored
Merge pull request #4303 from mansellan/4302
Grammar tweak for indexed properties in form header (VB6)
2 parents 3777334 + 2fac7d6 commit adf77c2

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

Rubberduck.Parsing/Grammar/VBAParser.g4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ moduleConfig :
5656
;
5757

5858
moduleConfigProperty :
59-
BEGINPROPERTY whiteSpace unrestrictedIdentifier (whiteSpace GUIDLITERAL)? endOfStatement
59+
BEGINPROPERTY whiteSpace unrestrictedIdentifier (LPAREN numberLiteral RPAREN)? (whiteSpace GUIDLITERAL)? endOfStatement
6060
(moduleConfigProperty | moduleConfigElement)+
6161
ENDPROPERTY endOfStatement
6262
;

RubberduckTests/Grammar/VBAParserTests.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,6 +1097,24 @@ BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
10971097
AssertTree(parseResult.Item1, parseResult.Item2, "//moduleConfigProperty", matches => matches.Count == 2);
10981098
}
10991099

1100+
[Category("Parser")]
1101+
[Test]
1102+
public void TestIndexedProperty()
1103+
{
1104+
string code = @"
1105+
VERSION 5.00
1106+
Begin VB.Form Form1
1107+
Begin ComctlLib.ListView lvFilter
1108+
BeginProperty ColumnHeader(1) {0713E8C7-850A-101B-AFC0-4210102A8DA7}
1109+
Caption = ""ID""
1110+
EndProperty
1111+
End
1112+
End
1113+
";
1114+
var parseResult = Parse(code);
1115+
AssertTree(parseResult.Item1, parseResult.Item2, "//moduleConfigProperty", matches => matches.Count == 1);
1116+
}
1117+
11001118
[Category("Parser")]
11011119
[Test]
11021120
public void TestEmptyComment()

0 commit comments

Comments
 (0)