From 58f64b1e7332865875bca4bf496205bcccffabcf Mon Sep 17 00:00:00 2001 From: Graham Nelson Date: Sun, 10 Apr 2022 11:07:04 +0100 Subject: [PATCH] Fix for Mantis bug 1990 --- inform7/Figures/memory-diagnostics.txt | 4 ++-- inform7/Figures/timings-diagnostics.txt | 14 +++++++------- .../Inter/CommandParserKit/Sections/Parser.i6t | 12 ++++-------- .../Test Cases/_Results_Ideal/UnsetPronouns.txt | 4 ++-- 4 files changed, 15 insertions(+), 19 deletions(-) diff --git a/inform7/Figures/memory-diagnostics.txt b/inform7/Figures/memory-diagnostics.txt index 88834ad421..9cd62ec927 100644 --- a/inform7/Figures/memory-diagnostics.txt +++ b/inform7/Figures/memory-diagnostics.txt @@ -1,4 +1,4 @@ -Total memory consumption was 126307K = 123 MB +Total memory consumption was 126308K = 123 MB ---- was used for 2008021 objects, in 360796 frames in 0 x 800K = 0K = 0 MB: @@ -237,7 +237,7 @@ Total memory consumption was 126307K = 123 MB 100.0% was used for memory not allocated for objects: - 59.2% text stream storage 76625748 bytes in 452194 claims + 59.2% text stream storage 76626172 bytes in 452197 claims 3.5% dictionary storage 4544512 bytes in 6619 claims ---- sorting 744 bytes in 3 claims 5.5% source text 7200000 bytes in 3 claims diff --git a/inform7/Figures/timings-diagnostics.txt b/inform7/Figures/timings-diagnostics.txt index ff703b14ed..bc9f2f88b7 100644 --- a/inform7/Figures/timings-diagnostics.txt +++ b/inform7/Figures/timings-diagnostics.txt @@ -1,8 +1,8 @@ 100.0% in inform7 run 68.3% in compilation to Inter 47.9% in //Sequence::undertake_queued_tasks// - 4.6% in //MajorNodes::pre_pass// - 3.3% in //MajorNodes::pass_1// + 4.5% in //MajorNodes::pre_pass// + 3.2% in //MajorNodes::pass_1// 2.3% in //RTPhrasebook::compile_entries// 1.8% in //ImperativeDefinitions::assess_all// 1.5% in //RTKindConstructors::compile// @@ -18,20 +18,20 @@ 0.1% in //Task::make_built_in_kind_constructors// 0.1% in //Understand::traverse// 0.1% in //World::stages_II_and_III// - 2.1% not specifically accounted for + 2.2% not specifically accounted for 29.0% in running Inter pipeline - 10.1% in step 14/15: generate inform6 -> auto.inf + 10.2% in step 14/15: generate inform6 -> auto.inf 7.6% in step 5/15: load-binary-kits - 6.6% in step 6/15: make-synoptic-module + 6.5% in step 6/15: make-synoptic-module 1.5% in step 9/15: make-identifiers-unique + 0.5% in step 4/15: compile-splats 0.4% in step 12/15: eliminate-redundant-operations - 0.4% in step 4/15: compile-splats 0.4% in step 7/15: shorten-wiring 0.3% in step 8/15: detect-indirect-calls 0.2% in step 11/15: eliminate-redundant-labels 0.1% in step 10/15: reconcile-verbs 0.1% in step 2/15: parse-insertions 0.1% in step 3/15: resolve-conditional-compilation - 0.7% not specifically accounted for + 0.5% not specifically accounted for 2.2% in supervisor 0.4% not specifically accounted for diff --git a/inform7/Internal/Inter/CommandParserKit/Sections/Parser.i6t b/inform7/Internal/Inter/CommandParserKit/Sections/Parser.i6t index 36f37c409b..dbb3be70d3 100644 --- a/inform7/Internal/Inter/CommandParserKit/Sections/Parser.i6t +++ b/inform7/Internal/Inter/CommandParserKit/Sections/Parser.i6t @@ -589,7 +589,7 @@ Get the input, do OOPS and AGAIN. ! Re-tokenise: VM_Tokenise(buffer,parse); - num_words = WordCount(); players_command = 100 + num_words; + num_words = WordCount(); players_command = 100 + num_words; token_filter = 0; k=0; #Ifdef DEBUG; @@ -636,10 +636,8 @@ Get the input, do OOPS and AGAIN. ! Begin from what we currently think is the verb word .BeginCommand; - wn = verb_wordnum; verb_word = NextWordStopped(); - ! If there's no input here, we must have something like "person,". if (verb_word == -1) { @@ -719,7 +717,6 @@ Is the command a direction name, and so an implicit GO? If so, go to (K). ! or the name of someone to talk to if (verb_word == 0 || ((verb_word->#dict_par1) & 1) == 0) { - ! So is the first word an object contained in the special object "compass" ! (i.e., a direction)? This needs use of NounDomain, a routine which ! does the object matching, returning the object number, or 0 if none found, @@ -767,7 +764,6 @@ Is anyone being addressed? ! advanced past a comma. (A comma is a word all on its own in the table.) .Conversation; - j = wn - 1; ! Use NounDomain (in the context of "animate creature") to see if the @@ -775,7 +771,7 @@ Is anyone being addressed? wn = 1; lookahead = HELD_TOKEN; scope_reason = TALKING_REASON; - l = NounDomain(player,actors_location,6); + l = NounDomain(player, actors_location, CREATURE_TOKEN); scope_reason = PARSING_REASON; if (l == REPARSE_CODE) jump ReParse; if (l == 0) { @@ -2120,7 +2116,8 @@ because we want to allow duplicates). first_word i j k l answer_words marker; #Ifdef DEBUG; if (parser_trace >= 4) { - print " [NounDomain called at word ", wn, "^"; + print " [NounDomain called at word ", wn, + " (domain1 ", (name) domain1, ", domain2 ", (name) domain2, ")^"; print " "; if (indef_mode) { print "seeking indefinite object: "; @@ -3505,7 +3502,6 @@ cases, we pass the job down to |TryGivenObject|. = [ MatchTextAgainstObject item i; if (token_filter ~= 0 && ConsultNounFilterToken(item) == 0) return; - if (match_from <= num_words) { ! If there's any text to match, that is wn = match_from; i = NounWord(); diff --git a/inform7/Tests/Test Cases/_Results_Ideal/UnsetPronouns.txt b/inform7/Tests/Test Cases/_Results_Ideal/UnsetPronouns.txt index fb1773a5cf..03202b235b 100644 --- a/inform7/Tests/Test Cases/_Results_Ideal/UnsetPronouns.txt +++ b/inform7/Tests/Test Cases/_Results_Ideal/UnsetPronouns.txt @@ -53,7 +53,7 @@ [line 0 token 1 word 2 : noun] [Object list from word 2] [Calling NounDomain on location and actor] - [NounDomain called at word 3 + [NounDomain called at word 3 (domain1 Home, domain2 yourself) seeking indefinite object: number wanted: 0 most likely GNAs of names: 4095 @@ -62,7 +62,7 @@ [ND made 1 matches] [ND returned yourself] [Calling NounDomain on location and actor] - [NounDomain called at word 2 + [NounDomain called at word 2 (domain1 Home, domain2 yourself) seeking definite object Trying the north at word 2 Parse_name called