A Source.T represents the state of the source view.
INTERFACESource ; IMPORT View, VBT, JunoAST, JunoCompileErr; TYPE T <: Public; Public = View.T OBJECT METHODS init(root: View.Root): T; END;
NEW(T).init(r) creates a new source view on the root r.
PROCEDURE Compile(s: T; time: VBT.TimeStamp; skipify: BOOLEAN): BOOLEAN;
Take the following two steps:
1. If the current command is out-of-date, parse the current command, and 2. Compile the current command (reflecting "skipify") and install itscompiled code.If any parse or compilation errors occur, display an error message, highlight the error using timestamp
time. Otherwise, sets.root.astTruetoTRUE.
PROCEDURE Make(s: T; time: VBT.TimeStamp; skipify: BOOLEAN): BOOLEAN;
CallCompile(s, time, skipify). If that succeeds, update the drawing (thereby settings.root.dTruetoTRUE) and unparse the current command (thereby settings.root.sTruetoTRUE). The current command that gets unparsed will contain any new hints engendered by running the current command when the drawing is updated.Returns
TRUEiff no lex, parse, compilation, or run-time errors occurred.
PROCEDURE ShowError(
s: T; ast: JunoAST.T;
READONLY err: JunoCompileErr.ErrVal;
ts: VBT.TimeStamp);
Unparseasttos, highlight its subtreeerr.ast, and display the messageerr.msgto the user. Iferr.astis not a subtree ofast, the error message and error tree are written to standard error.
PROCEDURE GetText(s:T): TEXT;
Return the contents of s. PROCEDURE SetText(s: T; txt: TEXT);
Set the contents ofstotxt. Used when restoring a checkpoint.
END Source.