mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-10-31 03:31:36 +01:00 
			
		
		
		
	* added eof message
* fixed unit init section parsing with finalize
This commit is contained in:
		
							parent
							
								
									c6dfe39b01
								
							
						
					
					
						commit
						075d0d16fc
					
				| @ -899,10 +899,7 @@ unit pstatmnt; | |||||||
|          consume(starttoken); |          consume(starttoken); | ||||||
|          inc(statement_level); |          inc(statement_level); | ||||||
| 
 | 
 | ||||||
|          while not( |          while not(token in [_END,_FINALIZATION]) do | ||||||
|              (token=_END) or |  | ||||||
|              ((starttoken=_INITIALIZATION) and (token=_FINALIZATION)) |  | ||||||
|            ) do |  | ||||||
|            begin |            begin | ||||||
|               if first=nil then |               if first=nil then | ||||||
|                 begin |                 begin | ||||||
| @ -914,8 +911,7 @@ unit pstatmnt; | |||||||
|                    last^.left:=gennode(statementn,nil,statement); |                    last^.left:=gennode(statementn,nil,statement); | ||||||
|                    last:=last^.left; |                    last:=last^.left; | ||||||
|                 end; |                 end; | ||||||
|               if (token=_END) or |               if (token in [_END,_FINALIZATION]) then | ||||||
|                 ((starttoken=_INITIALIZATION) and (token=_FINALIZATION)) then |  | ||||||
|                 break |                 break | ||||||
|               else |               else | ||||||
|                 begin |                 begin | ||||||
| @ -923,8 +919,6 @@ unit pstatmnt; | |||||||
|                    if token<>SEMICOLON then |                    if token<>SEMICOLON then | ||||||
|                      begin |                      begin | ||||||
|                         consume(SEMICOLON); |                         consume(SEMICOLON); | ||||||
|                         { while token<>SEMICOLON do |  | ||||||
|                           consume(token); } |  | ||||||
|                         consume_all_until(SEMICOLON); |                         consume_all_until(SEMICOLON); | ||||||
|                      end; |                      end; | ||||||
|                    consume(SEMICOLON); |                    consume(SEMICOLON); | ||||||
| @ -933,9 +927,9 @@ unit pstatmnt; | |||||||
|            end; |            end; | ||||||
| 
 | 
 | ||||||
|          { don't consume the finalization token, it is consumed when |          { don't consume the finalization token, it is consumed when | ||||||
|            reading the finalization block ! |            reading the finalization block, but allow it only after | ||||||
|          } |            an initalization ! } | ||||||
|          if token=_END then |          if (starttoken<>_INITIALIZATION) or (token<>_FINALIZATION) then | ||||||
|            consume(_END); |            consume(_END); | ||||||
| 
 | 
 | ||||||
|          dec(statement_level); |          dec(statement_level); | ||||||
| @ -1011,6 +1005,9 @@ unit pstatmnt; | |||||||
|             _ASM : begin |             _ASM : begin | ||||||
|                       code:=_asm_statement; |                       code:=_asm_statement; | ||||||
|                    end; |                    end; | ||||||
|  |             _EOF : begin | ||||||
|  |                      Message(scan_f_end_of_file); | ||||||
|  |                    end; | ||||||
|          else |          else | ||||||
|            begin |            begin | ||||||
|               if (token=INTCONST) or |               if (token=INTCONST) or | ||||||
| @ -1214,7 +1211,11 @@ unit pstatmnt; | |||||||
| end. | end. | ||||||
| { | { | ||||||
|   $Log$ |   $Log$ | ||||||
|   Revision 1.42  1998-09-26 17:45:38  peter |   Revision 1.43  1998-10-08 13:46:22  peter | ||||||
|  |     * added eof message | ||||||
|  |     * fixed unit init section parsing with finalize | ||||||
|  | 
 | ||||||
|  |   Revision 1.42  1998/09/26 17:45:38  peter | ||||||
|     + idtoken and only one token table |     + idtoken and only one token table | ||||||
| 
 | 
 | ||||||
|   Revision 1.41  1998/09/24 23:49:15  peter |   Revision 1.41  1998/09/24 23:49:15  peter | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 peter
						peter