Inform 7 Home Page / Documentation


§17.13. New tokens

We have now made good use of square-bracketed tokens, such as "[something]", in a variety of "Understand..." sentences. It is sometimes convenient to create new tokens of our own, to match whatever grammar we choose: this enables complicated knots of grammar to be used in many different "Understand..." sentences without having to write it all out each time.

For instance, here are new tokens: one for each of two groups of alternative prepositions.

Understand "beneath/under/by/near/beside/alongside/against" or "next to" or "in front of" as "[beside]".

Understand "on/in/inside" or "on top of" as "[within]".

Again, note that the slash indicates a choice between words only, not between entire phrases. For instance, if we write:

Understand "red bird/robin" as "[robin]".

then the two alternative forms are "red bird" and "red robin", not "red bird" and "robin". By contrast,

Understand "red bird" or "robin" as "[robin]".

will understand either "red bird" or "robin" but not "red robin". If we want to capture all three forms, we might define

Understand "red bird/robin" or "robin" as "[robin]".


arrow-up.png Start of Chapter 17: Understanding
arrow-left.png Back to §17.12. This/that
arrow-right.png Onward to §17.14. Tokens can produce values

*ExampleLies
Commands to allow the player to lie down in three different ways.