[Gambas-user] Scripter swallows #Endif?

Fabien Bodard gambas.fr at ...626...
Sat Feb 14 23:19:26 CET 2015


Well the bug is because the gbs compiler search for the END keyword to
delimit a class or the main content.

I need to find a way to consider the #IF - #ENDIF

2015-02-14 15:31 GMT+01:00 Tobias Boege <taboege at ...626...>:
> Hi Benoit,
>
> the scripter seems to have a problem when #Endif is the last line in a
> script. This is the source code I consider:
>
>   #If True
>   Public Sub Main()
>     Print "True is true"
>   End
>   #Else
>   Public Sub Main()
>     Print "True is false"
>   End
>   #Endif
>
> If this is inside a Gambas project, it will compile and execute perfectly.
> But if this is inside a script file, I get:
>
>   $ ./endif-script.gbs3
>   MMain.module:20:2: error: Missing #Endif
>
>   # Gambas Project File 3.0
>   Title=Gambas Script
>   Startup=MMain
>
>   ' Gambas module file
>
>   #If True
>   Public Sub Main()
>     Print "True is true"
>   End
>
>   #Else
>   Public Sub Main()
>     Print "True is false"
>   End
>
>
> Indeed, the #Endif is missing in the output, but not in the sources. As you
> can see in the script I sent along with the mail about "VarPtr() on array
> syntax" a few minutes ago, this does not happen when #Endif is not the last
> line in the script. To summarise:
>
>                  |  Scripter  |  Without scripter
>   ---------------+------------+--------------------
>   Last line      |   Not OK   |         OK
>   Not last line  |     OK     |         OK
>
> Regards,
> Tobi
>
> --
> "There's an old saying: Don't change anything... ever!" -- Mr. Monk
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming. The Go Parallel Website,
> sponsored by Intel and developed in partnership with Slashdot Media, is your
> hub for all things parallel software development, from weekly thought
> leadership blogs to news, videos, case studies, tutorials and more. Take a
> look and join the conversation now. http://goparallel.sourceforge.net/
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>



-- 
Fabien Bodard




More information about the User mailing list