ulmErrors ported.

Former-commit-id: 9f8fefcd1b
This commit is contained in:
Norayr Chilingarian 2013-10-23 18:40:35 +04:00
parent dc56f38ee2
commit 8cea6a4915
2 changed files with 7 additions and 5 deletions

View file

@ -161,6 +161,7 @@ stage6:
$(VOCSTATIC) -sP ulmSysTypes.Mod $(VOCSTATIC) -sP ulmSysTypes.Mod
$(VOCSTATIC) -sP ulmSys.Mod $(VOCSTATIC) -sP ulmSys.Mod
$(VOCSTATIC) -sP ulmSysConversions.Mod $(VOCSTATIC) -sP ulmSysConversions.Mod
$(VOCSTATIC) -sP ulmErrors.Mod
stage7: stage7:
#objects := $(wildcard *.o) #objects := $(wildcard *.o)

View file

@ -31,11 +31,12 @@
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
*) *)
MODULE Errors; MODULE ulmErrors;
(* translate events to errors *) (* translate events to errors *)
IMPORT Disciplines, Events, Objects, RelatedEvents, Streams, Strings; IMPORT Disciplines := ulmDisciplines, Events := ulmEvents, Objects := ulmObjects, RelatedEvents := ulmRelatedEvents, Streams := ulmStreams, Strings := ulmStrings,
SYS := SYSTEM;
CONST CONST
(* Kind = (debug, message, warning, error, fatal, bug) *) (* Kind = (debug, message, warning, error, fatal, bug) *)
@ -115,7 +116,7 @@ MODULE Errors;
VAR VAR
writeDiscipline: WriteDiscipline; writeDiscipline: WriteDiscipline;
BEGIN BEGIN
IF Disciplines.Seek(event.type, writeDiscId, writeDiscipline) THEN IF Disciplines.Seek(event.type, writeDiscId, SYS.VAL(Disciplines.Discipline, writeDiscipline)) THEN
writeDiscipline.write(s, event); writeDiscipline.write(s, event);
ELSE ELSE
IF ~Streams.WritePart(s, event.message, 0, IF ~Streams.WritePart(s, event.message, 0,
@ -128,7 +129,7 @@ MODULE Errors;
VAR VAR
disc: HandlerDiscipline; disc: HandlerDiscipline;
BEGIN BEGIN
IF Disciplines.Seek(event.type, handlerDiscId, disc) & IF Disciplines.Seek(event.type, handlerDiscId, SYS.VAL(Disciplines.Discipline, disc)) &
(disc.kind IN disc.hs.handlerSet) THEN (disc.kind IN disc.hs.handlerSet) THEN
disc.hs.handler[disc.kind](event, disc.kind); disc.hs.handler[disc.kind](event, disc.kind);
END; END;
@ -154,4 +155,4 @@ BEGIN
kindText[error] := "error"; kindText[error] := "error";
kindText[fatal] := "fatal"; kindText[fatal] := "fatal";
kindText[bug] := "bug"; kindText[bug] := "bug";
END Errors. END ulmErrors.