FireEmblemUniverse / ColorzCore

A rewriting of Core.exe for EA.
GNU General Public License v3.0
7 stars 7 forks source link

Bugfig: Error in lexing #10

Closed Crazycolorz5 closed 5 years ago

Crazycolorz5 commented 6 years ago

// simple ignores the rest of the lane so the following code which should be valid isn't:

/ // /

StanHash commented 6 years ago

Can't reproduce? The code you gave seems already valid? Am I missing something?


/*
MESSAGE inside
// */ MESSAGE outside
MESSAGE after
In File Main.event, Line 3, Column 7: outside 
In File Main.event, Line 4, Column 1: after 

//*
MESSAGE inside
// */ MESSAGE outside
MESSAGE after
In File Main.event, Line 2, Column 1: inside 
In File Main.event, Line 4, Column 1: after 
Crazycolorz5 commented 6 years ago

Sorry, I think it'd be

// /* comment
*/

that should error

Edit: I think this is invalid C anyway -- how does original NL Core handle this case?

StanHash commented 6 years ago
// /* comment
*/

in NL!Core:

1 errors encountered:
File: Main.event, Line: 2: Error removing comments

It breaks.

(and yes this is also invalid in C (see this ISO C99 standard pdf (6.4.9) which implies that comment delimiters are only to be considered as such when they aren't already within a comment (and other stuff))).