PREV INDEX NEXT

Author: Unknown
Subject: Comments in line splicing?
Date: Tuesday, 28 Jan 2020, 22:19:37

Hello,

The specification says:
"handle both /*...*/ and //... comments correctly (e.g., they do not nest and are the equivalent of a single space character)"

I am currently trying to understand why comments should be treated as a single space character and how this makes sense given the output of the solution executable.

For example:
identif\//comment
ier;

Produces:
identif:1
ier:2

While:
identif\ 
ier;

Produces:
identifier:1

To be clear, the second case has a single space after the backslash, i.e.:
identif\[space]
ier;

So it would seem, at least in this case, that the comment is not being treated as a single space.

Can somebody explain this? If comments are not really being treated like spaces in this case, are there other places where they are?

Thanks.
PREV INDEX NEXT