Pascal syntax highlight

General questions about using ExamDiff Pro, ideas for new features, bug reports, and usage tips.
Post Reply
MSpagni
Expert Member
Posts: 642
Joined: Mon Mar 30, 2009 12:53 am
Location: Italy

Pascal syntax highlight

Post by MSpagni »

I just noted that the pascal syntax highlight interprets the backslash ('\') inside a string as an escape character like in C.
As far as I know (free pascal, turbo pascal) this is not true.
Furthermore, if the backslash is the last character before the ending "'", the string is assumed as not closed (that's how I discovered it).

Only a small glitch, but easy to fix, I think.
User avatar
psguru
Site Admin
Posts: 2396
Joined: Sat May 15, 2004 4:23 pm
Location: California
Contact:

Re: Pascal syntax highlight

Post by psguru »

Well, according to http://techpubs.sgi.com/library/tpl/cgi ... /ch01.html backslash is in fact an escape character.
psguru
PrestoSoft
MSpagni
Expert Member
Posts: 642
Joined: Mon Mar 30, 2009 12:53 am
Location: Italy

Re: Pascal syntax highlight

Post by MSpagni »

SGI Pascal has a special form of character string, enclosed in double quotation marks, in which such characters may be included. A backslash ( \ ) escape character is used to signal the use of a special character.
ANSI Pascal admits only character strings enclosed in single quotation marks and no escaping.
If you want to include a single quote inside a string you have to type it twice.
So does FreePascal, Turbo Pascal and Delphi.
User avatar
psguru
Site Admin
Posts: 2396
Joined: Sat May 15, 2004 4:23 pm
Location: California
Contact:

Re: Pascal syntax highlight

Post by psguru »

MSpagni wrote:ANSI Pascal admits only character strings enclosed in single quotation marks and no escaping.
If you want to include a single quote inside a string you have to type it twice.
So does FreePascal, Turbo Pascal and Delphi.
You're right. Thanks for the clarification. This bug will be fixed in the upcoming 5.0 beta of ExamDiff Pro.
psguru
PrestoSoft
Post Reply