diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1995-02-21 06:41:31 -0500 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1995-02-21 06:41:31 -0500 |
commit | 1f746936683604f4094bf85eabf81d802ae9dedf (patch) | |
tree | 102721a9cab2c51a91c85b31d71c58eab9b55811 /gcc/c-lex.c | |
parent | 675ecbd7188b9206d6db9f433838aa0cafffdc26 (diff) | |
download | gcc-1f746936683604f4094bf85eabf81d802ae9dedf.zip gcc-1f746936683604f4094bf85eabf81d802ae9dedf.tar.gz gcc-1f746936683604f4094bf85eabf81d802ae9dedf.tar.bz2 |
(yylex): Add support for <: :> <% %> digraphs.
From-SVN: r8982
Diffstat (limited to 'gcc/c-lex.c')
-rw-r--r-- | gcc/c-lex.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/gcc/c-lex.c b/gcc/c-lex.c index f5d3b40..75869a2 100644 --- a/gcc/c-lex.c +++ b/gcc/c-lex.c @@ -1879,6 +1879,7 @@ yylex () case '-': case '&': case '|': + case ':': case '<': case '>': case '*': @@ -1956,8 +1957,28 @@ yylex () c = RSHIFT; goto combine; } - else if ((c == '-') && (c1 == '>')) - { value = POINTSAT; goto done; } + else + switch (c) + { + case '-': + if (c1 == '>') + { value = POINTSAT; goto done; } + break; + case ':': + if (c1 == '>') + { value = ']'; goto done; } + break; + case '<': + if (c1 == '%') + { value = '{'; goto done; } + if (c1 == ':') + { value = '['; goto done; } + break; + case '%': + if (c1 == '>') + { value = '}'; goto done; } + break; + } ungetc (c1, finput); token_buffer[1] = 0; |