View Issue Details

IDProjectCategoryView StatusLast Update
0037693FPCCompilerpublic2020-09-16 19:31
ReporterKai Burghardt Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Platformx86_64OSGNU/Linux 
Product Version3.2.0 
Summary0037693: $mode ISO accepts underscores as part of identifiers
DescriptionISO 7185 states, identifiers may consist of letters and digits only.
http://pascal-central.com/iso7185.html#6.1.3%20Identifiers

However, FPC accepts underscores, too, although an underscore is neither a letter or digit
http://pascal-central.com/iso7185.html#6.1.1%20General
Steps To ReproduceThis program should fail to compile, yet it does:

{$mode ISO}
program _;
begin
end.
Additional InformationWe already implement the constraint that an identifier must not start with a digit, but with a letter. [Provided underscores are forbidden.]

Extended Pascal (ISO 10206), on the other hand, will allow underscores, but identifiers may not begin or end with underscores, nor is it allowed to use multiple underscores after another.
TagsNo tags attached.
Fixed in Revision
FPCOldBugId
FPCTarget
Attached Files

Activities

Florian

2020-09-14 21:37

administrator   ~0125542

I think the ISO Pascal standard allows that extensions are supported, so this falls in into that category?

Kai Burghardt

2020-09-15 14:31

reporter   ~0125550

OK, yeeahhh… We can of course demote everything to a mere documentation issue. Surely $mode objFPC is “just” an amended version of ISO 7185 Pascal, “just” with the following differences: [… a long list …]

I don’t know what exactly the intention of $mode ISO is. As far as I understood it’s supposed to be an ISO-7185-compliant mode. E.g. you can’t can’t use units, or several other things, but also there’s the possibility to access file-buffer-variables.

I don’t mind if FPC allows it or not. It’s just one thing I spotted while studying the standard. If we deviate though, it should be documented.

Florian

2020-09-16 19:31

administrator   ~0125573

The scope of the ISO mode is to compile any ISO mode program but it does not disable extensions which do not interfere with ISO Pascal. The same applies to any other mode as well. This is in particular important as we do not supply a seperate system unit for everymode: the whole system unit is also available in all modes.

Issue History

Date Modified Username Field Change
2020-09-02 22:15 Kai Burghardt New Issue
2020-09-14 21:37 Florian Note Added: 0125542
2020-09-15 14:31 Kai Burghardt Note Added: 0125550
2020-09-16 19:31 Florian Note Added: 0125573