lex.c (259268) | lex.c (259890) |
---|---|
1/* CPP Library - lexical analysis. 2 Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 3 Contributed by Per Bothner, 1994-95. 4 Based on CCCP program by Paul Rubin, June 1986 5 Adapted to ANSI C, Richard Stallman, Jan 1987 6 Broken out to separate file, Zack Weinberg, Mar 2000 7 8This program is free software; you can redistribute it and/or modify it --- 752 unchanged lines hidden (view full) --- 761 762 for (;;) 763 { 764 if (pfile->cur_token == pfile->cur_run->limit) 765 { 766 pfile->cur_run = next_tokenrun (pfile->cur_run); 767 pfile->cur_token = pfile->cur_run->base; 768 } | 1/* CPP Library - lexical analysis. 2 Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 3 Contributed by Per Bothner, 1994-95. 4 Based on CCCP program by Paul Rubin, June 1986 5 Adapted to ANSI C, Richard Stallman, Jan 1987 6 Broken out to separate file, Zack Weinberg, Mar 2000 7 8This program is free software; you can redistribute it and/or modify it --- 752 unchanged lines hidden (view full) --- 761 762 for (;;) 763 { 764 if (pfile->cur_token == pfile->cur_run->limit) 765 { 766 pfile->cur_run = next_tokenrun (pfile->cur_run); 767 pfile->cur_token = pfile->cur_run->base; 768 } |
769 /* We assume that the current token is somewhere in the current 770 run. */ 771 if (pfile->cur_token < pfile->cur_run->base 772 || pfile->cur_token >= pfile->cur_run->limit) 773 abort (); |
|
769 770 if (pfile->lookaheads) 771 { 772 pfile->lookaheads--; 773 result = pfile->cur_token++; 774 } 775 else 776 result = _cpp_lex_direct (pfile); --- 65 unchanged lines hidden (view full) --- 842 if (pfile->state.parsing_args) 843 return false; 844 845 /* End of buffer. Non-empty files should end in a newline. */ 846 if (buffer->buf != buffer->rlimit 847 && buffer->next_line > buffer->rlimit 848 && !buffer->from_stage3) 849 { | 774 775 if (pfile->lookaheads) 776 { 777 pfile->lookaheads--; 778 result = pfile->cur_token++; 779 } 780 else 781 result = _cpp_lex_direct (pfile); --- 65 unchanged lines hidden (view full) --- 847 if (pfile->state.parsing_args) 848 return false; 849 850 /* End of buffer. Non-empty files should end in a newline. */ 851 if (buffer->buf != buffer->rlimit 852 && buffer->next_line > buffer->rlimit 853 && !buffer->from_stage3) 854 { |
850 /* Only warn once. */ | 855 /* Clip to buffer size. */ |
851 buffer->next_line = buffer->rlimit; | 856 buffer->next_line = buffer->rlimit; |
852 cpp_error_with_line (pfile, CPP_DL_PEDWARN, pfile->line_table->highest_line, 853 CPP_BUF_COLUMN (buffer, buffer->cur), 854 "no newline at end of file"); | 857 /* APPLE LOCAL begin suppress no newline warning. */ 858 if ( CPP_OPTION (pfile, warn_newline_at_eof)) 859 { 860 cpp_error_with_line (pfile, CPP_DL_PEDWARN, pfile->line_table->highest_line, 861 CPP_BUF_COLUMN (buffer, buffer->cur), 862 "no newline at end of file"); 863 } 864 /* APPLE LOCAL end suppress no newline warning. */ |
855 } 856 857 return_at_eof = buffer->return_at_eof; 858 _cpp_pop_buffer (pfile); 859 if (pfile->buffer == NULL || return_at_eof) 860 return false; 861 } 862} --- 857 unchanged lines hidden --- | 865 } 866 867 return_at_eof = buffer->return_at_eof; 868 _cpp_pop_buffer (pfile); 869 if (pfile->buffer == NULL || return_at_eof) 870 return false; 871 } 872} --- 857 unchanged lines hidden --- |