mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-11 23:08:08 +02:00

- add own symbol table for enumeration to store enumeration elements - reimplement enumeration member traverse using symbol table instead of firstenum/nextenum - that members are removed - implement TEnum.Element access syntax - element is searched in the enumeration symtable in this case instead of global/local symtables - implement {$SCOPEDENUM ON/OFF} local switch + tests git-svn-id: trunk@15051 -
18 lines
333 B
ObjectPascal
18 lines
333 B
ObjectPascal
{ %fail}
|
|
{ %norun}
|
|
|
|
// test checks that enumeration searches symbols only in the own symbol list
|
|
// if they are prefixed by the enumeration name
|
|
|
|
program tenum5;
|
|
type
|
|
{$SCOPEDENUMS ON}
|
|
TEnum1 = (first, second, third);
|
|
{$SCOPEDENUMS OFF}
|
|
TEnum2 = (zero, first, second, third);
|
|
var
|
|
En1: TEnum1;
|
|
begin
|
|
En1 := TEnum1.zero;
|
|
end.
|