issue-#208 ASSERT(FALSE) rejected by compiler

Post Reply
User avatar
Robert
Posts: 1024
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

issue-#208 ASSERT(FALSE) rejected by compiler

Post by Robert »

The Language Report permits ASSERT(x) where x is a Boolean expression, so the compiler should be adjusted to match the report.
For the issue see https://redmine.blackboxframework.org/issues/208 .

Different languages in the Oberon familly have different semantics, including our current compiler behaviour.
In my opinion:
1 - Our compiler should match our language report.
2 - The other semantic alternatives do not offer sufficient advantage to justify changing our report.

So we should update our compiler. This is a minor change, as described in https://community.blackboxframework.org ... f=48&t=246 (see post dated 10-June-2020).
User avatar
Josef Templ
Posts: 2047
Joined: Tue Sep 17, 2013 6:50 am

Re: issue-#208 ASSERT(FALSE) rejected by compiler

Post by Josef Templ »

I do agree that ASSERT(FALSE) should not be reported by the compiler but at runtime.
If this is in line with Oberon-07 it is a good sign that it is the right choice and it eliminates a difference.

The compile time evaluation of asserts is driven by the desire to catch as many errors as possible
at compile time but it is too aggressive in this case, I think.

- Josef
User avatar
Josef Templ
Posts: 2047
Joined: Tue Sep 17, 2013 6:50 am

Re: issue-#208 ASSERT(FALSE) rejected by compiler

Post by Josef Templ »

I have prepared a fix as proposed by luowy.

Here is the link to the diffs: https://redmine.blackboxframework.org/p ... 83f2387960

@luowy: I have added assertfn to the documentation of the syntax tree structure in DevCPT, please check.
luowy
Posts: 234
Joined: Mon Oct 20, 2014 12:52 pm

Re: issue-#208 ASSERT(FALSE) rejected by compiler

Post by luowy »

no problem,very well:the comments and documents updated correctly;
Post Reply