diff --git a/docs/assertions-module/3-dbtr.html b/docs/assertions-module/3-dbtr.html index c69192650..436196e69 100644 --- a/docs/assertions-module/3-dbtr.html +++ b/docs/assertions-module/3-dbtr.html @@ -221,12 +221,16 @@

-    kind *K = NULL;
+    kind *K = NULL, *K_weak = NULL;
     Determine the kind of what to make4.1.1;
     Check that this is a kind where it makes sense to enumerate new values4.1.2;
-    K = Kinds::weaken(K, K_object);
-    if (!(Kinds::Behaviour::is_object(K))) RTTables::defines(t, K);
-    t->kind_defined_in_this_table = K;
+    K_weak = Kinds::weaken(K, K_object);
+    if (Kinds::Behaviour::is_object(K_weak)) {
+        t->kind_defined_in_this_table = K;
+    } else {
+        RTTables::defines(t, K_weak);
+        t->kind_defined_in_this_table = K_weak;
+    }
     Tables::Columns::set_kind(t->columns[0].column_identity, t, K);
     Create values for this kind as enumerated by names in the first column4.1.3;
 
diff --git a/inform7/Figures/timings-diagnostics.txt b/inform7/Figures/timings-diagnostics.txt index e2a4997ec..2fe857728 100644 --- a/inform7/Figures/timings-diagnostics.txt +++ b/inform7/Figures/timings-diagnostics.txt @@ -1,32 +1,32 @@ 100.0% in inform7 run - 66.7% in compilation to Inter - 44.4% in //Sequence::undertake_queued_tasks// + 66.2% in compilation to Inter + 43.7% in //Sequence::undertake_queued_tasks// 4.4% in //MajorNodes::pre_pass// - 3.3% in //MajorNodes::pass_1// + 3.4% in //MajorNodes::pass_1// 2.0% in //RTKindConstructors::compile// - 1.6% in //ImperativeDefinitions::assess_all// - 1.6% in //RTPhrasebook::compile_entries// + 1.7% in //ImperativeDefinitions::assess_all// + 1.3% in //RTPhrasebook::compile_entries// 1.0% in //Sequence::lint_inter// 0.6% in //ImperativeDefinitions::compile_first_block// 0.6% in //MajorNodes::pass_2// 0.6% in //World::stage_V// 0.3% in //CompletionModule::compile// - 0.3% in //InferenceSubjects::emit_all// 0.3% in //RTKindConstructors::compile_permissions// 0.3% in //Sequence::undertake_queued_tasks// 0.3% in //Sequence::undertake_queued_tasks// 0.3% in //Task::make_built_in_kind_constructors// 0.3% in //World::stages_II_and_III// - 3.7% not specifically accounted for - 26.4% in running Inter pipeline - 8.8% in step 14/15: generate inform6 -> auto.inf - 7.1% in step 5/15: load-binary-kits - 5.4% in step 6/15: make-synoptic-module + 4.2% not specifically accounted for + 26.8% in running Inter pipeline + 8.9% in step 14/15: generate inform6 -> auto.inf + 7.2% in step 5/15: load-binary-kits + 5.5% in step 6/15: make-synoptic-module 2.0% in step 9/15: make-identifiers-unique + 0.3% in step 11/15: eliminate-redundant-labels 0.3% in step 12/15: eliminate-redundant-operations 0.3% in step 4/15: compile-splats 0.3% in step 7/15: shorten-wiring 0.3% in step 8/15: detect-indirect-calls - 1.7% not specifically accounted for - 6.1% in supervisor + 1.3% not specifically accounted for + 6.2% in supervisor 0.7% not specifically accounted for diff --git a/inform7/Tests/Test Cases/ObjectsDefinedByTable--I.txt b/inform7/Tests/Test Cases/ObjectsDefinedByTable--I.txt new file mode 100644 index 000000000..739c81fbe --- /dev/null +++ b/inform7/Tests/Test Cases/ObjectsDefinedByTable--I.txt @@ -0,0 +1,26 @@ + Staging Area + yellow banana was est 1919 for race leader. + polkadot banana was est 1933 for King of the Mountains. + green banana was est 1953 for highest point scorer on sprints. + white banana was est 1975 for best cyclist aged 25 or less. + + red snowflake provides snowtext: This snowflake is red. + blue snowflake provides snowtext: This snowflake is blue. + + Welcome + An Interactive Fiction + Release 1 / Serial number 160428 / Inform 7 v10.2.0 / D + + Staging Area + You can see a yellow jersey, a polkadot jersey, a green jersey and a white jersey here. + +> > Staging Area + (Testing.) + + >[1] examine yellow jersey + Since 1919, the Tour de France has awarded this jersey to the race leader. + + >[2] examine green jersey + Since 1953, the Tour de France has awarded this jersey to the highest point scorer on sprints. + +> > \ No newline at end of file diff --git a/inform7/Tests/Test Cases/ObjectsDefinedByTable.txt b/inform7/Tests/Test Cases/ObjectsDefinedByTable.txt new file mode 100644 index 000000000..7fa998eb0 --- /dev/null +++ b/inform7/Tests/Test Cases/ObjectsDefinedByTable.txt @@ -0,0 +1,40 @@ +Test: ObjectsDefinedByTable +For: Z-Machine + +The Staging Area is a room. A jersey is a kind of thing. A jersey is wearable. Some jerseys in the Staging Area are defined by the Table of Honorary Jerseys. The description of a jersey is "Since [year established], the Tour de France has awarded this jersey to the [citation]." + +A banana is a kind of value. Some bananas are defined by the Table of Honorary Bananas. + +When play begins: + repeat with B running through bananas: + say "[B] was est [year banana established of B] for [banana citation of B]." + +Table of Honorary Jerseys +jersey year established citation +a yellow jersey 1919 "race leader" +a polkadot jersey 1933 "King of the Mountains" +a green jersey 1953 "highest point scorer on sprints" +a white jersey 1975 "best cyclist aged 25 or less" + +Table of Honorary Bananas +banana year banana established banana citation +a yellow banana 1919 "race leader" +a polkadot banana 1933 "King of the Mountains" +a green banana 1953 "highest point scorer on sprints" +a white banana 1975 "best cyclist aged 25 or less" + +Test me with "examine yellow jersey / examine green jersey". + +A snowflake is a kind of object. A snowflake has some text called the snowtext. + +Some snowflakes are defined by the Table of Test Snow. + +Table of Test Snow +snowflake snowtext +red snowflake "This snowflake is red" +blue snowflake "This snowflake is blue" + +When play begins: + repeat with S running through objects: + if S provides snowtext: + say "[S] provides snowtext: [snowtext of S]." diff --git a/inform7/Tests/Test Cases/TableDefinedTexts--I.txt b/inform7/Tests/Test Cases/TableDefinedTexts--I.txt index 728fb9516..d3f39093f 100644 --- a/inform7/Tests/Test Cases/TableDefinedTexts--I.txt +++ b/inform7/Tests/Test Cases/TableDefinedTexts--I.txt @@ -1,7 +1,7 @@ Lab Welcome An Interactive Fiction - Release 1 / Serial number 160428 / Inform 7 v10.1.0 / D + Release 1 / Serial number 160428 / Inform 7 v10.2.0 / D Lab @@ -12,24 +12,24 @@ thing 1 - thing location: out of play unlit, inedible, portable; singular-named, proper-named + description: "This is + + the first thing." initial appearance: none printed name: "thing 1" printed plural name: none indefinite article: none - description: "This is - - the first thing." list grouping key: none >[2] showme thing 2 thing 2 - thing location: out of play unlit, inedible, portable; singular-named, proper-named + description: "This is the second thing." initial appearance: none printed name: "thing 2" printed plural name: none indefinite article: none - description: "This is the second thing." list grouping key: none > > \ No newline at end of file diff --git a/inform7/Tests/Test Internals/Calculus--I.txt b/inform7/Tests/Test Internals/Calculus--I.txt index 72e932d2b..af0e6adb5 100644 --- a/inform7/Tests/Test Internals/Calculus--I.txt +++ b/inform7/Tests/Test Internals/Calculus--I.txt @@ -498,7 +498,7 @@ Listed-in predication << listed_in('4', 'the table of solid stuff') >> 2. nothing is a statue listed in the Table of Stolid Stuff -<< listed_in('nothing', 'the table of stolid stuff') >> +<< statue('nothing') & listed_in('nothing', 'the table of stolid stuff') >> 3. a crispiness listed in the Table of Salad Stuff is a density listed in the Table of Solid Stuff << Exists x : number(x) & listed_in(x, 'the table of salad stuff') & listed_in(x, 'the table of solid stuff') >> diff --git a/inform7/assertions-module/Chapter 3/Define by Table Requests.w b/inform7/assertions-module/Chapter 3/Define by Table Requests.w index 103d1af6c..7be461eb4 100644 --- a/inform7/assertions-module/Chapter 3/Define by Table Requests.w +++ b/inform7/assertions-module/Chapter 3/Define by Table Requests.w @@ -125,12 +125,16 @@ void DefineByTable::kind_defined_by_table(parse_node *V) { @h Creation. @ = - kind *K = NULL; + kind *K = NULL, *K_weak = NULL; @; @; - K = Kinds::weaken(K, K_object); - if (!(Kinds::Behaviour::is_object(K))) RTTables::defines(t, K); - t->kind_defined_in_this_table = K; + K_weak = Kinds::weaken(K, K_object); + if (Kinds::Behaviour::is_object(K_weak)) { + t->kind_defined_in_this_table = K; + } else { + RTTables::defines(t, K_weak); + t->kind_defined_in_this_table = K_weak; + } Tables::Columns::set_kind(t->columns[0].column_identity, t, K); @;