| |
| /pliant/language/debug/error1.pli |
| |
| 1 |
# Copyright Hubert Tonneau hubert.tonneau@pliant.cx | |
| 2 |
# | |
| 3 |
# This program is free software; you can redistribute it and/or | |
| 4 |
# modify it under the terms of the GNU General Public License version 2 | |
| 5 |
# as published by the Free Software Foundation. | |
| 6 |
# | |
| 7 |
# This program is distributed in the hope that it will be useful, | |
| 8 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 9 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 10 |
# GNU General Public License for more details. | |
| 11 |
# | |
| 12 |
# You should have received a copy of the GNU General Public License | |
| 13 |
# version 2 along with this program; if not, write to the Free Software | |
| 14 |
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
| 15 |
| |
| 16 |
scope "/pliant/language/" "/pliant/install/" | |
| 17 |
module "/pliant/install/ring1.pli" | |
| 18 |
| |
| 19 |
function error_id num -> eid | |
| 20 |
arg Int num ; arg ErrorID eid | |
| 21 |
addressof:eid map Int := num | |
| 22 |
| |
| 23 |
public | |
| 24 |
| |
| 25 |
constant error_filter_all error_id:(-1) | |
| 26 |
constant error_filter_none error_id:0 | |
| 27 |
| |
| 28 |
constant error_id_noerror error_id:0 | |
| 29 |
constant error_id_restore error_id:1 | |
| 30 |
constant error_id_parse error_id:2 | |
| 31 |
constant error_id_compile error_id:3 | |
| 32 |
constant error_id_missing error_id:4 | |
| 33 |
constant error_id_multiple error_id:5 | |
| 34 |
constant error_id_mismatch error_id:6 | |
| 35 |
constant error_id_unexpected error_id:7 | |
| 36 |
constant error_id_starvation error_id:8 | |
| 37 |
constant error_id_corrupted error_id:9 | |
| 38 |
constant error_id_memory_violation error_id:10 | |
| 39 |
constant error_id_check error_id:11 | |
| 40 |
constant error_id_os error_id:12 | |
| 41 |
constant error_id_memory_starvation error_id:13 | |
| 42 |
constant error_id_io error_id:14 | |
| 43 |
constant error_id_arithmetic error_id:15 | |
| 44 |
constant error_id_unknown error_id:16 | |
| 45 |
constant error_id_abort error_id:17 | |
| 46 |
| |
| 47 |
constant error_id_user error_id:18 | |
| 48 |
| |
| 49 |
| |
| 50 |
function compare e1 e2 -> c | |
| 51 |
arg ErrorID e1 e2 ; arg Int c | |
| 52 |
if (addressof:e1 map Int)=(addressof:e2 map Int) | |
| 53 |
c := compare_equal | |
| 54 |
else | |
| 55 |
c := compare_different | |
| 56 |
| |
| 57 |
| |
| 58 |
function error msg | |
| 59 |
arg Str msg | |
| 60 |
error_notify error_id_unknown null msg | |
| 61 |
| |
| 62 |
function error id msg | |
| 63 |
arg ErrorID id ; arg Str msg | |
| 64 |
error_notify id null msg | |
| 65 |
| |
| 66 |
export compare error | |
| |