You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[LAMBDA (L NEG A) (* ; "Edited 29-Apr-91 23:02 by jds")
207
+
[LAMBDA (L NEG A) (* ; "Edited 24-Aug-2025 11:45 by rmk")
208
+
(* ; "Edited 29-Apr-91 23:02 by jds")
207
209
[COND
208
-
[(type? CHARTABLE A) (* ; "Clear it")
210
+
[(type? CHARTABLE A) (* ; "Clear it")
209
211
(\ZEROBYTES A 0 \MAXTHINCHAR)
210
212
(if (fetch (CHARTABLE NSCHARHASH) of A)
211
213
then (CLRHASH (fetch (CHARTABLE NSCHARHASH) of A]
212
214
(T (SETQ A (create CHARTABLE]
213
215
(for X in L do (\SETSYNCODE A (OR (SMALLP X)
214
-
(CHCON1 X))
215
-
1)) (* ; "Invert 1 and 0 if NEG")
216
-
[AND NEG (for I from 0 to \MAXCHAR do (\SETSYNCODE A I (LOGXOR 1 (\SYNCODE A I]
216
+
(CHCON1 X))
217
+
1)) (* ; "Invert 1 and 0 if NEG")
218
+
[AND NEG (for I from 0 to \MAXTHINCHAR do (\SETSYNCODE A I (LOGXOR 1 (\SYNCODE A I]
217
219
A])
218
220
)
219
221
(DECLARE%: DONTCOPY
@@ -258,13 +260,15 @@ DONTCOPY
258
260
(FILEPOS
259
261
[LAMBDA (PATTERN FILE START END SKIP TAIL CASEARRAY)
260
262
263
+
(* ;; "Edited 24-Apr-2025 22:08 by rmk")
264
+
261
265
(* ;; "Edited 10-Jul-2022 16:51 by rmk")
262
266
263
267
(* ;; "Edited 1-Jul-2022 11:55 by rmk")
264
268
265
269
(* ;; "Edited 25-Jun-2022 22:51 by rmk: The original version was a byte-level searcher, this upgrades to character searching as determined by the external format of the stream. (It is also a bit faster than the original).")
266
270
267
-
(* ;; "This provides accurate results if the stream's external format is stable, wherein each character code has a unique byte representation. If the stream's format is unstable (i.e. XCCS runcoding), then the result is accurate if the stream's initial charset (or other contextual information) is correct for the START byte position.")
271
+
(* ;; "This provides accurate results if the stream's external format is stable, wherein each character code has a unique byte representation. If the stream's format is unstable (i.e. MCCS runcoding), then the result is accurate if the stream's initial charset (or other contextual information) is correct for the START byte position.")
268
272
269
273
(* ;; "Otherwise, there may be some bad matches and some missing matches. The slow case will be accurate in those cases (and a NIL return for the format's \FORMATBYTESTRING function will kick it into the slow case (about 10 times slower). This always defers to the slow case if SKIP or CASEARRAY are non-NIL.")
270
274
@@ -382,7 +386,7 @@ DONTCOPY
382
386
383
387
(* ;; "Getting the character set for the start of the match is a little trickier. We know the character set at the byte that starts the beginning of the match (= character set of PATTERN's first character. If we set the stream to that charset, then back up one character, that should get it right. ")
384
388
385
-
(* ;; "This should only be necessary for an unstable format, maybe don't bother if it isn't XCCS. There is another special case here for XCCS: if the charset is 255 at the start (=2 byte encoding), then we assume that it didn't change, and nothing to worry about.")
389
+
(* ;; "This should only be necessary for an unstable format, maybe don't bother if it isn't XCCS. There is another special case here for MCCS: if the charset is 255 at the start (=2 byte encoding), then we assume that it didn't change, and nothing to worry about.")
386
390
387
391
(RETURN (IF TAIL
388
392
THEN (CL:UNLESS (EQ NSCHARSETSHIFT (ffetch (STREAM CHARSET) of STREAM))
@@ -412,6 +416,8 @@ DONTCOPY
412
416
(FFILEPOS
413
417
[LAMBDA (PATTERN FILE START END SKIP TAIL CASEARRAY)
414
418
419
+
(* ;; "Edited 24-Apr-2025 22:07 by rmk")
420
+
415
421
(* ;; "Edited 10-Jul-2022 10:17 by rmk")
416
422
417
423
(* ;; "Edited 1-Jul-2022 11:55 by rmk")
@@ -420,7 +426,7 @@ DONTCOPY
420
426
421
427
(* ;; "Edited 10-Aug-2020 21:44 by rmk:")
422
428
423
-
(* ;; "RMK: Added coercion from internal XCCS string to UTF8 if searching a UTF8 file")
429
+
(* ;; "RMK: Added coercion from internal MCCS string to UTF8 if searching a UTF8 file")
(* ;; "Edited 24-Jun-2022 16:32 by rmk: Removing CASE argument. That forces the \SLOWFILEPOS, because the the alternative stream matches can't be anticipated.")
591
599
(* jop%: "25-Sep-86 11:44")
592
600
@@ -596,7 +604,7 @@ DONTCOPY
596
604
PATLEN))
597
605
(MAXPATINDEX (SUB1 PATLEN))
598
606
CHAR)
599
-
(for I from 0 to (FOLDLO \MAXCHAR BYTESPERWORD) do (PUTBASE DELTA1 I PATLEN,PATLEN))
607
+
(for I from 0 to (FOLDLO \MAXTHINCHAR BYTESPERWORD) do (PUTBASE DELTA1 I PATLEN,PATLEN))
600
608
601
609
(* ;; "DELTA1 initially all PATLEN, the default for chars not in the pattern. I assume array is word-aligned")
0 commit comments