- fixed some issues with the grammar for parsing states:

* Goto did not support the class scope operator '::'. Like in DECORATE, this cannot be done with a simple '.' because it creates semantic problems with first part of a state label. This requires different syntax so that it can unambiguously distinguish between a scope identifier and the actual label
 * Goto used the incorrect token PLUS for '+' instead of ADD.
 * The state's duration was not stored in the AST.
 * Truncating the sprite name inside the parser is probably not the best idea because it used a simple Printf to report this. Let's do this during processing of the AST where this can be properly handled as an error.
This commit is contained in:
Christoph Oelckers 2016-10-12 00:04:30 +02:00
commit f46b6b5be5
3 changed files with 23 additions and 13 deletions

View file

@ -260,19 +260,21 @@ struct ZCC_Expression : ZCC_TreeNode
struct ZCC_StateGoto : ZCC_StatePart
{
ZCC_Identifier *Qualifier;
ZCC_Identifier *Label;
ZCC_Expression *Offset;
};
struct ZCC_StateLine : ZCC_StatePart
{
char Sprite[4];
FString *Sprite;
BITFIELD bBright : 1;
BITFIELD bFast : 1;
BITFIELD bSlow : 1;
BITFIELD bNoDelay : 1;
BITFIELD bCanRaise : 1;
FString *Frames;
ZCC_Expression *Duration;
ZCC_Expression *Offset;
ZCC_TreeNode *Action;
};