Expand description
C and C++ minifier.
Distinguishing features:
- Preprocessor directives (
#include,#define, …) are line-sensitive — the C preprocessor reads input line-by-line and directives must end at a newline (or be continued via\<nl>). We tokenize each#-line as a singlePreproctoken and the emitter places it on its own line. - String prefixes:
L"…",u8"…",u"…",U"…"(wide / UTF literals). - C++ raw strings
R"delim(…)delim"(and prefixed forms likeLR"delim(…)delim",u8R"…", etc.) — only whenis_cppis true. - Block comments do not nest.
Strategy: aggressive (Strategy A) between preprocessor lines.
Around #-lines we still emit a leading and trailing newline.
is_cpp toggles the C++-only features (raw strings). For C tags
(c, h) it’s false; for C++ tags (cpp, c++, cc, cxx,
hpp, hxx) it’s true.