#version 2.0 export // ez lehet declare is, de ugyanúgy exportálni fogja, és még warning-ot is ad érte { exception Exception7_1; exception Exception7_2; } function t07_f1(bool throw) { if(throw) { raise(Exception7_1); } } function t07_f2(bool throw) { t07_f1(throw); exception(Exception7_1) { write(" OK[2/3]"); raise(Exception7_2); } exception(...) { write(" EFAIL"); } } function t07() { write("t07:"); t07_f1(false); write(" OK[1/3]"); t07_f2(true); write(" FAIL\n"); exception(Exception7_2) { write(" OK[3/3]\n"); } exception(...) { write(" FINFAIL\n"); } } import { exception IndexOutOfRangeException; } function t08_f(seq p,u32 idx) { write("\t" + tos(idx) + " -> " + tos(p[idx]) + "\n"); } function t08() { write("t08\n"); seq p; p = hiext(p, 10); p = hiext(p, 20); t08_f(p, 0u); t08_f(p, 100u); exception(IndexOutOfRangeException) { write("Tulindexelt. [OK]\n"); } exception(...) { write("Egyeb kivetel. [FAIL]\n"); } } import { exception DivisionByZeroException; } function t09() { write("t09\n"); string s = "Nullaval osztas."; i32 x = 10 / 0; write("Nincs kivetel. [FAIL]\n"); exception(DivisionByZeroException) { write(s + " [OK]\n"); } exception(...) { write("Egyeb kivetel. [FAIL]\n"); } } export { exception Exception12_far; exception Exception12_near; } function t12_far() { raise(Exception12_far); exception(...) { write("t12 far: FAIL\n"); } } function t12_near() { raisenear(Exception12_near); exception(...) { write("t12 near: OK\n"); } } function t12() { t12_near(); t12_far(); exception(Exception12_far) { write("t12 far: OK\n"); } exception(...) { write("t12 ?: FAIL\n"); } } main { t07(); t08(); t09(); t12(); }