I've proposed adding raw string literals to C++. See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2053.html

The C++ committee's reaction was favorable, although the specifics of the delimiter syntax may change a bit. (Committee members find the R prefix ugly, but no one has come up with a cleaner alternative. There is also a request to allow multi-character delimiters.)

I've done a partial implementation in GCC, and will be happy to contribute it should the final raw string literal proposal be accepted for C++0x. Not implemented yet are raw string literals with embedded newlines. For example:

  char * foo = R"*abc
  def*";
  assert( strcmp(foo, "abc\ndef") == 0 ); // should succeed

So far, the changes to accommodate raw string literals have only touched libcpp/charset.c and libcpp/lex.c, particularly lex.c's lex_string() function. My initial thought is to also handle embedded newlines within lex_string(), but before attempting that approach I'd like advice from GCC maintainers familiar with GCC's lexical processing.

Who maintains libcpp/lex.c? What is the best way to proceed?

Thanks,

--Beman Dawes


Reply via email to