Sfoglia il codice sorgente

Merged revisions 584-585 via svnmerge from
/trunk

git-svn-id: branches/fixes_2_0@672 -

peter 20 anni fa
parent
commit
e2dcc3e428
3 ha cambiato i file con 19 aggiunte e 4 eliminazioni
  1. 1 0
      .gitattributes
  2. 2 4
      compiler/scanner.pas
  3. 16 0
      tests/webtbs/tw4151.pp

+ 1 - 0
.gitattributes

@@ -5963,6 +5963,7 @@ tests/webtbs/tw4115.pp svneol=native#text/plain
 tests/webtbs/tw4119.pp svneol=native#text/plain
 tests/webtbs/tw4140.pp svneol=native#text/plain
 tests/webtbs/tw4150.pp svneol=native#text/plain
+tests/webtbs/tw4151.pp svneol=native#text/plain
 tests/webtbs/tw4155.pp svneol=native#text/plain
 tests/webtbs/tw4188.pp svneol=native#text/plain
 tests/webtbs/ub1873.pp svneol=native#text/plain

+ 2 - 4
compiler/scanner.pas

@@ -673,12 +673,10 @@ implementation
                                         read_factor := upper(pchar(value.valueptr));
                                       constset :
                                         begin
-                                          hs:='';
+                                          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+',';
+                                              hs:=hs+tostr(l)+',';
                                           read_factor := hs;
                                         end;
                                     end;

+ 16 - 0
tests/webtbs/tw4151.pp

@@ -0,0 +1,16 @@
+{ Source provided for Free Pascal Bug Report 4151 }
+{ Submitted by "Christian Iversen" on  2005-07-03 }
+{ e-mail: [email protected] }
+
+{$mode delphi}
+
+program foo;
+type
+  t = (a, b, c);
+const bar = [];
+
+{$IF a in bar}{$MESSAGE ERROR '1'}{$IFEND}
+{$IF a in []}{$MESSAGE ERROR '2'}{$IFEND}
+
+begin
+end.