mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-11-04 16:39:24 +01:00 
			
		
		
		
	* support record fields separated by commas instead of semicolons in typed
constant record definitions in MacPas mode (patch by Adriaan van Os,
    mantis #15764)
git-svn-id: trunk@14915 -
			
			
This commit is contained in:
		
							parent
							
								
									1b7dacfd1c
								
							
						
					
					
						commit
						78b9820e11
					
				
							
								
								
									
										4
									
								
								.gitattributes
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								.gitattributes
									
									
									
									
										vendored
									
									
								
							@ -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
 | 
			
		||||
 | 
			
		||||
@ -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;
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										6
									
								
								tests/test/ttypedrecord1.pp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								tests/test/ttypedrecord1.pp
									
									
									
									
									
										Normal 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.
 | 
			
		||||
							
								
								
									
										7
									
								
								tests/test/ttypedrecord2.pp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								tests/test/ttypedrecord2.pp
									
									
									
									
									
										Normal 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.
 | 
			
		||||
							
								
								
									
										6
									
								
								tests/test/ttypedrecord3.pp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								tests/test/ttypedrecord3.pp
									
									
									
									
									
										Normal 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.
 | 
			
		||||
							
								
								
									
										7
									
								
								tests/test/ttypedrecord4.pp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								tests/test/ttypedrecord4.pp
									
									
									
									
									
										Normal 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.
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user