-
Notifications
You must be signed in to change notification settings - Fork 40
Description
The compiler accepts arbitrary expressions for attributes in the give statement. However, it sometimes produces an invalid story file in that case, without emitting an error or a warning.
For example, the following works, giving the attribute with ID 2 to the room:
Attribute locked;
Object obj;
[ Main;
print "Give bug^";
give obj 1 + 1;
];
(Compiled with inform6 -~S~D -c test.inf)
However, if we replace 1 + 1 with a parenthesised expression such as (1 + 1) or even (locked), Quixe will show this error message when running the story : "Error: Unknown opcode #0 at pc=201". Gargoyle (git) also complains with a different error message: "Fatal error: too many (48) locals at 0x14 (pc = 0x512)".
On one hand, that situation shouldn't happen often since authors aren't likely to use expression in that place. On the other hand, the compiler should never produce an invalid file without complaining.
I'm not sure if accepting arbitrary expressions in that place is a good idea since it leads to ambiguous syntax. But I'm not really sure what should be done.