Parser problem - C-like and normal comments interfere badly
issueid=301 12-08-2011 18:54
Super Moderator
Number of reported issues by Petr Schreiber: 132
Parser problem - C-like and normal comments interfere badly
In ThinBASIC 1.8.8.0, if the text between /* */ contains ' it can produce unexpected results

Hi Eros,

this problem resisted my investigation for 7 days, until now, ho hoo :)

Try to execute this code in ThinBASIC 1.8.8.0:
Uses "Console"

/* Read the kernel's output */     
PrintL "A"

/* This comment is okay */
PrintL "B"

WaitKey
The output on the screen should be:
A
B
... but you will get only:
B
Why? Because the text between /* */ contains ' character in word kernel's. This makes the /* */ matchin confused and in fact has this effect:
Uses "Console"

/* Read the kernel's output */
PrintL "A"

/* This comment is okay
*/
PrintL "B"

WaitKey
so the Printl "A" gets completely ignored.

This is quite unpleasant, as it can lead to very strange situations.


Petr
Issue Details
Issue Number 301
Project thinBasic
Category Core engine (thinCore.dll)
Status Fixed
Priority 1 - Highest
Affected Version 1.8.8
Fixed Version 1.8.9
Milestone thinBasic 1.8.9.0
Users able to reproduce bug 0
Users unable to reproduce bug 0
Assigned Users (none)
Tags (none)




13-08-2011 09:45
thinBasic author
I think I forgot to set a status flag in order to avoid each other comment type interferences.I will try to fix ASAP

21-08-2011 17:13
thinBasic author
This seems to be solved.
Fix will be present in next release.

If you have any further weird example of weird nested type of comments, let me know and I will use for further testing.

+ Reply