Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Question on <newline> A.1.4

Question on <newline> A.1.4 17 Jan 2003 19:01 #6357

Hi,

Clause A.1.4 Comments
"Line comments shall be opened by the symbol pair // and closed by a <newline>."

Because <newline> is nowhere defined in the standard, I assume it is way of going to the new line (starting new line) depending on the preferred settings of the current system ?
I mean:
CR/LF "\r\n" in DOS/Windows
LF "\n" in Unix/Mac OS X
CR "\r" in Mac Classic
The second assumption is possibility of every tool of internal conversion from any of the above variant to the other.
The last question is if the tools should accept files with line terminations in mixed-mode. Should all versions be accepted?

I raise this problem because even in a stable programming environments in a high versions /e.g. Borland Delphi 7.0/ errors are found. Unexpected/wrong line termination leads to wrong tokenizer work and as a result a parser error may be indicated in a completely different place. The issue with Borland Delphi 7.0 was taken from Borland discussion list from about 09.2002.
This is code invisible for the user but leading to error:
//comment$0d$09$20more... but not $0d$0a <-- error
//comment$0d$20$20$20and something more <-- error
//comment$0d$0a$20$20and something more without error

This may be a reason for unexpected errors in the future, when source file created using one operating system is then processed on a different system. It will be easier to know, what we should expect after loading the file: original linebreaks, converted linebreaks for target operating system or even lines terminated in different ways.

BR,
Mariusz Kupiec
The administrator has disabled public write access.
  • Page:
  • 1

FacebookTwitterGoogle BookmarksRedditNewsvineTechnoratiLinkedin