[preprocessor] Reimplement directives-only, add raw literal support

Nathan Sidwell nathan@acm.org
Fri May 8 18:16:32 GMT 2020


On the modules branch I was forced to fiddle with directives-only 
processing.  I reimplemented it.

The existing directives-only code (a) punched a hole through the libcpp 
interface and (b) didn't support raw string literals.  This reimplements 
this preprocessing mode.  I added a proper callback interface, and 
adjusted c-ppoutput to use it.  Sadly I cannot get rid of the 
libcpp/internal.h include for unrelated reasons.

The new scanner is in lex.c, and works doing some backwards scanning 
when it finds a character of interest.  This reduces the number of cases 
one has to deal with in forward scanning.  It may have different failure 
mode than forward scanning on bad tokenization.

Finally, Moved some cpp tests from the c-specific dg.gcc/cpp directory 
to the c-c++-common/cpp shared directory,

pushed to master.

nathan
-- 
Nathan Sidwell
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dir-only.diff
Type: text/x-patch
Size: 31821 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20200508/eceac567/attachment-0001.bin>


More information about the Gcc-patches mailing list