diff --git a/.gitattributes b/.gitattributes index c9c91a3065..1edceaa328 100644 --- a/.gitattributes +++ b/.gitattributes @@ -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 diff --git a/compiler/ptconst.pas b/compiler/ptconst.pas index 299bcbe9d8..d0d85cd438 100644 --- a/compiler/ptconst.pas +++ b/compiler/ptconst.pas @@ -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; diff --git a/tests/test/ttypedrecord1.pp b/tests/test/ttypedrecord1.pp new file mode 100644 index 0000000000..cd1c189000 --- /dev/null +++ b/tests/test/ttypedrecord1.pp @@ -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. diff --git a/tests/test/ttypedrecord2.pp b/tests/test/ttypedrecord2.pp new file mode 100644 index 0000000000..d776b09ea6 --- /dev/null +++ b/tests/test/ttypedrecord2.pp @@ -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. diff --git a/tests/test/ttypedrecord3.pp b/tests/test/ttypedrecord3.pp new file mode 100644 index 0000000000..805215851a --- /dev/null +++ b/tests/test/ttypedrecord3.pp @@ -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. diff --git a/tests/test/ttypedrecord4.pp b/tests/test/ttypedrecord4.pp new file mode 100644 index 0000000000..731e1b1509 --- /dev/null +++ b/tests/test/ttypedrecord4.pp @@ -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.