BigEd / atalan

Automatically exported from code.google.com/p/atalan
MIT License
1 stars 0 forks source link

Asserts #77

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Support asserts.

For example.

assert x>0

If the condition is false, error report containing the name of source code, 
line number and possibly values of variables used in condition will be 
displayed and the application stops.

assert <cond> 

is compiled as

if not <cond> call assert_print <file><line_no><list of vars>

assert_print is special version of print procedure.
It must setup display so, that the assert message is visible, print the assert 
message and then stop execution. It may optionally allow the application to 
continue, but that would require restoring the display etc. which may not be 
possible.

When compiling release version of the application, assert_print is defined as 
void. Optimizer will thus remove all the assert conditionals.

There may also be some special support by debuggers, which may execute the 
asserts outside normal execution. Start and end of assert code should be 
therefore marked with special instruction.

Original issue reported on code.google.com by rudla.ku...@gmail.com on 31 May 2011 at 4:04

GoogleCodeExporter commented 9 years ago
The change for this is done now.

Original comment by rudla.ku...@gmail.com on 28 Jul 2011 at 1:11