DIRECTORY Rope, TextNode, WalnutDocumentRope; WalnutDocumentRopeImpl: CEDAR PROGRAM IMPORTS TextNode, Rope EXPORTS WalnutDocumentRope = BEGIN ROPE: TYPE = Rope.ROPE; Create: PUBLIC PROC [doc: TextNode.Ref] RETURNS [r: ROPE] = { docSize: INT _ TextNode.LocOffset[[doc,0], TextNode.LastLocWithin[doc]]; r _ Rope.MakeRope[base: doc, size: docSize, fetch: Fetch]; IF docSize > 0 THEN { loc0: TextNode.Location = TextNode.LocRelative[[doc,0], 0]; loc1: TextNode.Location = TextNode.LocRelative[[doc,0], 1]; IF loc0 = loc1 THEN { r _ Rope.Substr[r, 1]; }; }; }; Fetch: PROC [data: REF, index: INT] RETURNS [CHAR] = { doc: TextNode.Ref _ NARROW[data]; loc: TextNode.Location = TextNode.LocRelative[[doc,0], index]; n: TextNode.RefTextNode = TextNode.NarrowToTextNode[loc.node]; IF n=NIL THEN ERROR; IF loc.where >= Rope.Size[n.rope] THEN RETURN ['\n]; RETURN [Rope.Fetch[n.rope, loc.where]] }; END. LWalnutDocumentRopeImpl.Mesa Copyright c 1984, 1985 by Xerox Corporation. All rights reserved. Willie-Sue, March 20, 1985 8:38:32 am PST Russ Atkinson (RRA) March 21, 1985 2:16:00 am PST RRA: I think that this is a bug! But we have observed this, so we have to correct for it, I think. I wish that this were not the case. Κ|˜codešœΟc™Jšœ Οmœ7™BK™)K™1—J™šΟk ˜ J˜Jšœ ˜ Jšœ˜J˜—šœŸœŸ˜%JšŸœ˜JšŸœ˜J˜JšœŸ˜K˜KšŸœŸœŸœ˜—J˜š ΟnœŸœŸœŸœŸœ˜=Jšœ Ÿœ<˜HKšœ:˜:šŸœ Ÿœ˜J˜;J˜;šŸœ Ÿœ˜Jšœˆ™ˆJ˜J˜—J˜—K˜K˜—J˜š  œŸœŸœ ŸœŸœŸœ˜6JšœŸœ˜!J˜>J˜>JšŸœŸœŸœŸœ˜JšŸœ ŸœŸœ˜4JšŸœ ˜&Jšœ˜—J˜JšŸœ˜J˜—…—†N