Discussions related to Visual Prolog
Peter Muraya
VIP Member
Posts: 147
Joined: 5 Dec 2012 7:29

Many days of grief caused by @@ in comments

Unread post by Peter Muraya »

Hi Thomas,
This sequence of characters, @@, in a comment is messing up with navigation within my code. In the following code, for example, instead of the cursor being placed at the 2 dots to report the syntax error it is placed at the end of the code. In fact any error that occurs after the @@ is never located properly. I came to this conclusion after many days of trying to figure what really is happening. What is the explanation for this behavior? Can it be stopped?

Code: Select all

implement main      clauses           run() :-                /*                This sequence of characters, @@, in a comment is causing harvoc. For all syntax errors                after this comment, the cursor will point at the end of the file. This has caused me many                days of grief. What is the reason for this behaviour?*/                stdio::write(1)..   end implement main   goal     console::runUtf8(main::run).
Mutall Data Management Technical Support
User avatar
Thomas Linder Puls
VIP Member
Posts: 1398
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls »

I have not been able to reproduce the problem. Which version do you use?

What do you mean by "at the end of the code" (do you mean after the last line in the file)?

You should notice that TAB characters can cause confusing problems. The IDE eliminates all TAB characters when saving a file, so once the IDE has saved a file all TAB character related problems will disappear.
Regards Thomas Linder Puls
PDC
Harrison Pratt
VIP Member
Posts: 439
Joined: 5 Nov 2000 0:01

Unread post by Harrison Pratt »

I can recreate that behavior caused by "@@" in a multi-line comment, but it is inconsistent. I suspect that it relates to having more than 1 multi-line comment since the erroneous syntax error follows a multi-line comment after other predicates which compile normally. If I insert "@@@" instead of "@@" the code compiles without complaint.

I haven't taken time to fully probe the misbehavior, but it is there in VP 7501.
Peter Muraya
VIP Member
Posts: 147
Joined: 5 Dec 2012 7:29

Unread post by Peter Muraya »

Thomas,

I'm am using build VP 7501

And yes, I mean, the cursor is placed at the end of the last line in the file.

Harrison is right, it is a multi-line comment problem; the single line comment does not have this issue.
Mutall Data Management Technical Support
Harrison Pratt
VIP Member
Posts: 439
Joined: 5 Nov 2000 0:01

Re:

Unread post by Harrison Pratt »

In my quick test, the cursor ends up at the start of a segment of valid code following a subsequent multi-line comment without "@@" in it. The cursor does not go to the end of the file in ths case.

I then tested this in a tiny class but couldn't reproduce the anomalous behavior.

Peter Muraya wrote:Thomas,

I'm am using build VP 7501

And yes, I mean, the cursor is placed at the end of the last line in the file.

Harrison is right, it is a multi-line comment problem; the single line comment does not have this issue.
Peter Muraya
VIP Member
Posts: 147
Joined: 5 Dec 2012 7:29

Unread post by Peter Muraya »

Harrison,
In my case, for large or small classes, the cursor is always placed at the end of the last line in the file for any syntax error after the @@. Syntax errors before the @@ are properly located. Can you share the tiny class you tested?
Mutall Data Management Technical Support
User avatar
Thomas Linder Puls
VIP Member
Posts: 1398
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls »

OK, I have reproduced the problem also. We will look at it.
Regards Thomas Linder Puls
PDC
User avatar
Thomas Linder Puls
VIP Member
Posts: 1398
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls »

This fixed in build 7502.
Regards Thomas Linder Puls
PDC
Post Reply