compiler parser bug
BlitzMax Forums/BlitzMax Programming/compiler parser bug
| ||
Rem Print "something" don't tell me this is working weird End Rem Print "hello" the word hello is never printed. the REM block is not closed becouse BlitzMax compiler treates the ' char inside multiline comments, as single line comments!!!! |
| ||
The problem happens because End Rem is not at the beginning on its own line. |
| ||
Edit: I see multiline comments have to be at th starting of a line... weird... ok, I have to change the BLIde hilightingroutines... |
| ||
Ideally the compiler should puke on that and complain that you didn't close your REM block though... |
| ||
definitively it SHOULD tell you you have an open REM block, exactly in the same way it tells you yo have any other block open (While / Wend, For / Next, ect...) |
| ||
In BlitzMax you don't need to close rem-blocks, they're automatically closed at eof. If the compiler complained about this, it would extremely hurt downward compatibilities - the following is and should be in the future valid BMX-code:Print "Line1" Print "Line2" Rem Print "This is remed out" |
| ||
@Fabien: why? why should REM blocks work different from any other BitzMax Block? |
| ||
That absolutely should throw an error, Fabian. Extending REM blocks across multiple files is all but useless except for the most bizarre edge cases imaginable. I would think that would cause more errors than it fixes. "Why isn't it compiling this code!? Oh ... the previously included file had an open REM block. There's an hour of my life down the drain." |
| ||
why? why should REM blocks work different from any other BitzMax Block? I know that it looks a bit inconsistently that rem differs from the other enclosing commands in BMX, however, comments should be treated differently since the characters they enclose are in contrast to the other block statements not compiled but are completely ignored. Therefore you can't interleave them:Rem Rem EndRem EndRemdoesn't work, so it makes no sense to expect from Rem/EndRem to work exactly the same like the others (While/EndWhile, Select/EndSelect....). So it wouldn't hurt any principles of BMX to let this behaviour as it is currently. Why isn't it compiling this code!? Oh ... the previously included file had an open REM block. There's an hour of my life down the drain Try this:file1.bmx: Strict Framework brl.blitz Include "file2.bmx" WriteStdout "This gets printed, and that's the correct behaviour!~n"file2.bmx: RemAll comment blocks are closed at eof (singleline as well as multiline) |
| ||
@Fabian: Of course you can't. that's not the point. I don't know of any other programing language that lets you leave opened comment blocks without throwing, at least, a warning. |