Subversion Repositories Kolibri OS

Rev

Rev 9907 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9907 Rev 9909
Line 113... Line 113...
113
	END
113
	END
114
	RETURN res
114
	RETURN res
115
END next;
115
END next;
Line -... Line 116...
-
 
116
 
-
 
117
 
-
 
118
PROCEDURE add* (list: List.tList; pos: INTEGER);
-
 
119
VAR
-
 
120
	item: tPos;
-
 
121
BEGIN
-
 
122
	item := list.last(tPos);
-
 
123
	IF (item = NIL) OR (item.cnt = itemSize) THEN
-
 
124
		NEW(item);
-
 
125
		item.cnt := 0;
-
 
126
		List.append(list, item)
-
 
127
	END;
-
 
128
	item.pos[item.cnt] := pos;
-
 
129
	INC(item.cnt)
-
 
130
END add;
116
 
131
 
117
 
132
 
118
PROCEDURE find* (text: tBuffer; s: ARRAY OF WCHAR; whole: BOOLEAN; list: List.tList; offset: INTEGER);
133
PROCEDURE find* (text: tBuffer; s: ARRAY OF WCHAR; whole: BOOLEAN; list: List.tList; offset: INTEGER);
119
VAR
-
 
120
	k, pos, n, i, x, prev_item_pos: INTEGER;
134
VAR
121
	item: tPos;
135
	k, pos, n, i, x, prev_item_pos: INTEGER;
122
	c1, c2: WCHAR;
136
	c1, c2: WCHAR;
123
	flag: BOOLEAN;
137
	flag: BOOLEAN;
124
BEGIN
138
BEGIN
Line 145... Line 159...
145
				SYSTEM.GET(text.dataPtr + (x + n)*SYSTEM.SIZE(WCHAR), c2);
159
				SYSTEM.GET(text.dataPtr + (x + n)*SYSTEM.SIZE(WCHAR), c2);
146
				flag := Utils.isWordChar(c1) OR Utils.isWordChar(c2)
160
				flag := Utils.isWordChar(c1) OR Utils.isWordChar(c2)
147
			END;
161
			END;
148
			IF ~flag & (x >= prev_item_pos) THEN
162
			IF ~flag & (x >= prev_item_pos) THEN
149
				prev_item_pos := x + n;
163
				prev_item_pos := x + n;
150
				item := list.last(tPos);
-
 
151
				IF (item = NIL) OR (item.cnt = itemSize) THEN
-
 
152
					NEW(item);
-
 
153
					item.cnt := 0;
-
 
154
					List.append(list, item)
-
 
155
				END;
-
 
156
				item.pos[item.cnt] := x + offset;
164
				add(list, x + offset)
157
				INC(item.cnt)
-
 
158
			END
165
			END
159
		END;
166
		END;
160
		INC(pos, SYSTEM.SIZE(INTEGER));
167
		INC(pos, SYSTEM.SIZE(INTEGER));
161
		DEC(k)
168
		DEC(k)
162
	END
169
	END