diff options
author | Craig Burley <craig@jcb-sc.com> | 1999-05-31 02:35:20 +0000 |
---|---|---|
committer | Craig Burley <craig@jcb-sc.com> | 1999-05-31 02:35:20 +0000 |
commit | 2324bf3f34e5f904390876c3c3243cea0117546b (patch) | |
tree | 731c4298d4f3366b1a02034e3aa4848a86592cf9 | |
parent | 1ed41a7289845acd22829be18244f048c5a4c785 (diff) |
code
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/g77-0_6-branch@27270 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/f/bad.c | 4 | ||||
-rw-r--r-- | gcc/f/lex.c | 74 |
2 files changed, 61 insertions, 17 deletions
diff --git a/gcc/f/bad.c b/gcc/f/bad.c index cca52f39957..3cd40ad8a9d 100644 --- a/gcc/f/bad.c +++ b/gcc/f/bad.c @@ -421,8 +421,8 @@ ffebad_finish () /* the trailing space on the <file>:<line>: line fools emacs19 compilation mode into finding the report */ - "%s:%" ffewhereLineNumber_f "u: %s", - fn, rn, + "g77:%s:%" ffewhereLineNumber_f "uc%u: %s", + fn, rn, cn, #endif s); last_line_num = ln; diff --git a/gcc/f/lex.c b/gcc/f/lex.c index acfde099787..70e89f38a88 100644 --- a/gcc/f/lex.c +++ b/gcc/f/lex.c @@ -2248,30 +2248,74 @@ ffelex_run (ffewhereFile wf, FILE *f, int free_form, int is_vxt, /* Begin multi-character lexeme. Its type is already in `type'. */ if (! text) { - ~~~~Make room for more text. + /* ~~~~Make room for more text. */ + text_end_ptr = &text->ffelex_text_p_[text_size]; } lexeme->u.text = text; lexeme->u.type = type; lexeme->spaced = spaced; ptr = &text->ffelex_text_p_[0]; - *ptr = (char) c; + *ptr++ = (char) c; c = GETC (); - while ((c >= '0' && c <= '9') - || ((type == 'A') - && ((c >= 'A' && c <= 'Z') - || (c >= 'a' && c <= 'z') - || (c == '_') - || (c == dollar)))) + for (;;) { - *ptr = (char) c; - ++wc; - c = GETC (); + /* Read first contiguous "slug" of text. */ + while ((c >= '0' && c <= '9') + || ((type == 'A') + && ((c >= 'A' && c <= 'Z') + || (c >= 'a' && c <= 'z') + || (c == '_') + || (c == dollar)))) + { + if (ptr == text_end_ptr) + { + /* Make more room for text. */ + notyet (); + } + *ptr++ = (char) c; + ++wc; + c = GETC (); + } + + if (c == ' ') + ++wc; + else if (c == '\t') + wc = ffelex_next_tabstop_ (wc); + else + break; + + /* We stopped due to whitespace. Get past that. */ + for (c = GETC (); + ; + c = GETC ()) + { + if (c == ' ') + ++wc; + else if (c == '\t') + wc = ffelex_next_tabstop_ (wc); + else + break; + } + + /* Is this another "slug" of the same kind of text? */ + if ((c >= '0' && c <= '9') + || ((type == 'A') + && ((c >= 'A' && c <= 'Z') + || (c >= 'a' && c <= 'z') + || (c == '_') + || (c == dollar)))) + { + /* Yes, so we must create a new chunk of tracking info + for it. */ + notyet (); + } + else + { + done = 1; + break; + } } - if (c == ' ') - ++wc; - else if (c == '\t') - ~~~~~ } else if (c == '!') { |