Old 12-27-2023, 02:38 PM   #1
Fabian
Human being with feelings
 
Fabian's Avatar
 
Join Date: Sep 2008
Location: Sweden
Posts: 7,432
Default IDE does not show commented out @gfx as comment...

I felt the need to comment out the whole @gfx section.

This had the unexpected effect that the IDE did not show the code as commented out:



I had to move the comment to below the @gfx clause:



I guess that this is an oversight in the IDE, since neither case shows any gfx section in the plugin.
__________________
// MVHMF
I never always did the right thing, but all I did wasn't wrong...
Fabian is offline   Reply With Quote
Old 12-27-2023, 03:11 PM   #2
Zeno
Human being with feelings
 
Zeno's Avatar
 
Join Date: Sep 2018
Location: HH
Posts: 919
Default

Quote:
Originally Posted by Fabian View Post
I felt the need to comment out the whole @gfx section.

This had the unexpected effect that the IDE did not show the code as commented out:



I had to move the comment to below the @gfx clause:



I guess that this is an oversight in the IDE, since neither case shows any gfx section in the plugin.
/* comments always end at the bottom of the section in which they were written. Quite useful actually...

If you want to comment out @gfx, then you just have to do it that way:
Code:
@gfx 400 400
/*

Last edited by Zeno; 12-27-2023 at 06:38 PM.
Zeno is offline   Reply With Quote
Old 12-28-2023, 11:00 AM   #3
Fabian
Human being with feelings
 
Fabian's Avatar
 
Join Date: Sep 2008
Location: Sweden
Posts: 7,432
Default

Quote:
Originally Posted by Zeno View Post
/* comments always end at the bottom of the section in which they were written. Quite useful actually...
I don't know about the usefulness of that... seems more like an oversight to me.

Quote:
Originally Posted by Zeno View Post
If you want to comment out @gfx, then you just have to do it that way:
Code:
@gfx 400 400
/*
Yes, as I show in the second figure.
__________________
// MVHMF
I never always did the right thing, but all I did wasn't wrong...
Fabian is offline   Reply With Quote
Old 12-28-2023, 11:29 AM   #4
Fabian
Human being with feelings
 
Fabian's Avatar
 
Join Date: Sep 2008
Location: Sweden
Posts: 7,432
Default

Quote:
Originally Posted by Zeno View Post
/* comments always end at the bottom of the section in which they were written. Quite useful actually...
Actually, no. The code is commented out in either case; no gfx window shows in the UI, so apparently the compiler generates no code for the gfx section irrespective of where the comment begins. Thus, the comment does not end at the @gfx clause, it is just that the IDE does not show the code as commented out.
__________________
// MVHMF
I never always did the right thing, but all I did wasn't wrong...
Fabian is offline   Reply With Quote
Old 12-28-2023, 01:36 PM   #5
Zeno
Human being with feelings
 
Zeno's Avatar
 
Join Date: Sep 2018
Location: HH
Posts: 919
Default

Okay, I don't know why it has an effect on your @gfx section. It shouldn't really. It should be local to @section. I use this quite often to temporarily bypass code passages. If the code passage is at the end of a section, I don't have to scroll down and close the comment at the sections end. I even use this in @init and so far the /* comment has never affected the underlying @whatever sections.
Zeno is offline   Reply With Quote
Old 12-28-2023, 04:36 PM   #6
souk21
Human being with feelings
 
souk21's Avatar
 
Join Date: Mar 2021
Posts: 482
Default

Yep, can confirm what Zeno says, I do the same
souk21 is online now   Reply With Quote
Old 12-29-2023, 01:13 PM   #7
Fabian
Human being with feelings
 
Fabian's Avatar
 
Join Date: Sep 2008
Location: Sweden
Posts: 7,432
Default

OK, I've been making new experiments, and of course you guys are right, comments do end at the next section.

But there is still something strange with these non-terminated comments in the IDE.



Here, first the entire @gfx section is commented out, and no gfx window shows in the plugin, which is fine. Then I remove the first /* and recompile, and then the code that is marked by the IDE as commented executes!

Then, when I edit the middle line, that line is shown as active code, and when compiling and running, this change has effect. So strange...
__________________
// MVHMF
I never always did the right thing, but all I did wasn't wrong...
Fabian is offline   Reply With Quote
Old 12-29-2023, 01:37 PM   #8
Zeno
Human being with feelings
 
Zeno's Avatar
 
Join Date: Sep 2018
Location: HH
Posts: 919
Default

Strange... Something like this has never happened to me.
Guess: Maybe it's because the comment starts in the @gfx line. Does this behavior persist if you move the comment to the next line?
Zeno is offline   Reply With Quote
Old 12-29-2023, 02:38 PM   #9
Fabian
Human being with feelings
 
Fabian's Avatar
 
Join Date: Sep 2008
Location: Sweden
Posts: 7,432
Default

Quote:
Originally Posted by Zeno View Post
Strange... Something like this has never happened to me.
Guess: Maybe it's because the comment starts in the @gfx line. Does this behavior persist if you move the comment to the next line?
Yes, this seems to have something to do with the comment beginning on the @gfx line. If I hit enter before /* to move the comment to the next line, I don't see that behavior. This is reproducible.
__________________
// MVHMF
I never always did the right thing, but all I did wasn't wrong...
Fabian is offline   Reply With Quote
Old 12-29-2023, 02:41 PM   #10
Zeno
Human being with feelings
 
Zeno's Avatar
 
Join Date: Sep 2018
Location: HH
Posts: 919
Default

Congratulations,
I'd say you have a serious finding for the Nitpicks/Bug Report subforum
Zeno is offline   Reply With Quote
Old 12-29-2023, 04:47 PM   #11
souk21
Human being with feelings
 
souk21's Avatar
 
Join Date: Mar 2021
Posts: 482
Default

My understanding is:
Code:
/* @gfx
It's a comment, belonging to the @section above, and it's commenting out the rest of the file.

Code:
@gfx 100 100 /* comment
It's not really a comment, and has no impact on following lines.
"@section definitions" have different rules than the code and the parser simply ignores everything it doesn't need.

And I guess the code looking like it's commented out is a bug of the syntax highlighter
souk21 is online now   Reply With Quote
Old 12-30-2023, 12:08 PM   #12
Fabian
Human being with feelings
 
Fabian's Avatar
 
Join Date: Sep 2008
Location: Sweden
Posts: 7,432
Default

Quote:
Originally Posted by souk21 View Post
My understanding is:
And I guess the code looking like it's commented out is a bug of the syntax highlighter
Ha! I knew there had to be a bug lurking there somewhere...

Quote:
Originally Posted by Zeno View Post
Congratulations,
I'd say you have a serious finding for the Nitpicks/Bug Report subforum
Ha ha ha!
Thanks.
Yeah, I guess it's best I put it there
__________________
// MVHMF
I never always did the right thing, but all I did wasn't wrong...
Fabian is offline   Reply With Quote
Old 12-31-2023, 11:06 AM   #13
whats_up
Human being with feelings
 
Join Date: Nov 2020
Posts: 186
Default

Quote:
Originally Posted by souk21 View Post

Code:
@gfx 100 100 /* comment
It's not really a comment, and has no impact on following lines.
"@section definitions" have different rules than the code and the parser simply ignores everything it doesn't need.
do you find it expected ?
(i don't.)
__________________
Easy EEL to VST Building system
https://forum.cockos.com/showthread.php?t=245285
github: https://github.com/VisualCodeBase/CodeBase
whats_up is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 07:57 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.