Page 1 of 1

PrivateSection/EndPrivateSection

Posted: Thu Jul 04, 2013 12:52 am
by Josh
Don't panic, it's not a further wish for Private keyword in modules :mrgreen:

I'm using a preprocessor. For this I write some own commands, which are interpreted by the preprocessor. This own commands can be placed on different positions in the code. For example, I'm writing the following code and my preprocessor makes a complete interface and the vtable from this and write the code into an pbi file:

Code: Select all

  Interface ISCE_SITE
    QueryInterface      (@SCE_Site_QueryInterface)
    AddRef              (@SCE_Site_AddRef)
    Release             (@SCE_Site_Release)
    GetLCID             (@SCE_Site_GetLCID)
    GetItemInfo         (@SCE_Site_GetItemInfo)
    GetDocVersionString (@SCE_Site_GetDocVersionString)
    OnScriptTerminate   (@SCE_Site_OnScriptTerminate)
    OnStateChange       (@SCE_Site_OnStateChange)
    OnScriptError       (@SCE_Site_OnScriptError)
    OnEnterScript       (@SCE_Site_OnEnterScript)
    OnLeaveScript       (@SCE_Site_OnLeaveScript)
  EndInterface
Inside this sections the compiler should ignore absolutly all (also compilerIf's). In best case, the content of this sections should be ignored for autocomplete too.

At the moment I have bedded this commands between CompilerIf / CompilerendIf. To find this with my preprocessor, I have to use the additional commands PrivatSection / EndPrivateSection inside the compilerif. Unfortunately it's not possible to use PrivatSection / EndPrivatSection and change this to CompilerIf's by macro. So I'm asking, is it possible to get this native.

Thxs
Josh

Re: PrivateSection/EndPrivateSection

Posted: Thu Jul 04, 2013 6:32 am
by Little John
A preprocessor can just remove all lines between PrivateSection and EndPrivateSection from the source code, before passing it to the compiler.

Re: PrivateSection/EndPrivateSection

Posted: Thu Jul 04, 2013 6:47 am
by Josh
Little John wrote:A preprocessor can just remove all lines between PrivateSection and EndPrivateSection from the source code, before passing it to the compiler.
My preprocessor writes the created code in a special pbi file, which is included at the start of my project.

Changing the original codes is no good solution. This makes only troubles, if your project has more then one file.

Re: PrivateSection/EndPrivateSection

Posted: Fri Jul 05, 2013 10:38 pm
by idle
+1 on defining keywords

define EndPrivateSection = EndCompilerIF
or like fasm's fix
fix EndPrivateSection = EndCompilerIF