Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
comment bug?
#1
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
ith best regards, Andrew Shelkovenko.
http://www.wildgardenseed.com/RQDP/FreeBasic/index.html - FreeBasic documentation Project
Reply
#2
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?
color=blue]subxero - admin at this place.[/color]
Reply
#3
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: '_'
ith best regards, Andrew Shelkovenko.
http://www.wildgardenseed.com/RQDP/FreeBasic/index.html - FreeBasic documentation Project
Reply
#4
most likely a glitch in one of the parsers or tokenizer
Reply
#5
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.
ature has its way of warning a person away from danger: The distinct black and white coloration on a skunk, the chilling buzz of a rattlesanke, a redneck handing you his beer and saying "Watch this!"
Reply
#6
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..
Reply
#7
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.
ith best regards, Andrew Shelkovenko.
http://www.wildgardenseed.com/RQDP/FreeBasic/index.html - FreeBasic documentation Project
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)