pret-pas/test-file/pret-pas_test.tex

50 lines
1.2 KiB
TeX
Raw Normal View History

\installprettytype[PAS][PAS]
\definetyping[PAS][option=PAS, escape=yes, tab=4, numbering=line]
2010-10-02 11:53:12 +02:00
%\definetyping[PAS][option=PAS, escape=yes, tab=4, numbering=line, palet=]
\setuplinenumbering[location=text]
\starttext
2010-10-02 15:21:17 +02:00
2024-05-05 16:33:03 +02:00
The first block shows all features of the Pascal pretty printer.
2010-10-02 15:21:17 +02:00
\startPAS
2010-10-01 22:51:12 +02:00
{ Comment }
2010-10-02 15:21:17 +02:00
(* An alternative comment *)
2010-10-01 22:51:12 +02:00
{$R- compiler directive }
procedure TForm1.Button1.Click(Sender: TObject);
var // Delphi Comment
2010-09-29 23:37:40 +02:00
Number, I, X: Integer;
begin
2010-09-29 23:37:40 +02:00
Number := 12345 * (2 + 9);
Caption := 'The number is ' + IntToStr(Number);
asm
MOV AX,1234h
MOV Number,AX
end;
X := 10;
end;
\stopPAS
2010-09-29 23:37:40 +02:00
2024-05-05 16:33:03 +02:00
The next block shows some (more or less useful) special cases.
2010-10-02 15:21:17 +02:00
2010-09-29 23:37:40 +02:00
\startPAS
2010-09-30 12:10:49 +02:00
My_Variable := _for;
2010-09-29 23:37:40 +02:00
45My_Variable := _Variable45;
2010-09-30 12:10:49 +02:00
normal asm green for end normal For END
normal aSM green foR eNd normal For END
&for asm green
2010-10-01 20:46:14 +02:00
end normal / normal
2010-10-02 15:21:17 +02:00
{blue slanted'slanted}normal'blue
2010-09-30 14:55:44 +02:00
normal'blue{blue}blue'Normal'blue
2010-10-02 15:21:17 +02:00
asm green'gr{ee}n'{blue slanted}green end
{asm slanted end}
2010-09-30 14:55:44 +02:00
normal'blue'Normal'Blue'nOrmal'bLue'noRmal
2010-10-02 15:21:17 +02:00
normal {slanted*) still slanted
2010-09-30 21:00:17 +02:00
still comment
comment (* ends} normal
2010-10-02 15:21:17 +02:00
normal (*slanted} still slanted
2010-09-30 21:00:17 +02:00
still comment
comment { ends*) normal
2010-10-02 15:21:17 +02:00
normal {slanted blue} normal {$slanted red} normal
2010-09-29 23:37:40 +02:00
\stopPAS
\stoptext