From 9f5f797a6adba44d357e75a007c67772ee62cf47 Mon Sep 17 00:00:00 2001 From: Alexander Yakovlev Date: Wed, 14 Aug 2019 23:54:18 +0700 Subject: [PATCH] Trying to do BeforeParsing mk 2 We can't ignore disambiguation after all. --- examine_en.h | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/examine_en.h b/examine_en.h index 8f4ea1e..b5ee800 100644 --- a/examine_en.h +++ b/examine_en.h @@ -1,21 +1,24 @@ Global thing_to_examine; -[ UnknownVerb word thing n i; +[ BeforeParsing thing n i; + if (num_words > 1) { + rfalse; + } + thing_to_examine = NextWord(); + ! Check that such thing exists in scope, so that we don't catch + ! compass directions or gibberish. objectloop ( thing provides name) { if (TestScope(thing, player)) { n = thing.#name / WORDSIZE; for(i = 0 : i < n : i++) - if (thing.&name-->i == word) { - thing_to_examine = thing; - return 'unknown'; + if (thing.&name-->i == thing_to_examine) { + ! At least one such thing exists, we can alter the input + buffer->0 = 'examine'; + buffer->1 = thing_to_examine; + Tokenise__(buffer, parse); + rtrue; } }; }; rfalse; ]; - -[ ExamineObjectSub; - << Examine (thing_to_examine) >>; -]; - -verb 'unknown' * -> ExamineObject;