473,473 Members | 1,520 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Collapse of whitespace by preprocessor

Hello,

Does anybody know where in the standard it allows the preprocessed
file to have whitespace removed/collapsed?

I found the following in 16.1:

"The source text is decomposed into preprocessing tokens and sequences
of white space. A single white space replaces each comment."

Is it the fact that it doesn't say that the sequences of whitespace
between tokens must be preserved?

Thanks.

--Kaleb
Feb 14 '08 #1
2 1801
Kaleb Pederson wrote:
Does anybody know where in the standard it allows the preprocessed
file to have whitespace removed/collapsed?
It's implementation-defined. See [lex.phases]/3.
I found the following in 16.1:

"The source text is decomposed into preprocessing tokens and sequences
of white space. A single white space replaces each comment."

Is it the fact that it doesn't say that the sequences of whitespace
between tokens must be preserved?
Yes, it is the fact. The Standard does not require preserving the
sequences of white-space characters.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Feb 14 '08 #2
On Feb 14, 6:50 am, "Victor Bazarov" <v.Abaza...@comAcast.netwrote:
Kaleb Pederson wrote:
Does anybody know where in the standard it allows the preprocessed
file to have whitespace removed/collapsed?

It's implementation-defined. See [lex.phases]/3.
Ahh, very nice. It's much more clearly defined there. For other
interested parties, it reads:

"Whether each nonempty sequence of whitespace characters other than
new-line is retained or replaced by one space character is
implementation defined."

Thanks.

--Kaleb
Feb 14 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Daniel Cazzulino [MVP XML] | last post by:
Hi guys, I need an attribute (could be an element too) to have its whitespace collapsed . I don't get the expected behavior, however. The schema is as follows: <xs:schema ...> <xs:element...
9
by: Walter Roberson | last post by:
I have run into a peculiarity with SGI's C compiler (7.3.1.2m). I have been reading carefully over the ANSI X3.159-1989 specification, but I cannot seem to find a justification for the behaviour....
3
by: Wessi | last post by:
Hi, token pasting means, that normally whitespaces and comments are deleted before and after the ## operator. I want the preprocessor to hold an existing whitespace while replacing the argument...
44
by: Joe | last post by:
Is Python going to support s syntax the does not use it's infamous whitespace rules? I recall reading that Python might include such a feature. Or, maybe just a brace-to-indentation preprocessor...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.