bmx-ng / bcc

A next-generation bcc parser for BlitzMax
zlib License
33 stars 13 forks source link

Inline-C: inline c on last line misses semicolon (with no newline at end) #615

Open GWRon opened 1 year ago

GWRon commented 1 year ago
SuperStrict
Framework Brl.StandardIO

'!printf("hello");
    'what?
'!printf("I said hello");
'remove the comment to make it break

Remove the last line comment and the generated code becomes:

...
        #line 4 "/home/ronny/Arbeit/Tools/BlitzMaxNG/tmp/untitled1.bmx"
        printf("hello");
        #line 6 "/home/ronny/Arbeit/Tools/BlitzMaxNG/tmp/untitled1.bmx"
        printf("I said hello")
        return 0;
...

It misses to add the ";" to the second printf;

It might indicate a bug when reading "comments" (until EOF is reached)

GWRon commented 1 year ago

Yeah ... if you add a "newline" after the inline comment it runs flawless, but moving the cursor right behind the ";" of the second printf ... it fails

SuperStrict
Framework Brl.StandardIO

'!printf("hello");
    'what?
'!printf("I said hello");| <--- cursor here!