Skip to content

Missing validation for control statements #1118

@volsa

Description

@volsa

Is your feature request related to a problem? Please describe.
Rusty currently lacks if, for and while specific validations. Specifically all of the following control statements will panic without any validation errors

FUNCTION main : DINT
VAR
    i : DINT;
    x : STRING;
END_VAR
    IF x THEN END_IF
    WHILE x DO END_WHILE
    FOR i := 0 TO x DO END_FOR
END_FUNCTION

Describe the solution you'd like
Implement specific validation for the given control statements, i.e. if conditions are only allowed to have a type / type-hint of bool, for loops and their counter, start, end and step value are only allowed to have integers of the same type and are not allowed to be modified inside the for body (as specified in the norm), etc...

Additional context
This is a tracking issue, the following need to be implemented in order to close this

Metadata

Metadata

Assignees

No one assigned

    Labels

    trackingA tracking issue for a big featurevalidationcandidate for syntactic or semantic validation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions