ðSyntax10.Scn.Fnt |ÿÿÿp°­VersionElemsAllocBeg#Syntax10.Scn.FntWindows PowerMacWindowsWindows PowerMac$Syntax10m.Scn.Fnt (*PowerMac*)Syntax10m.Scn.Fnt p°­VersionElemsAllocEnd õÿÿÿ@ïðIStampElemsAlloc14 Oct 98»Ãþÿÿ€8ÀÔFoldElemsNewCSyntax10.Scn.Fnt¦Syntax10b.Scn.FntQû VAR beg, end, delta: LONGINT; BEGIN delta := 200; LOOP beg := F.org; end := TextFrames.Pos(F, F.X + F.W, F.Y); IF (beg <= pos) & (pos < end) OR (delta = 0) THEN EXIT END ; TextFrames.Show(F, pos - delta); delta := delta DIV 2 END END ShowPos; ÿÿÿÿ€8ÀÔX¯þÿÿ€8ÀÔ#Syntax10.Scn.Fnt// VAR V: MenuViewers.Viewer; F, M: TextFrames.Frame; x, y: INTEGER; BEGIN F := TextFrames.NewText(T, org); Oberon.AllocateUserViewer(Oberon.Mouse.X, x, y); M := TextFrames.NewMenu(name, "^Edit.Menu.Text"); V := MenuViewers.New(M, F, TextFrames.menuH, x, y); ShowPos(F, org); RETURN F END NewView; ÿÿÿÿ€8ÀÔA­ýÿÿ€8ÀÔ#Syntax10.Scn.Fnt11 VAR x: INTEGER; v: Viewers.Viewer; menu: Texts.Text; S: Texts.Scanner; BEGIN x := 0; WHILE x < Display.Width DO v := Viewers.This(x, 0); WHILE v.state > 1 DO IF (v IS MenuViewers.Viewer) & (v.dsc IS TextFrames.Frame) THEN (* check for trap viewer *) menu := v.dsc(TextFrames.Frame).text; IF menu.len > 0 THEN Texts.OpenScanner(S, menu, 0); Texts.Scan(S); IF S.s = name THEN RETURN v.dsc.next(TextFrames.Frame) END END END; v := Viewers.Next(v) END; x := x + v.W END; RETURN NIL END GetFrameByName; ÿÿÿÿ€8ÀÔDÏÿÿÿ€8ÀÔ#Syntax10.Scn.Fnt END NoNotify; ÿÿÿÿ€8ÀÔ9ƒÿÿÿ€8ÀÔ#Syntax10.Scn.Fnt[[ BEGIN Oberon.PassFocus(Viewers.This(F.X, F.Y)); TextFrames.SetCaret(F, pos) END SetCaret; ÿÿÿÿ€8ÀÔ@büÿÿ€8ÀÔ#Syntax10.Scn.Fnt|| VAR text: Texts.Text; oldNotifier: Texts.Notifier; r: Texts.Reader; fold, twin: FoldElems.Elem; pos: LONGINT; BEGIN text := f.text; oldNotifier := text.notify; text.notify := NoNotify; FoldElems.ExpandAll(text, 0, TRUE); Texts.OpenReader (r, text, thePos); Texts.ReadPrevElem (r); WHILE r.elem # NIL DO IF r.elem IS FoldElems.Elem THEN fold := r.elem(FoldElems.Elem); twin := FoldElems.Twin(fold); IF fold.mode = FoldElems.tempLeft THEN IF Texts.ElemPos(twin) < thePos THEN pos := Texts.ElemPos(twin); FoldElems.Switch (twin); DEC(thePos, pos - Texts.ElemPos(twin)) ELSE fold.mode := FoldElems.expLeft END END END ; Texts.ReadPrevElem (r) END; FoldElems.CollapseAll(text, {FoldElems.tempLeft}); text.notify := oldNotifier; text.notify(text, Texts.replace, 0, text.len); ShowPos (f, thePos); SetCaret(f, thePos) END InternalLocate; ÿÿÿÿ€8ÀÔ6_þÿÿ€8ÀÔ#Syntax10.Scn.Fnt VAR R: Texts.Reader; m: Modules.Module; type, dynType: Types.Type; BEGIN m := Modules.ThisMod("Folds"); type := Types.This(m, "ErrElemDesc"); Texts.OpenReader(R, t, pos); Texts.ReadElem(R); IF ~R.eot & (R.elem # NIL) & (Texts.ElemPos(R.elem) = pos) THEN dynType := Types.TypeOf (R.elem); IF dynType = type THEN Texts.Delete(t, pos, pos+1) END END END RemoveErrElem; ÿÿÿÿ€8ÀÔ Syntax10b.Scn.Fntxñÿÿ€8ÀÔûSyntax10.Scn.Fntžÿýÿÿp°­VersionElemsAllocBeg#Syntax10.Scn.FntWindows PowerMacWindowsWindows PowerMac­Syntax10.Scn.Fnt¥ÿÿÿ€8ÀÔFoldElemsNew$Syntax10i.Scn.Fnt88search the correct position in the trap viewer -PowerMacþÿÿÿÿ€8ÀÔ REPEAT Texts.Scan(S); IF S.class = Texts.Name THEN beg := Texts.Pos(S); COPY(S.s, proc); Texts.Scan(S); end := Texts.Pos(S); IF S.class = Texts.Int THEN INC(intDepth) END END UNTIL (S.eot) OR (intDepth > depth);<þÿÿ€8ÀÔFoldElemsNewCSyntax10.Scn.FntPSyntax10i.Scn.Fnt‚ REPEAT Texts.Scan(S); IF (S.class = Texts.Name) & (S.s # "Rel.") THEN (* procedure name *) COPY(S.s, proc) ELSE IF (S.class = Texts.Name) & (S.s = "Rel.") THEN INC(intDepth); END END UNTIL (S.eot) OR ((S.class = Texts.Name) & (S.s = "Rel.") & (intDepth > depth)); Texts.Scan(S); beg := Texts.Pos(S);Texts.Scan(S);end := Texts.Pos(S); Texts.Scan(S);Syntax10i.Scn.Fnt8ÿÿÿÿ€8ÀÔp°­VersionElemsAllocEndzÓüÿÿ€8ÀÔCSyntax10.Scn.FntãSyntax10i.Scn.FntëëCOPY(proc, mod); Strings.Delete(mod, Strings.Pos(".", mod, 0), Strings.Length(mod)); Strings.Append(".Mod", mod); source := GetFrameByName(mod); IF source = NIL THEN T := TextFrames.Text(mod); source := NewView(mod, T, 0); END; x := source.X + (source.W DIV 2); y := source.Y + (source.H DIV 2); T := TextFrames.Text(""); Texts.OpenWriter(w); Texts.WriteString(w, " * \f"); Texts.Append(T, w.buf); buffer := Oberon.Par; par.text := T; par.pos := 0; (* temp. set to system log *) par.frame := GetFrameByName("System.Log"); t := Oberon.Log; Oberon.Log := TextFrames.Text(""); Oberon.DrawCursor(Oberon.Pointer, Oberon.Star, x, y); Oberon.Call("Folds.Compile", par, FALSE, res); Oberon.Par := buffer; +ÿÿÿÿ€8ÀÔ1/yŽ VAR v: Viewers.Viewer; T, t: Texts.Text; S: Texts.Scanner; beg, end, pcPos: LONGINT; proc, mod: ARRAY 64 OF CHAR; source: TextFrames.Frame; x, y, res, intDepth, oldLine: INTEGER; w: Texts.Writer; par, buffer: Oberon.ParList; loc: BOOLEAN; BEGIN intDepth := 0; par := Oberon.Par; v := Oberon.Par.vwr; IF v # NIL THEN T := v.dsc.next(TextFrames.Frame).text; Texts.OpenScanner(S, T, 0); search the correct position in the trap viewer - Windows ShowPos(v.dsc.next(TextFrames.Frame), beg+1); TextFrames.SetSelection(v.dsc.next(TextFrames.Frame), beg+1, end-1); first relative pc found - call the compiler IF (res = 0) THEN (* file compiled, now search the text position *) Texts.OpenScanner(S, Oberon.Log, 0); REPEAT Texts.Scan(S) UNTIL S.eot OR ((S.class = Texts.Name) & (S.s = "compiling")); IF S.eot THEN Oberon.Log := t; Out.String("Module contains errors, trap search not possible.$") END; loc := FALSE; Texts.Scan(S); Texts.Scan(S); oldLine := S.line; REPEAT IF (S.class = Texts.Name) & (S.s = "pos") THEN Texts.Scan(S); pcPos := S.i; Texts.Scan(S); IF (S.class = Texts.Name) & (S.s = "pc") THEN InternalLocate(source, pcPos); loc := TRUE; ELSE (* warning or error found *) RemoveErrElem(source.text, pcPos); WHILE oldLine = S.line DO Texts.Scan(S) END; oldLine := S.line; END ELSE Oberon.Log := t; Out.String("Module contains errors, trap search not possible.$"); loc := TRUE END UNTIL loc; INC(depth) END; Oberon.Log := t ELSE Out.String("error: trap viewer is not open!$") END END Step; ÿÿÿÿ€8ÀÔ ·ÿÿÿ€8ÀÔ#Syntax10.Scn.Fnt'' BEGIN depth := 0; Step; END Locate; ÿÿÿÿ€8ÀÔ  »ÿÿÿ€8ÀÔ#Syntax10.Scn.Fnt## BEGIN depth := 0; END StepReset; ÿÿÿÿ€8ÀÔ<öMODULE Trap; (*Windows*) (* SC -  *) IMPORT Viewers, Display, Texts, TextFrames, Out, MenuViewers, Strings, Oberon, FoldElems, Types, Modules; VAR depth: INTEGER; PROCEDURE ShowPos (F: TextFrames.Frame; pos: LONGINT); PROCEDURE NewView (name: ARRAY OF CHAR; T: Texts.Text; org: LONGINT): TextFrames.Frame; PROCEDURE GetFrameByName(name: ARRAY OF CHAR): TextFrames.Frame; PROCEDURE NoNotify (t: Texts.Text; op: INTEGER; beg, end: LONGINT); PROCEDURE SetCaret (F: TextFrames.Frame; pos: LONGINT); PROCEDURE InternalLocate(f: TextFrames.Frame; thePos: LONGINT); PROCEDURE RemoveErrElem(t: Texts.Text; pos: LONGINT); PROCEDURE Step*; PROCEDURE Locate*; PROCEDURE StepReset*; BEGIN StepReset END Trap. Trap.Locate Trap.Step Texts.Mod