mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-24 11:49:13 +02:00
* support constset in $if
git-svn-id: trunk@538 -
This commit is contained in:
parent
6cc6711cc2
commit
408bba521a
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -5467,6 +5467,7 @@ tests/webtbf/tw3740.pp svneol=native#text/plain
|
||||
tests/webtbf/tw3790.pp svneol=native#text/plain
|
||||
tests/webtbf/tw3841.pp svneol=native#text/plain
|
||||
tests/webtbf/tw4111.pp svneol=native#text/plain
|
||||
tests/webtbf/tw4139.pp svneol=native#text/plain
|
||||
tests/webtbf/uw0744.pp svneol=native#text/plain
|
||||
tests/webtbf/uw0840a.pp svneol=native#text/plain
|
||||
tests/webtbf/uw0840b.pp svneol=native#text/plain
|
||||
|
@ -76,6 +76,9 @@ than 255 characters. That's why using Ansi Strings}
|
||||
tdoublearray = array[0..7] of byte;
|
||||
textendedarray = array[0..9] of byte;
|
||||
|
||||
pconstset = ^tconstset;
|
||||
tconstset = set of 0..255;
|
||||
|
||||
{ Switches which can be changed locally }
|
||||
tlocalswitch = (cs_localnone,
|
||||
{ codegen }
|
||||
|
@ -33,9 +33,6 @@ interface
|
||||
symtype;
|
||||
|
||||
type
|
||||
pconstset = ^tconstset;
|
||||
tconstset = set of 0..255;
|
||||
|
||||
tnodetype = (
|
||||
emptynode, {No node (returns nil when loading from ppu)}
|
||||
addn, {Represents the + operator}
|
||||
|
@ -670,7 +670,17 @@ implementation
|
||||
end;
|
||||
end;
|
||||
conststring :
|
||||
read_factor := upper(pchar(value.valueptr))
|
||||
read_factor := upper(pchar(value.valueptr));
|
||||
constset :
|
||||
begin
|
||||
hs:='';
|
||||
for l:=0 to 255 do
|
||||
if l in pconstset(tconstsym(srsym).value.valueptr)^ then
|
||||
hs:=hs+','+tostr(l);
|
||||
if hs<>'' then
|
||||
hs:=hs+',';
|
||||
read_factor := hs;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
24
tests/webtbf/tw4139.pp
Executable file
24
tests/webtbf/tw4139.pp
Executable file
@ -0,0 +1,24 @@
|
||||
{ %fail }
|
||||
{ %opt=-Sew }
|
||||
|
||||
{ Source provided for Free Pascal Bug Report 4139 }
|
||||
{ Submitted by "Christian Iversen" on 2005-06-29 }
|
||||
{ e-mail: chrivers@iversen-net.dk }
|
||||
|
||||
{$mode delphi}
|
||||
|
||||
type
|
||||
Foobar = (a, b, c, d);
|
||||
|
||||
const
|
||||
Test = c;
|
||||
|
||||
const
|
||||
List = [a, c];
|
||||
|
||||
{$IF Test in List}
|
||||
{$MESSAGE WARN 'This should work'}
|
||||
{$IFEND}
|
||||
|
||||
begin
|
||||
end.
|
Loading…
Reference in New Issue
Block a user