fpc dont like this one too:
program test;
{ I am a comment with this: { something... }
begin
end.
Result:
fred@fred-80m0 ~> fpc test.pas
Free Pascal Compiler version 3.2.2 [2021/07/09] for x86_64
Copyright (c) 1993-2021 by Florian Klaempfl and others
Target OS: Linux for x86-64
Compiling test.pas
test.pas(3,29) Warning: Comment level 2 found
test.pas(6,5) Fatal: Unexpected end of file
Fatal: Compilation aborted
Error: /usr/bin/ppcx64 returned an error exitcode
That depends upon the mode. In modes
FPC and
ObjFPC FPC allows nested comments, so you can have
{ foo { bar } blubb }, while in modes
TP and
Delphi you need to alternate the comment style for this to compile:
{ foo (* bar *) blubb }. This is why your code fails as the compiler detects a second level comment and expects as many closing brackets to finish of the comment(s).