Syntax parser (small) bug

Svejk

Senior Member
This code:

if b0 = 1 then
b1 = 1
end else
b1= 0
endif

passes the syntax check and works ok in silicon. However not exactly what it should mean.

Also, dirsb = value passes the syntax on an 08M2 where only port C is available.

PE version 5-5-1.

Regards,
Svejk
 

hippy

Ex-Staff (retired)
The compiler in some cases ( particularly for IF statements ) does the best it can to make sense of what is written and is tolerant of some missing colons rather than enforcing their presence so the code is being interpreted as ...

if b0 = 1 then
b1 = 1
end
else
b1= 0
endif

On the 08M2 'dirsB', 'dirsC' and 'dirs' refer to the same thing and can be used interchangeably.
 

Svejk

Senior Member
Thanks Hippy. The trick is that I've run it like in post #1 on 08M2 and did not end the program, it is interpreted, I think, like else if.
 
Top