Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RangeStatement validation in CASE #591

Closed
99NIMI opened this issue Sep 27, 2022 · 0 comments · Fixed by #612
Closed

RangeStatement validation in CASE #591

99NIMI opened this issue Sep 27, 2022 · 0 comments · Fixed by #612
Assignees
Labels
bug Something isn't working validation candidate for syntactic or semantic validation

Comments

@99NIMI
Copy link
Member

99NIMI commented Sep 27, 2022

found in OSCAT

CASE DAYS_IN_MONTH OF
  32..60	:	DAYS_IN_MONTH := 29;
  92..121 :	DAYS_IN_MONTH := 30;
  153..182:	DAYS_IN_MONTH := 30;
  245..274:	DAYS_IN_MONTH := 30;
  306..335:	DAYS_IN_MONTH := 30;
ELSE
  DAYS_IN_MONTH := 31;
END_CASE;

these should be valid cases but currently we will get the following error

error: Cannot resolve constant: RangeStatement {
    start: LiteralInteger {
        value: 32,
    },
    end: LiteralInteger {
        value: 60,
    },
}. Non constant variables are not supported in case conditions

for RangeStatements we need to visit the start and end statement and check if constant

@99NIMI 99NIMI added the bug Something isn't working label Sep 27, 2022
@99NIMI 99NIMI self-assigned this Sep 27, 2022
@ghaith ghaith assigned ghaith and unassigned 99NIMI Oct 19, 2022
@ghaith ghaith linked a pull request Oct 21, 2022 that will close this issue
@ghaith ghaith moved this to Done in Next Jan 9, 2023
@ghaith ghaith added this to Next Jan 9, 2023
@riederm riederm added the validation candidate for syntactic or semantic validation label Feb 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working validation candidate for syntactic or semantic validation
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants