This has left me baffled for the last 3 hours.
When working on a script, usually I write comments after a certain command to remind me of why said command is/is not needed, like
If "string" ##_ some comment
(...)
Endif ##_ (If "string")
and have done so for several years.
Today I came across this error

on a script where I have verified, checked and double-checked that the syntax is correct.
After 2 hours of troubleshooting, I boiled down a test script to these lines:
# Test script
[Name]=
[BasedOn]=www.google.com
[IndexUrl]=http://www.google.com
[AlbumUrl]=
[SearchBy]=Query:||string||%s
[WordSeparator]=
[IndexFormat]=
[Encoding]=
[ParserScriptIndex]=...
If ""
Endif ##_ some comment ##
[ParserScriptAlbum]=...
This returns the same error.
By removing the comment in the EndIf command, the script now runs (it won't do much, but it won't return a error).
But since I have been adding comments in my coding for years, this didn't made sense.
What I learned after (more) testing out was that this script
# Test script
[Name]=
[BasedOn]=www.google.com
[IndexUrl]=http://www.google.com
[AlbumUrl]=
[SearchBy]=Query:||string||%s
[WordSeparator]=
[IndexFormat]=
[Encoding]=
[ParserScriptIndex]=...
If ""
Endif ##_ some comment ##
# <-- just add this comment mark
[ParserScriptAlbum]=...
will run. And the only difference is the presence of a comment mark # after Endif.
After some more tests I came up with the hypothesis that the last line in a [Parser...] block must not be a command with a comment, or that command will not run. Having a command without comments or a comment after the last commented command will escape this behavior.
Can someone reproduce this and validate my theory?
Is this a bug?



