mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-02 18:10:23 +02:00
* also accept {$elsif} after {$if(n)def} (mantis #34858)
git-svn-id: trunk@41724 -
This commit is contained in:
parent
74fed2a4cd
commit
bde560dac2
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -16549,6 +16549,7 @@ tests/webtbs/tw3478.pp svneol=native#text/plain
|
||||
tests/webtbs/tw3479.pp svneol=native#text/plain
|
||||
tests/webtbs/tw34818.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw34848.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw34858.pp svneol=native#text/plain
|
||||
tests/webtbs/tw3489.pp svneol=native#text/plain
|
||||
tests/webtbs/tw34893.pp -text svneol=native#text/pascal
|
||||
tests/webtbs/tw3490.pp svneol=native#text/plain
|
||||
|
@ -3833,14 +3833,14 @@ type
|
||||
valuedescr: String;
|
||||
begin
|
||||
if assigned(preprocstack) and
|
||||
(preprocstack.typ in [pp_if,pp_elseif]) then
|
||||
(preprocstack.typ in [pp_if,pp_ifdef,pp_ifndef,pp_elseif]) then
|
||||
begin
|
||||
{ when the branch is accepted we use pp_elseif so we know that
|
||||
all the next branches need to be rejected. when this branch is still
|
||||
not accepted then leave it at pp_if }
|
||||
if (preprocstack.typ=pp_elseif) then
|
||||
preprocstack.accept:=false
|
||||
else if (preprocstack.typ=pp_if) and preprocstack.accept then
|
||||
else if (preprocstack.typ in [pp_if,pp_ifdef,pp_ifndef]) and preprocstack.accept then
|
||||
begin
|
||||
preprocstack.accept:=false;
|
||||
preprocstack.typ:=pp_elseif;
|
||||
|
15
tests/webtbs/tw34858.pp
Normal file
15
tests/webtbs/tw34858.pp
Normal file
@ -0,0 +1,15 @@
|
||||
{ %norun }
|
||||
|
||||
const a = 6;
|
||||
{$IFDEF ENDIAN_LITTLE}
|
||||
const b = 7;
|
||||
{$ELSEIF a > 5}
|
||||
const b = 7;
|
||||
{$ELSE}
|
||||
{$ERROR Unknown endian}
|
||||
{$IFEND}
|
||||
|
||||
begin
|
||||
if b<>7 then
|
||||
halt(1);
|
||||
end.
|
Loading…
Reference in New Issue
Block a user