Patch to add digraphs to cpplib
Zack Weinberg
weinberg@cygnus.com
Tue Apr 11 10:10:00 GMT 2000
On Mon, Apr 10, 2000 at 05:44:05PM -0700, Jason Merrill wrote:
> OK?
>
> 2000-04-10 Jason Merrill <jason@casey.cygnus.com>
>
> * cpplex.c (_cpp_lex_token): Handle digraphs.
I have not actually tried this, but it looks to me like it would
convert e.g. <% to { when it first encounters it. I believe this is
incorrect. C99 6.4.6.3 says:
In all aspects of the language, the six tokens [digraph list]
behave, respectively, the same as the six tokens [equivalence list]
except for their spelling.*
* Thus [ and <: behave differently when "stringized" (see 6.10.3.2)
but can otherwise be freely interchanged.
So digraph handling needs to recognize each as equivalent to its
replacement, but preserve the original text of the token in the
output.
zw
More information about the Gcc-patches
mailing list