Rev 9452 | Rev 9674 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 9452 | Rev 9668 | ||
---|---|---|---|
Line 44... | Line 44... | ||
44 | saved*: BOOLEAN |
44 | saved*: BOOLEAN |
45 | END; |
45 | END; |
Line 46... | Line 46... | ||
46 | 46 | ||
47 | tLog* = POINTER TO RECORD |
47 | tLog* = POINTER TO RECORD |
48 | Log*, Pointers*: List.tList; |
48 | Log*, Pointers*: List.tList; |
49 | guard: tGuard; |
49 | guard, first: tGuard; |
50 | isLast: BOOLEAN |
50 | isLast: BOOLEAN |
Line 51... | Line 51... | ||
51 | END; |
51 | END; |
Line 71... | Line 71... | ||
71 | END |
71 | END |
72 | RETURN res |
72 | RETURN res |
73 | END isLastGuard; |
73 | END isLastGuard; |
Line 74... | Line 74... | ||
74 | 74 | ||
75 | 75 | ||
76 | PROCEDURE isFirstGuard* (guard: tGuard): BOOLEAN; |
76 | PROCEDURE getFirstGuard (): tGuard; |
77 | VAR |
77 | VAR |
78 | item: List.tItem; |
- | |
79 | BEGIN |
78 | item: List.tItem; |
80 | ASSERT(guard # NIL); |
79 | BEGIN |
81 | item := CL.Log.first; |
80 | item := CL.Log.first; |
82 | WHILE ~(item IS tGuard) DO |
81 | WHILE ~(item IS tGuard) DO |
- | 82 | item := item.next |
|
- | 83 | END |
|
- | 84 | RETURN item(tGuard) |
|
- | 85 | END getFirstGuard; |
|
- | 86 | ||
- | 87 | ||
- | 88 | PROCEDURE isFirstGuard* (guard: tGuard): BOOLEAN; |
|
- | 89 | BEGIN |
|
- | 90 | ASSERT(guard # NIL); |
|
- | 91 | IF CL.first = NIL THEN |
|
83 | item := item.next |
92 | CL.first := getFirstGuard() |
84 | END |
93 | END |
Line 85... | Line 94... | ||
85 | RETURN guard = item |
94 | RETURN guard = CL.first |
86 | END isFirstGuard; |
95 | END isFirstGuard; |
Line 283... | Line 292... | ||
283 | VAR |
292 | VAR |
284 | newLog: tLog; |
293 | newLog: tLog; |
285 | BEGIN |
294 | BEGIN |
286 | NEW(newLog); |
295 | NEW(newLog); |
287 | newLog.guard := NIL; |
296 | newLog.guard := NIL; |
- | 297 | newLog.first := NIL; |
|
288 | newLog.isLast := TRUE; |
298 | newLog.isLast := TRUE; |
289 | newLog.Log := List.create(NIL); |
299 | newLog.Log := List.create(NIL); |
290 | newLog.Pointers := List.create(NIL); |
300 | newLog.Pointers := List.create(NIL); |
291 | CL := newLog; |
301 | CL := newLog; |
292 | Lines.setMaxLength(maxLength) |
302 | Lines.setMaxLength(maxLength) |