The following characters have a special meaning:
Recognised symbols
![]()
![]()
![]()
+ - * / = < > [ ] . , ( ) : ^ @ { } $ #and the following character pairs too:
<= >= := += -= *= /= (* *) (. .) //When used in a range specifier, the character pair (. is equivalent to the left square bracket [. Likewise, the character pair .) is equivalent to the right square bracket ]. When used for comment delimiters, the character pair (* is equivalent to the left brace { and the character pair *) is equivalent to the right brace }. These character pairs retain their normal meaning in string expressions.
(* This is an old style comment *) { This is a Turbo Pascal comment } // This is a Delphi comment. All is ignored till the end of the line.The following are valid ways of nesting comments:
{ Comment 1 (* comment 2 *) } (* Comment 1 { comment 2 } *) { comment 1 // Comment 2 } (* comment 1 // Comment 2 *) // comment 1 (* comment 2 *) // comment 1 { comment 2 }The last two comments must be on one line. The following two will give errors:
// Valid comment { No longer valid comment !! }and
// Valid comment (* No longer valid comment !! *)The compiler will react with a 'invalid character' error when it encounters such constructs, regardless of the -So switch.
absolute and array asm begin break case const constructor continue destructor div do downto else end file for function goto if implementation in inherited inline interface label mod nil not object of on operator or packed procedure program record repeat self set shl shr string then to type unit until uses var while with xor
as class except exports finalization finally initialization is library on property raise try
dispose exit false new true
absolute abstract alias assembler cdecl default export external far forward index name near override pascal popstack private protected public published read register saveregisters stdcall virtual write
Remark: Predefined types such as Byte, Boolean and constants such as maxint are not reserved words. They are identifiers, declared in the system unit. This means that these types can be redefined in other units. The programmer is, however, not encouraged to do this, as it will cause a lot of confusion.
Identifiers
![]()
Numbers
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
Label
![]()
Remark: Note that the -Sg switch must be specified before labels can be used. By default, Free Pascal doesn't support label and goto statements.
Character strings
![]()
![]()
![]()
![]()