NFO lexer and basic parser
I created an NFO lexer, and also a very basic parser(parses into objects with an array of tokens starting with the , * or sprite name)
#1 Updated by Alberth over 9 years ago
Patch seems to miss handling of SPRITENAME. Updating the patch as below seems to do the trick.
@@ -59,7 +63,7 @@ result =  cursprite = NFOSprite() for token in self.lexer: - if token.type == 'STAR' or token.type == 'DOUBLESTAR' or token.type == 'SOUNDNAME': + if token.type == 'STAR' or token.type == 'DOUBLESTAR' or token.type == 'SOUNDNAME' or token.type == 'SPRITENAME': cursprite.pop() result.append(cursprite) cursprite = NFOSprite()I ran a test with a single NFO file, and that seems to work at first glance, except the data in the sprites is not interpreted.
(but that seems like a next step to me.)