Page 1 of 1

Many days of grief caused by @@ in comments

Posted: 5 Nov 2015 7:13
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).

Posted: 5 Nov 2015 12:25
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.

Posted: 5 Nov 2015 14:27
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.

Posted: 5 Nov 2015 16:37
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.

Re:

Posted: 5 Nov 2015 16:59
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.

Posted: 6 Nov 2015 3:42
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?

Posted: 6 Nov 2015 8:45
by Thomas Linder Puls
OK, I have reproduced the problem also. We will look at it.

Posted: 24 Nov 2015 14:17
by Thomas Linder Puls
This fixed in build 7502.