<> <> <> <> <> <> <> <> <<>> <> <> <> <> <> <> <> <> DIRECTORY Rope USING [ROPE], TextLooks USING [Looks], TextNode USING [RefTextNode], TextFindPrivate USING [FinderRecord]; TextFind: CEDAR DEFINITIONS = BEGIN RefTextNode: TYPE = TextNode.RefTextNode; ROPE: TYPE = Rope.ROPE; CR: CHAR = '\n; MalformedPattern: ERROR [ec: PatternErrorCode]; PatternErrorCode: TYPE = { toobig, -- pattern too long endquote, -- pattern ends with ' endtilda, -- pattern ends with ~ boundary, -- pattern has | inside rather than at beginning or end missingNameEnd, -- pattern has < without matching > unmatchedNameEnd -- pattern has > without previous < }; Finder: TYPE = REF FinderRec; FinderRec: TYPE = TextFindPrivate.FinderRecord; Create: PROC [pattern: RefTextNode, literal, word, ignoreLooks, ignoreCase, addBounds: BOOL _ FALSE, patternStart: INT _ 0, patternLen: INT _ LAST[INT]] RETURNS [finder: Finder]; <> <> <> <> <> <> <> CreateFromRope: PROC [pattern: ROPE, literal, word, ignoreCase, addBounds: BOOL _ FALSE, patternStart: INT _ 0, patternLen: INT _ LAST[INT]] RETURNS [finder: Finder]; NameLoc: PROC [finder: Finder, name: ROPE] RETURNS [at, atEnd: INT]; <> <> NameLooks: PROC [finder: Finder, name: ROPE] RETURNS [looks: TextLooks.Looks]; <> <> Try: PROC [finder: Finder, text: RefTextNode, start: INT _ 0, len: INT _ LAST[INT], looksExact: BOOL _ FALSE, interrupt: REF BOOL _ NIL] RETURNS [found: BOOL, at, atEnd, before, after: INT]; <> <> <> <> <> < atEnd if used } in pattern>> <> <> <> TryBackwards: PROC [finder: Finder, text: RefTextNode, start: INT _ 0, len: INT _ LAST[INT], looksExact: BOOL _ FALSE, interrupt: REF BOOL _ NIL] RETURNS [found: BOOL, at, atEnd, before, after: INT]; <> <> SearchRope: PROC [finder: Finder, rope: ROPE, start: INT _ 0, len: INT _ LAST[INT], interrupt: REF BOOL _ NIL] RETURNS [found: BOOL, at, atEnd, before, after: INT]; SearchRopeBackwards: PROC [finder: Finder, rope: ROPE, start: INT _ 0, len: INT _ LAST[INT], interrupt: REF BOOL _ NIL] RETURNS [found: BOOL, at, atEnd, before, after: INT]; Find: PROC [pattern, text: RefTextNode, literal, word, ignoreLooks, ignoreCase, looksExact, addBounds: BOOL _ FALSE, patternStart: INT _ 0, patternLen: INT _ LAST[INT], textStart: INT _ 0, textLen: INT _ LAST[INT], interrupt: REF BOOL _ NIL] RETURNS [found: BOOL, at, atEnd, before, after: INT]; BackwardsFind: PROC [pattern, text: RefTextNode, literal, word, ignoreLooks, ignoreCase, looksExact, addBounds: BOOL _ FALSE, patternStart: INT _ 0, patternLen: INT _ LAST[INT], textStart: INT _ 0, textLen: INT _ LAST[INT], interrupt: REF BOOL _ NIL] RETURNS [found: BOOL, at, atEnd, before, after: INT]; END.