DIRECTORY Rope, SpellingLooks, TextLooks, UserProfile; SpellingLooksImpl: CEDAR PROGRAM IMPORTS Rope, UserProfile EXPORTS SpellingLooks = { ROPE: TYPE = Rope.ROPE; ROPEList: TYPE = LIST OF ROPE; Looks: TYPE = TextLooks.Looks; StyleNote: TYPE = RECORD [ style: ROPE, unwordlich: Looks ¬ TextLooks.noLooks]; StyleNotes: TYPE = LIST OF StyleNote; styleNotes: StyleNotes ¬ NIL; globalVerboten: Looks ¬ TextLooks.noLooks; Wordlich: PUBLIC PROC [style: ROPE, looks: Looks] RETURNS [wordlich: BOOL] = { perThisStyle: StyleNotes; IF Intersects[globalVerboten, looks] THEN RETURN [FALSE]; perThisStyle ¬ FindStyle[style]; IF perThisStyle # NIL AND Intersects[perThisStyle.first.unwordlich, looks] THEN RETURN [FALSE]; wordlich ¬ TRUE; }; FindStyle: PROC [style: ROPE] RETURNS [styleNote: StyleNotes] = { FOR styleNote ¬ styleNotes, styleNote.rest WHILE styleNote # NIL DO IF Rope.Equal[styleNote.first.style, style, FALSE] THEN RETURN; ENDLOOP; }; Intersects: PROC [l1, l2: Looks] RETURNS [intersects: BOOL] = INLINE { FOR l: TextLooks.Look IN TextLooks.Look DO IF l1[l] AND l2[l] THEN RETURN [TRUE]; ENDLOOP; intersects ¬ FALSE}; NoteProfile: PROC [reason: UserProfile.ProfileChangeReason] --UserProfile.ProfileChangedProc-- = { profileNotes: ROPEList ¬ UserProfile.ListOfTokens[key: "SpellingTool.NonWordLooks", default: LIST ["cedar~dugm"]]; globalVerboten ¬ TextLooks.noLooks; styleNotes ¬ NIL; FOR rl: ROPEList ¬ profileNotes, rl.rest WHILE rl # NIL DO spec: ROPE ¬ rl.first; style, looks: ROPE; sep: INT ¬ spec.Find["~"]; IF sep >= 0 THEN {style ¬ spec.Substr[len: sep]; looks ¬ spec.Substr[start: sep+1]} ELSE {style ¬ NIL; looks ¬ spec}; IF style.Equal["*"] OR style.Length[] = 0 THEN globalVerboten ¬ ORLooks[globalVerboten, looks] ELSE { perThisStyle: StyleNotes ¬ FindStyle[style]; IF perThisStyle = NIL THEN perThisStyle ¬ styleNotes ¬ CONS[[style], styleNotes]; perThisStyle.first.unwordlich ¬ ORLooks[perThisStyle.first.unwordlich, looks]; }; ENDLOOP; }; ORLooks: PROC [urLooks: Looks, inRope: ROPE] RETURNS [moreLooks: Looks] = { moreLooks ¬ urLooks; FOR i: INT IN [0 .. inRope.Length[]) DO c: CHAR ¬ inRope.Fetch[i]; IF c IN TextLooks.Look THEN moreLooks[c] ¬ TRUE; ENDLOOP; }; UserProfile.CallWhenProfileChanges[NoteProfile]; }. Ί SpellingLooksImpl.Mesa Copyright Σ 1987, 1992 by Xerox Corporation. All rights reserved. Spreitzer, February 27, 1985 9:03:31 pm PST Tim Diebert: January 26, 1987 5:03:15 pm PST ΚU•NewlineDelimiter –(cedarcode) style™code™Kšœ Οeœ7™BK™+K™,—K˜KšΟk œ-˜6K˜š Πbxœžœžœžœžœ˜TK˜Kšžœžœžœ˜Kš œ žœžœžœžœ˜Kšœžœ˜K˜šœ žœžœ˜Kšœžœ˜ K˜'—K˜Kšœ žœžœžœ ˜%K˜Kšœžœ˜K˜*K˜š Οnœžœžœ žœžœ žœ˜NKšœ˜Kšžœ#žœžœžœ˜9K˜ Kš žœžœžœ2žœžœžœ˜_Kšœ žœ˜K˜—K˜š  œžœ žœžœ˜Ašžœ(žœ žœž˜CKšžœ*žœžœžœ˜?Kšžœ˜—K˜—K˜š   œžœžœžœžœ˜Fšžœžœž˜*Kš žœžœžœžœžœ˜&Kšžœ˜—Kšœ žœ˜—K˜š  œžœ+Οc"œ˜bKšœ]žœ˜rK˜#Kšœ žœ˜šžœ&žœžœž˜:Kšœžœ ˜Kšœžœ˜Kšœžœ˜šžœ ˜ KšžœC˜GKšžœ žœ˜!—šžœžœ˜)Kšžœ0˜4šžœ˜K˜,Kšžœžœžœžœ˜QK˜NK˜——Kšžœ˜—K˜—K˜š œžœžœžœ˜KK˜šžœžœžœž˜'Kšœžœ˜Kšžœžœžœžœ˜0Kšžœ˜—K˜—K˜Kšœ0˜0K˜K˜——…—Κ Ω