Step 2: Example Delphi/Pascal Source
Overall Delphi/Pascal Features
Step 1: Unformatted Source
Step 2: Example Source
Step 3: Formatted Source
Here's one of the Delphi/Pascal example files that come with Polystyle.
Polystyle comes with style files for: Allman/BSD, Ellemtel, GNU, Kernighan & Ritchie, One True Brace Style, Unix Kernel,
Linux Kernel, Stroustrup, Sun Microsystems, and Whitesmith.
Each example file come in various indent styles, such as 2-space, 1-tab, 4-space, and others.
Your style is easily configured using the Configuration Tool.
To define your style, you simply edit an example file however you like.
|
{
*
* This is a recommended Polystyle Delphi/Pascal example.
* Reformat this file as you like to define your personal style. This means
* changing the whitespace padding between tokens, placement of newlines, and
* the indents to match your style.
*
* You may add snippets of code to this file to elaborate on your style,
* but it is recommended that you not remove code.
*
* Polystyle ignores the placement of comments in the example file.
*
* To set things such as your page width and indent character, use the
* Configuration Tool that comes with Polystyle.
*
* ---
*
* Copyright 2001-2003 Flashbulb Studios.
*
* http://Polystyle.com
*
}
exports
a resident,
b,
c;
interface
uses
Messages, Graphics, ShellApi;
resourcestring
a = 'b';
type
MyType = packed record // record with one element
Obj : AType;
end;
MyType = packed record // record with multiple elements
Obj : AType;
Obj : AType;
Obj : AType;
end;
MyClass = class( a, b, c )[ GUID ]
property prop[ a : b ] : TProp name b read c write d;
property p;
property z;
private
property z;
property z;
property z;
private
property z;
end;
label x, y, z;
implementation
function MyFunc; external Extrnl name 'myName';
procedure MyProc( Send : TObject; Shift : State; F, G : Integer ) of class;
var
Box : Array [ 1..n ] of double;
a : b absolute c;
a : MyType; stdcall = ( (a : b; a : b; a : b), a, b );
begin
repeat
x;
until x in y;
lbl :
with( x ) do
x;
try
x;
except on exc do
x;
end;
case mode of
0 : a;
1 : b;
2 : c;
else
x;
end;
raise x;
asm
assembler instructions;
formatting unchanged;
end;
goto lab;
inline( > x / v );
for x to 10 do y;
if x then
Begin
x;
end
else
Begin
x
end;
while( x ) do
Begin
x
end;
[ 0..1 ];
'string'#0'string';
-x;
a.b^.c := d;
inherited func( a, b, c );
x + x[ x ] * x > x >> not ( @x );
end;
initialization
x;
x;
x;
end.
Next, in Step 3 we get the final result!
|