X-Git-Url: https://git.harvie.cz/?p=svn%2FCll1h%2F.git;a=blobdiff_plain;f=demos%2Fexceptions%2Ffailures.c;fp=demos%2Fexceptions%2Ffailures.c;h=0000000000000000000000000000000000000000;hp=2338f7f9d59f331783cc189e715a37b02d99b2a4;hb=e63f1bc2438012b5f2f6592a474892501149af18;hpb=6a60bc82e8b8e6cccd0d4c2214a1f291662215f0 diff --git a/demos/exceptions/failures.c b/demos/exceptions/failures.c deleted file mode 100644 index 2338f7f..0000000 --- a/demos/exceptions/failures.c +++ /dev/null @@ -1,75 +0,0 @@ -#include "cll1.h" - -void some_function(int i) -{ - if(i==2) - { - fail(EVIL_FAILURE); - } - if(i==7) - { - some_function(2); - } - if(i==6) - { - fail(LOCAL_FAILURE); - } - printf("nuda #%d\n",i); -} - -program -{ - try - { - some_function(1); - some_function(2); - some_function(6); - } - else_switch_failures - { - case EVIL_FAILURE: puts("serious failure detected!"); break; - default: puts("sorry, vole, error!"); - } - - try - { - some_function(1); - some_function(3); - some_function(6); - some_function(2); - } - else - { - puts("sorry, vole, error!"); - } - - try - { - some_function(1); - some_function(6); - } - else_catch(EVIL_FAILURE) - { - puts("Totally screwed."); - exit(-1); - } - else - { - puts("We survived this failure."); - } - - try - { - some_function(3); - some_function(7); - } - else_catch(EVIL_FAILURE) - { - puts("totally screwed."); - exit(-1); - } - else - { - puts("we survived this failure."); - } -}