* support record fields separated by commas instead of semicolons in typed

constant record definitions in MacPas mode (patch by Adriaan van Os,
    mantis )

git-svn-id: trunk@14915 -
This commit is contained in:
Jonas Maebe 2010-02-14 14:33:30 +00:00
parent 1b7dacfd1c
commit 78b9820e11
6 changed files with 32 additions and 0 deletions

4
.gitattributes vendored
View File

@ -9305,6 +9305,10 @@ tests/test/tsymlibrary1.pp svneol=native#text/pascal
tests/test/ttpara1.pp svneol=native#text/plain
tests/test/ttpara2.pp svneol=native#text/plain
tests/test/ttypedarray1.pp svneol=native#text/pascal
tests/test/ttypedrecord1.pp svneol=native#text/plain
tests/test/ttypedrecord2.pp svneol=native#text/plain
tests/test/ttypedrecord3.pp svneol=native#text/plain
tests/test/ttypedrecord4.pp svneol=native#text/plain
tests/test/tunaligned1.pp svneol=native#text/plain
tests/test/tunistr1.pp svneol=native#text/plain
tests/test/tunistr2.pp svneol=native#text/plain

View File

@ -1176,6 +1176,8 @@ implementation
if token=_SEMICOLON then
consume(_SEMICOLON)
else if (token=_COMMA) and (m_mac in current_settings.modeswitches) then
consume(_COMMA)
else
break;
end;

View File

@ -0,0 +1,6 @@
{$mode objfpc}
program ttyperecord1;
type RGB = record red, green, blue: integer end;
const kRGBBlack: RGB = ( red: 0; green: 0; blue: 0);
begin
end.

View File

@ -0,0 +1,7 @@
{ %fail }
{$mode objfpc}
program ttyperecord2;
type RGB = record red, green, blue: integer end;
const kRGBBlack: RGB = ( red: 0, green: 0, blue: 0);
begin
end.

View File

@ -0,0 +1,6 @@
{$mode macpas}
program ttyperecord3;
type RGB = record red, green, blue: integer end;
const kRGBBlack: RGB = ( red: 0; green: 0; blue: 0);
begin
end.

View File

@ -0,0 +1,7 @@
{$mode macpas}
{ Mac Pascal uses commas as separators between record fields in typed constants }
program ttyperecord4;
type RGB = record red, green, blue: integer end;
const kRGBBlack: RGB = ( red: 0, green: 0, blue: 0);
begin
end.