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

Semantic Analyser #8

Open
fub-frank opened this issue Jul 9, 2013 · 1 comment
Open

Semantic Analyser #8

fub-frank opened this issue Jul 9, 2013 · 1 comment
Assignees
Labels

Comments

@fub-frank
Copy link

CalendarProg causese the follwoing error in the Semantic Analyser.
It seems Semantic Analyse does not pay attention to the break within the while(true) loop.

TYPE_MISMATCH Line 29 / Column 1-25
Unreachable statement, see previous "return" or "break"

The code:

record {
long year;
long month;
long day;
} [360] calendar;

long i;
long year;
long month;
long day;
i = 0;
year = 0;
month = 0;
day = 0;

while(true) {
year = 2013;
month = (i/30) + 1;
day = i - (30*(month - 1));
calendar[i].year = year;
calendar[i].month = month;
calendar[i].day = day;

if(i + 1 == 360) break;
else i = i + 1;
}

return calendar[359].day;

@ghost ghost assigned swpcom-heydu Jul 9, 2013
@swpcom-heydu
Copy link

Should be fixed in Master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants