DIRECTORY IntCodeDefs, IO, C2CSourcePositions, C2CBasics, Rope; C2CSourcePositionsImpl: CEDAR PROGRAM IMPORTS C2CBasics, IO, Rope EXPORTS C2CSourcePositions = BEGIN currentSourceNode: PUBLIC IntCodeDefs.SourceNode ¬ NIL; CompileNewModule: PROC [] = { currentSourceNode ¬ NIL; }; CurrentPosAsRope: PUBLIC PROC [] RETURNS [Rope.ROPE] = { IF currentSourceNode=NIL THEN RETURN ["positioned outside client code range"] ELSE RETURN [Rope.Flatten[IO.PutFR["source position %g [%g chars]", [integer[currentSourceNode.source.start]], [integer[currentSourceNode.source.chars]]]]] }; C2CBasics.CallbackWhenC2CIsCalled[CompileNewModule]; END.  C2CSourcePositionsImpl.mesa Copyright Σ 1990, 1991 by Xerox Corporation. All rights reserved. Christian Jacobi, October 5, 1990 11:29:25 am PDT Christian Jacobi, October 5, 1990 11:29:31 am PDT --returns flat rope so it can be read with simple debuggers Κb•NewlineDelimiter –(cedarcode) style™codešœ™Kšœ Οeœ7™BKšœ1™1Kšœ1™1K˜—šΟk ˜ Kšœ ˜ Kšœ˜Kšœ˜Kšœ ˜ Kšœ˜K˜—šΟnœžœž˜%Kšžœ˜Kšžœ˜—šž˜K˜—šœžœžœ˜7šŸœžœ˜Kšœžœ˜Kšœ˜——K˜š Ÿœžœžœžœžœ˜8Kšœ;™;šžœžœ˜Kšžœžœ)˜4Kšžœžœžœ˜›—K˜—K˜Kšœ4˜4Kšžœ˜K˜—…—~ζ