Qbasicnews.com

Full Version: comment bug?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi!

This code generate error
commentbug1.bas(4) : error 40: Expected 'END SUB' or 'END FUNCTION', found: 'т'

Code:
SUB bas2Html (inFile AS STRING)
'qq я  
end sub
http://www.wildgardenseed.com/RQDP/commentbug1.zip
I think it's because FBC isn't Unicode-compatible, and that Russian character (я) is only in Unicode fonts, if I'm correct. In plain ASCII, that Unicode character would appear as some two-byte string, I guess, one of which is that symbol you received as an error.

Am I somewhat close?
Quote:I think it's because FBC isn't Unicode-compatible, and that Russian character (я) is only in Unicode fonts, if I'm correct. In plain ASCII, that Unicode character would appear as some two-byte string, I guess, one of which is that symbol you received as an error.

Am I somewhat close?

No, (я) is ASCII - char$(255) (hex FF)

well
print chr$(255) 'works fine
print "яяяяя" 'works fine
'яяяяя' - cause error
chr255bug.bas(2) : error 3: Expected End-of-Line, found: '_'
most likely a glitch in one of the parsers or tokenizer
There are several keywords that have ' at the beginning:

'$DYNAMIC
'$INCLUDE
etc.

So the parser must continue to check the commented code, otherwise it could treat ' as end-of-line.

Also chr$(255) is treated as a special command for multikey processing:

chr$(255) + "X" ' user closed window

If you are trying to embed chr$(255) in your code, you are just asking for trouble, even if it comes after a comment.
There was really a problem with char 255 when used in comments, i was using an integer (instead of an unsigned one) to load the current byte, meaning 255 became -1, and -1 is "seem" as invalid char by the lex module.. it was fixed, but you can't rebuild the compiler using the old versions, due a chicken-egg problem, you will have to wait for the next release, sorry..
Quote:.. it was fixed, but you can't rebuild the compiler using the old versions, due a chicken-egg problem, you will have to wait for the next release, sorry..

Absolutely no problem!
It's for information only. If you already fix it - so much the better Big Grin
Thanks.