It is currently Wed Jan 27, 2021 5:57 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: CompilerIf causes problems with IDE struct parsing
PostPosted: Sun Nov 22, 2015 1:21 am 
Offline
Addict
Addict

Joined: Sat Jun 30, 2007 8:04 pm
Posts: 3371
Code:
CompilerIf #PB_Processor_x64
Structure SomeStructA Align 4
CompilerElse
Structure SomeStructA
CompilerEndIf
  a.i
  b.i
  c.i
EndStructure

Structure SomeStructB
  d.SomeStructA
EndStructure

*This1.SomeStructA
*This2.SomeStructB

*This1\ <- autocomplete is wrong
*This2\ <- autocomplete is wrong


Yes, I can write the structure twice but this is code duplication and causes problems if I make a mistake and they go out of sync. Then if I look at it later I may not remember which is the most recent version.


Top
 Profile  
Reply with quote  
 Post subject: Re: CompilerIf causes problems with IDE struct parsing
PostPosted: Sun Nov 22, 2015 1:44 am 
Offline
Enthusiast
Enthusiast

Joined: Mon Feb 04, 2013 5:28 pm
Posts: 334
The problem is most things after Structure become a field to the autocomplete, which is confused not finding a simple Structure EndStructure sequence.

Even doing this does not solve the problem

Code:
CompilerIf #PB_Processor_x64
Macro AlignArch
Align 4
EndMacro
CompilerElse
Macro AlignArch
EndMacro
CompilerEndIf

Structure SomeStructA AlignArch
  a.i
  b.i
  c.i
EndStructure

Structure SomeStructB
  d.SomeStructA
EndStructure

*This1.SomeStructA
*This2.SomeStructB


Looks like it should be simple to understand, but now AlignArch becomes a field instead.

In the end the same thing reported here
viewtopic.php?f=4&t=59911

Even assuming this specific case can be solved in some other way, in general when you start splitting multiline entities into conditional branches, autocomplete gives up.


Top
 Profile  
Reply with quote  
 Post subject: Re: CompilerIf causes problems with IDE struct parsing
PostPosted: Fri Jan 29, 2016 2:12 pm 
Offline
Administrator
Administrator

Joined: Fri May 17, 2002 4:39 pm
Posts: 14181
Location: France
The IDE can't resolve the CompilerIf (it's , so you will have to write it differently if you want the IDE to behave correctly.


Top
 Profile  
Reply with quote  
 Post subject: Re: CompilerIf causes problems with IDE struct parsing
PostPosted: Sat Jan 30, 2016 9:16 am 
Offline
PureBasic Bullfrog
PureBasic Bullfrog
User avatar

Joined: Wed Jul 06, 2005 5:42 am
Posts: 8149
Location: Fort Nelson, BC, Canada
Fred wrote:
( it's , so you will have to write it differently..[] )
Sorry, it's... Good? Bad? Tuesday? Raining? Almost time?

Wait, I know! It's in Russian and you can't pronounce it! :D

_________________
BERISHEET


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye