cnwizards
cnwizards copied to clipboard
[Code Formatter] Cant format
CnFormatter cant format this code:
LBot := TTelegramBot.Create('YOUR_TOKEN',
{$IFDEF USE_INDY_CORE}
TcuHttpClientIndy.Create(nil)
{$ELSE}
TcuHttpClientSysNet.Create(nil)
{$ENDIF});
Default we treat compiler directives as comments, so the code piece leads to an error parsing according to Pascal grammar.
You can change the "compiler directive" option in Code Formatter Setting Dialog to "Only First" block and try it again?
cnPack 1.1.8.983 Failed formatting code (showing error dialog):
type
{$DEFINE TEST}
{$IFDEF TEST}
TMyStrings = class(TStrings)
{$ELSE}
TMyStrings = class(TStringList)
{$ENDIF}
public
end; // of: TTestClass