I am recreating an ancient adventure game in Inform6 so that it can be easily played on modern platforms. My aim is to recreate not just the plot/puzzles but also the parser. Also, the game is not in English so I don't expect the standard library to be that useful anyway.
By copy-pasting relevant-looking bits from the standard Inform6 library, I was able to get parsing working for the very simplistic model that I plan to support: because I only have verb, verb noun and verb noun1 noun2 rules anyway, I thought I'd skip implementing pattern matching for proper grammar rules, and just key everything to the verbs only; e.g.
Verb 'x' 'examine' * -> Examine;
[ExamineSub;
! just error out if noun1 is not set
];
This works good enough: I can get the actions from the grammar table and then run them by looking up the corresponding callback function from #actions_table
. However, I must be missing something because I can't get the <action>
syntax working.
Below is a minimal example showing my problem:
Verb 'l' 'look' * -> Look;
[ LookSub;
"This is LookSub";
];
[ Main;
<Look>;
];
I would expect this to print
This is LookSub
when run; however, instead I am getting the following output:
Action <0 0 0>
What are my actions missing?