?? prettier.pas
字號:
UNIT Prettier;
(* Pretty printing auxiliary functions for use with TASTE pretty printing
program generated by COCO from an attributed grammar
P.D. Terry, Rhodes University, 1995 *)
INTERFACE
VAR
results : TEXT;
PROCEDURE Append (Str : STRING);
(* Append Str to results file *)
PROCEDURE IndentNextLine;
(* Write line mark to results file and prepare to indent further lines
by two spaces more than before *)
PROCEDURE ExdentNextLine;
(* Write line mark to results file and prepare to indent further lines
by two spaces less *)
PROCEDURE NewLine;
(* Write line mark to results file but leave indentation as before *)
PROCEDURE Indent;
PROCEDURE Exdent;
IMPLEMENTATION
VAR
Indentation : INTEGER;
PROCEDURE Append (Str : STRING);
BEGIN
Write(results, Str);
END;
PROCEDURE NewLine;
VAR
I : INTEGER;
BEGIN
WriteLn(results);
FOR I := 1 TO Indentation DO Write(results, ' ');
END;
PROCEDURE IndentNextLine;
BEGIN
INC(Indentation, 2); NewLine
END;
PROCEDURE ExdentNextLine;
BEGIN
DEC(Indentation, 2); NewLine
END;
PROCEDURE Indent;
BEGIN
INC(Indentation, 2)
END;
PROCEDURE Exdent;
BEGIN
DEC(Indentation, 2)
END;
BEGIN
Indentation := 0
END.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -