Skip to content

Commit c5ab99e

Browse files
committed
Clarify todos and add comments
1 parent 02cad44 commit c5ab99e

File tree

5 files changed

+21
-3
lines changed

5 files changed

+21
-3
lines changed

Rubberduck.CodeAnalysis/Inspections/Concrete/AssignedByValParameterInspection.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ protected override IEnumerable<IInspectionResult> DoGetInspectionResults()
5858

5959
private static bool IsAssignmentToDeclaration(IdentifierReference reference)
6060
{
61+
//Todo: Review whether this is still needed once parameterless default member assignments are resolved correctly.
62+
6163
if (!reference.IsAssignment)
6264
{
6365
return false;

Rubberduck.Parsing/Binding/Bindings/DictionaryAccessDefaultBinding.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ public sealed class DictionaryAccessDefaultBinding : IExpressionBinding
1616

1717
private const int DEFAULT_MEMBER_RECURSION_LIMIT = 32;
1818

19+
//This is based on the spec at https://docs.microsoft.com/en-us/openspecs/microsoft_general_purpose_programming_languages/MS-VBAL/f20c9ebc-3365-4614-9788-1cd50a504574
20+
1921
public DictionaryAccessDefaultBinding(
2022
ParserRuleContext expression,
2123
IExpressionBinding lExpressionBinding,

Rubberduck.Parsing/Binding/Bindings/IndexDefaultBinding.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ public sealed class IndexDefaultBinding : IExpressionBinding
1616

1717
private const int DEFAULT_MEMBER_RECURSION_LIMIT = 32;
1818

19+
//This is based on the spec at https://docs.microsoft.com/en-us/openspecs/microsoft_general_purpose_programming_languages/MS-VBAL/551030b2-72a4-4c95-9cb0-fb8f8c8774b4
20+
1921
public IndexDefaultBinding(
2022
ParserRuleContext expression,
2123
IExpressionBinding lExpressionBinding,
@@ -250,7 +252,7 @@ private IBoundExpression ResolveDefaultMember(IBoundExpression lExpression, stri
250252
index expression references this default member and takes on its classification and
251253
declared type.
252254
253-
TODO: Improve argument compatibility check.
255+
TODO: Improve argument compatibility check by checking the argument types.
254256
*/
255257
var parameters = ((IParameterizedDeclaration) defaultMember).Parameters.ToList();
256258
if (ArgumentListIsCompatible(parameters, _argumentList))
@@ -350,7 +352,7 @@ takes on the classification and declared type of <l-expression> and references t
350352
references an individual element of the array, is classified as a variable and has the
351353
declared type of the array’s element type.
352354
353-
TODO: Implement compatibility checking / amend the grammar
355+
TODO: Implement compatibility checking
354356
*/
355357

356358
return new IndexExpression(indexedDeclaration, ExpressionClassification.Variable, _expression, lExpression, _argumentList, isArrayAccess: true);

Rubberduck.Parsing/Grammar/VBAParser.g4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ visibility : PRIVATE | PUBLIC | FRIEND | GLOBAL;
647647
// 5.6 Expressions
648648
expression :
649649
// Literal Expression has to come before lExpression, otherwise it'll be classified as simple name expression instead.
650-
//The same holds for Built-in Type Expression.
650+
//The same holds for Built-in Type Expression.
651651
whiteSpace? LPAREN whiteSpace? expression whiteSpace? RPAREN # parenthesizedExpr
652652
| TYPEOF whiteSpace expression # typeofexpr // To make the grammar SLL, the type-of-is-expression is actually the child of an IS relational op.
653653
| HASH expression # markedFileNumberExpr // Added to support special forms such as Input(file1, #file1)

Rubberduck.VBEEditor/Selection.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ public override string ToString()
142142
return !(selection1 == selection2);
143143
}
144144

145+
/// <summary>
146+
/// Orders first by start position and then end position.
147+
/// </summary>
145148
public static bool operator >(Selection selection1, Selection selection2)
146149
{
147150
return IsGreaterPosition(selection1.StartLine, selection1.StartColumn, selection2.StartLine, selection2.StartColumn)
@@ -156,6 +159,9 @@ private static bool IsGreaterPosition(int line1, int column1, int line2, int col
156159
&& column1 > column2;
157160
}
158161

162+
/// <summary>
163+
/// Orders first by start position and then end position.
164+
/// </summary>
159165
public static bool operator <(Selection selection1, Selection selection2)
160166
{
161167
return IsLesserPosition(selection1.StartLine, selection1.StartColumn, selection2.StartLine, selection2.StartColumn)
@@ -170,11 +176,17 @@ private static bool IsLesserPosition(int line1, int column1, int line2, int colu
170176
&& column1 < column2;
171177
}
172178

179+
/// <summary>
180+
/// Orders first by start position and then end position.
181+
/// </summary>
173182
public static bool operator >=(Selection selection1, Selection selection2)
174183
{
175184
return !(selection1 < selection2);
176185
}
177186

187+
/// <summary>
188+
/// Orders first by start position and then end position.
189+
/// </summary>
178190
public static bool operator <=(Selection selection1, Selection selection2)
179191
{
180192
return !(selection1 > selection2);

0 commit comments

Comments
 (0)