Packages icon indicating copy to clipboard operation
Packages copied to clipboard

[C++] Empty preprocessor line

Open calvincramer opened this issue 3 years ago • 1 comments

What happened?

Empty or null preprocessor lines (a single '#' and a newline) are not highlighted like 'normal' preprocessor lines. This shocked me, since I didn't even know null preprocessor lines were legal. But they are.

Example from boost;

#ifndef BOOST_CONFIG_HPP
#  include <boost/config.hpp>
#endif
#                         <------------ this line will not be colored like the rest of the preprocessor directives
#if defined(BOOST_HAS_PRAGMA_ONCE)
#  pragma once
#endif

Expected to have the pound sign / hashtag / octothorpe to be highlighted as the start of a preprocessor directive.

calvincramer avatar Jan 31 '22 23:01 calvincramer

Expected to have the pound sign / hashtag / octothorpe to be highlighted as the start of a preprocessor directive.

Agree. What's the point of the C preprocessor's Null directive?

jfcherng avatar Feb 01 '22 10:02 jfcherng