Skip to content

Comments

WI #2520 Check variables used in EVALUATE / WHEN#2834

Open
efr15 wants to merge 8 commits intodevelopfrom
2520-parser-does-not-check-conditions_2
Open

WI #2520 Check variables used in EVALUATE / WHEN#2834
efr15 wants to merge 8 commits intodevelopfrom
2520-parser-does-not-check-conditions_2

Conversation

@efr15
Copy link
Contributor

@efr15 efr15 commented Feb 16, 2026

Handles partially #2520 for statements EVALUATE and WHEN

Still TO DO :
Check that USAGE are compatible

@efr15 efr15 requested review from Finou1404 and fm-117 February 16, 2026 14:22
@efr15 efr15 self-assigned this Feb 16, 2026
Finou1404
Finou1404 previously approved these changes Feb 18, 2026
@efr15 efr15 requested a review from fm-117 February 18, 2026 17:34
Copy link
Contributor

@fm-117 fm-117 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should simplify the grammar using a single definition for WHEN code elements whether they appear in EVALUATE or SEARCH.

  • this should avoid odd cases where alphanumeric comparison variables/expressions are wrapped as BooleanComparisonVariable

We should also improve the checks performed on ConditionalExpression as we'll have multiple visits

var selectionSubject = selectionSubjects[index];
var selectionObject = selectionObjects[index];
ConditionChecker.CheckWhenStatement(evaluate, when, selectionSubject, selectionObject, index);
ConditionChecker.CheckWhenStatement(evaluate, when, selectionSubject, selectionObject, index + 1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a comment explaining the + 1 on index.

@fm-117 fm-117 self-requested a review February 20, 2026 13:36
{
DataDefinition dataDefinition = node.GetDataDefinitionFromStorageAreaDictionary(storageArea, true);

return new SelectionInfo(dataDefinition?.DataType ?? DataType.Unknown);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

var dataType = dataDefinition?.DataType;
return dataType != null ? new SelectionInfo(dataType) : Unknown;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants