]> git.xonotic.org Git - xonotic/gmqcc.git/commit
Don't emit whitespace when stringifying TOKEN_WHITE.
authorDale Weiler <weilercdale@gmail.com>
Fri, 7 Nov 2014 07:01:17 +0000 (02:01 -0500)
committerDale Weiler <weilercdale@gmail.com>
Fri, 7 Nov 2014 07:01:17 +0000 (02:01 -0500)
commit103e549615ffe6bcc31e8fc0ca888a55e21681d8
tree3540f151e80cd18e17b41589b1b79d20177c7e82
parentab841b94f7f4bdea8630a58940c5e007725afe80
Don't emit whitespace when stringifying TOKEN_WHITE.
Other aspects of the preprocessor already skip whitespace leading up to a token. The only situation in which a TOKEN_WHITE can
exist as part of the token stream during stringification, is when the whitespace is trailing after a token. This is situation is
really only possible in the context of a macro argument. This behaviour is inconsistent.

Consider the following
FOO( space_before)
FOO(space_after )

The former will reduce to "space_before" since the preprocessor will skip whitespace leading up to the token `space_before', while
the latter will reduce to "space_after ".

The C preprocessor doesn't preserve whitespace, so we won't either. This doesn't break any existing code.
ftepp.c