I7 parser errors: what parts *did* the parser understand?

I started playing around with this way back when I read this thread, then stopped, then found the file again tonight, and wasn’t sure if I was going to have time to get back to it any time soon, so I thought I’d post my early experiment here for posterity.

"showverb test"

Stage is a room.

Include Text Capture by Eric Eve.

After printing a parser error: now VerbToExplain is true.

VerbToExplain is a truth state that varies.

For reading a command when VerbToExplain is true:
	now VerbToExplain is false;
	replace the player's command with "showverb [word number 1 in the player's command]".

VerbExplaining is an action out of world applying to nothing. 

To verb-explain: (- ShowVerbSub(); -).

Include (-

[ ShowVerbSub address lines meta i x;
	wn = 2; x = NextWordStopped();
	if (x == 0 || ((x->#dict_par1) & 1) == 0)
		"Try typing ~showverb~ and then the name of a verb.";
	meta = ((x->#dict_par1) & 2)/2;
	i = DictionaryWordToVerbNum(x);
	address = VM_CommandTableAddress(i);
	lines = address->0;
	address++;
	print "Here are all the ways I know how to use the verb ";
	!if (meta) print "meta ";
	VM_PrintCommandWords_spec(i);
	new_line;
	if (lines == 0) "has no grammar lines.";
	for (: lines>0 : lines-- ) {
		address = UnpackGrammarLine(address);
		print "	"; DebugGrammarLine(x); new_line;
	}
	ParaContent();
];
[ DebugGrammarLine vb pcount;
	print "    >`", (address) vb, "` ";
	for (: line_token-->pcount ~= ENDIT_TOKEN : pcount++) {
		if ((line_token-->pcount)->0 & $10) print "/";
		print "", (DebugToken) line_token-->pcount, "";
	}
	print "  --> to ", (DebugAction) action_to_be;
	if (action_reversed) print "";
];

[ DebugToken token;
	AnalyseToken(token);
	switch (found_ttype) {
	ILLEGAL_TT:
		print "<illegal token number ", token, ">";
	ELEMENTARY_TT:
		switch (found_tdata) {
		NOUN_TOKEN: print "{something} ";
		HELD_TOKEN: print "{something held} ";
		MULTI_TOKEN: print "{something} ";
		MULTIHELD_TOKEN: print "{something held} ";
		MULTIEXCEPT_TOKEN: print "{something} ";
		MULTIINSIDE_TOKEN: print "{something inside another thing} ";
		CREATURE_TOKEN: print "{someone} ";
		SPECIAL_TOKEN: print "{special} ";
		NUMBER_TOKEN: print "{a number} ";
		TOPIC_TOKEN: print "{any text} ";
		ENDIT_TOKEN: print "{END} ";
		}
	PREPOSITION_TT:
		print "", (address) found_tdata, "";
	ROUTINE_FILTER_TT:
		print "noun=Routine(", found_tdata, ")";
	ATTR_FILTER_TT:
		print (DebugAttribute) found_tdata;
	SCOPE_TT:
		print "scope=Routine(", found_tdata, ")";
	GPR_TT:
		print "Routine(", found_tdata, ")";		
	}
];

[ VM_PrintCommandWords_spec i wd j dictlen entrylen ctr;
	ctr = 0;
	dictlen = #dictionary_table-->0;
	entrylen = DICT_WORD_SIZE + 7;
	for (j=0 : j<dictlen : j++) {
		wd = #dictionary_table + WORDSIZE + entrylen*j;
		if (DictionaryWordToVerbNum(wd) == i) {
			print (address) wd;
			if (ctr==0) print " (also ";
			else print ", ";
			ctr++;
		}
	}
	print ")";
];

-) instead of "Showverb Command" in "Tests.i6t".

Test me with "I want to be happy/showverb take/showverb show".

Produces output like: