Ok, I found the code I was looking for. @ChristianB originally posted this back in 2011 (which was subsequently quoted by @Draconis in '14) and @zarf posted something similar in '13. Both of these were adapted from the DM4 (p. 489). Their code adds a third noun token. I adapted it to add a second number token instead which turned out to be a little trickier than I thought it would be. It could presumably be adapted to work with user-defined KOVs, (to halfway answer the question posed by Daniel over six years ago) but this is it for now:
The Lab is a room.
Adding it to is an action applying to one number.
Include (-
Global second_number;
-) after "ICL Commands" in "Output.i6t".
The second number understood is a number that varies.
The second number understood variable translates into I6 as "second_number".
Include(-
[ SecondNum x firstnum;
firstnum = parsed_number; ! saves the first parsed number locally
x = ParseToken(ELEMENTARY_TT, NUMBER_TOKEN);
if (x == GPR_FAIL or GPR_REPARSE) return x;
second_number = parsed_number; ! saves the second parsed number into a global
parsed_number = firstnum; ! returns the first number to its usual global spot
return GPR_PREPOSITION;
];
-).
The Understand token second-number translates into I6 as "SecondNum".
Understand "add [number] to [second-number]" as adding it to.
Check adding it to:
say "adding [number understood] to [second number understood]...".
Carry out adding it to:
let total be a number;
now total is the number understood plus the second number understood;
say "total = [total]."
test me with " add 2 to 7 / add one to three / add thirteen to 75 / add 1465 to 6356".