ptop.cfg(5)
π ptop.cfg β the config file for the ptop source beautifier π
okay so hi bestie π«Ά this is ptop.cfg(5), the manual page for the ptop source beautifier config file. ptop is literally the source beautifier of the FreePascal project, and its origin is probably Pascal-TO-Pascal.cfg. no cap.
β¨ NAME β¨
ptop.cfg β The ptop source-beautifier configuration file.
ptop is the source beautifier of the FreePascal project.
Origin probably Pascal-TO-Pascal.cfg
πΈ DESCRIPTION πΈ
This is the main configuration file of the ptop FPC source beautifier. main character energy fr fr π
okay but here's the tea: the config file for ptop(1) isn't necessarily called ptop.cfg, and it is also not auto-loaded, so honestly the name doesn't matter much. this man-page describes the structure of such a configuration file for ptop(1). that's it, that's the vibe.
π¦ STRUCTURE π¦
the structure of a ptop configuration file is a simple building block repeated several (60-70) times β once for each pascal keyword known to the ptop program. (peep the default configuration file or the ptopu.pp source to find out which keywords are known π)
The basic building block of the configuration file consists out of one, two or three lines, describing how ptop should react on a certain keyword. First a line without square brackets with the following format:
keyword=option1,option2,option3,...
If one of the options is dindonkey (see further below), a second line (with square brackets) is needed like this:
[keyword]=otherkeyword1,otherkeyword2,otherkeyword3,...
Then if one of the options is gobsym, a third line (with angle brackets) is needed like this:
<keyword>=terminalword1,terminalword2,terminalword3,...
As you can see the block contains two types of identifiers: keywords (keyword, otherkeyword1..3 and terminalword1..3 in the above example) and options (option1..3 above).
Keywords are the built-in valid Pascal structure-identifiers like BEGIN, END, CASE, IF, THEN, ELSE, IMPLEMENTATION. The default configuration file lists most of these.
Besides the real Pascal keywords, some other codewords are used for operators and comment expressions. These are listed in the following table:
casevarβ:in a case label (<>'colon')becomesβ:=delphicommentβ//opencommentβ{or(*closecommentβ}or*)semicolonβ;colonβ:equalsβ=openparenβ[closeparenβ]periodβ.
The Options codewords define actions to be taken when the keyword before the equal sign is found. π
crsuppβ suppress CR before the keyword.crbeforeβ force CR before keyword (doesn't go withcrsupp:) )blinbeforeβ blank line before keyword.dindonkeyβ de-indent on associated keywords (see below)dindentβ de-indent (always)spbefβ space beforespaftβ space aftergobsymβ Print symbols which follow a keyword, but which do not affect layout. Prints until terminators occur.inbytabβ indent by tab.crafterβ force CR after keyword.upperβ prints keyword all uppercaselowerβ prints keyword all lowercasecapitalβ capitalizes keyword: 1st letter uppercase, rest lowercase.
The option dindonkey requires some extra parameters, which are set by a second line for that keyword (the one with the square brackets), which is therefore only needed if the options contain dinkdonkey (contraction of de-indent on assiociated keyword). π«Ά
dinkdonkey deindents if any of the keywords specified by the extra options of the square-bracket line is found.
In a similar manner the option gobsym, short for gobble symbols, requires some additional information in order to perform its function. The gobsym option indicates that all symbols following the keyword should be passed through unchanged until a terminal symbol is reached. The list of acceptable terminal symbols is provided by the angle-bracket line.
π₯ EXAMPLES π₯
The block
else=crbefore,dindonkey,inbytab,upper
[else]=if,then,else
Means:
The keyword this is about is else, it's on the LEFT side of both equal signs.
When the ptop parser finds ELSE, the options tell it to do the following things:
- (
crbefore) Don't allow other code on the line before the keyword. (ELSEalone on a line) - (
dindonkey) De-indent on the keywords in square brackets line (if,then,else) - (
inbytab) indent by tab. - (
upper) uppercase the keyword (ELSE)
The block
case=spaft,gobsym,inbytab,crafter,capital
<case>=ofsym
Means:
The keyword this is about is case, it's on the LEFT side of both equal signs.
When case is found, the options tell it to do the following things:
- (
spaft) Insure that there is a space after the keyword. (case) - (
gobsym) pass symbols through unchanced until one of the words in the angle brackets line (of) is found. - (
crafter) Make sure terminator (of) ends the line. - (
inbytab) indent by tab. - (
capital) Capitalize the keyword (casebecomesCase).
Try to play with the configfile until you find the effect you desire. The configurability and possibilities of ptop are quite large compared to other shareware source beautifiers found on e.g. SIMTEL. slay π
β¨
π ACKNOWLEDGEMENTS π
The writer of the program, Michael van Canneyt, who also helped out explaining the format of ptop.cfg. king behaviour honestly π
Questions/corrections can be mailed to fpc-devel@vekoll.saturnus.vein.hu
Also thanks to the rest of the FPC development team. π«Ά
π SEE ALSO π
- ptop binary
- Compiler
- Other FPC utils
okay that's the whole page bestie, you're officially a ptop config girlie now π§π this was FreePascal, dated 25 January 2007 β mwah, go forth and beautify some Pascal πππΈ
π¦ where this page comes from
- arch rolling: fpc 3.2.2-11 Β· GPL AND LGPL AND custom
- epel 10: fpc 3.2.2-20.el10_1 Β· GPL-2.0-or-later AND LGPL-2.1-or-later WITH Independent-modules-exception
- epel 9: fpc 3.2.2-10.el9 Β· GPLv2+ and LGPLv2+ with exceptions
- fedora 43: fpc 3.2.2-20.fc43 Β· GPL-2.0-or-later AND LGPL-2.1-or-later WITH Independent-modules-exception
- fedora 43: fpc 3.2.2-20.fc43 Β· GPL-2.0-or-later AND LGPL-2.1-or-later WITH Independent-modules-exception
- fedora 44: fpc 3.2.4~rc1-3.fc44 Β· GPL-2.0-or-later AND LGPL-2.1-or-later WITH Independent-modules-exception
- fedora 44: fpc 3.2.4~rc1-3.fc44 Β· GPL-2.0-or-later AND LGPL-2.1-or-later WITH Independent-modules-exception
- nixos 26.05: fpc 3.2.2
- nixos 26.05: lazarus-gtk2 4.4-0
- nixos 26.05: lazarus-qt5 4.4-0
- nixos 26.05: lazarus-qt6 4.4-0
- nixpkgs unstable: fpc 3.2.2
- nixpkgs unstable: lazarus-cocoa 4.8-0
- nixpkgs unstable: lazarus-gtk3 4.8-0
- nixpkgs unstable: lazarus-qt5 4.8-0
- nixpkgs unstable: lazarus-qt6 4.8-0
- opensuse-leap 16.0: fpc 3.2.2-bp160.1.35 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: fpc 3.2.2-bp160.1.35 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: fpc 3.2.2-bp160.1.35 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms