diff --git a/docs/core-module/12-cdp.html b/docs/core-module/12-cdp.html index 6e25d98ca..7fe497fb0 100644 --- a/docs/core-module/12-cdp.html +++ b/docs/core-module/12-cdp.html @@ -2358,8 +2358,7 @@ then expand it into the output. if (Calculus::Deferrals::write_loop_schema(&loop_schema, K) == FALSE) { if (pdef->rtp_iname == NULL) { package_request *P = Packaging::home_of(pdef->ppd_iname); - pdef->rtp_iname = InterNames::one_off(I"rtp", P); - Inter::Symbols::set_flag(InterNames::to_symbol(pdef->rtp_iname), MAKE_NAME_UNIQUE); + pdef->rtp_iname = Hierarchy::make_iname_in(RTP_HL, P); } Calculus::Schemas::modify(&loop_schema, "if (RunTimeProblem(RTP_CANTITERATE, %n))", pdef->rtp_iname); diff --git a/docs/core-module/13-rsfk.html b/docs/core-module/13-rsfk.html index 568e5dc2d..0256d4a91 100644 --- a/docs/core-module/13-rsfk.html +++ b/docs/core-module/13-rsfk.html @@ -750,15 +750,11 @@ compile under Inform 6. rks->make_default = FALSE; rks->default_requested_here = NULL; package_request *PR = Kinds::Behaviour::package(K); - rks->rks_iname = InterNames::new(KIND_ID_INAMEF); - Packaging::house(rks->rks_iname, PR); TEMPORARY_TEXT(TEMP); Kinds::Textual::write(TEMP, K); wording W = Feeds::feed_stream(TEMP); rks->rks_iname = Hierarchy::make_iname_with_memo(KIND_HL, PR, W); DISCARD_TEXT(TEMP); - InterNames::attach_memo(rks->rks_iname, W); - InterNames::to_symbol(rks->rks_iname); rks->rks_dv_iname = Hierarchy::make_iname_in(DEFAULT_VALUE_HL, PR); diff --git a/docs/core-module/15-pr.html b/docs/core-module/15-pr.html index 684ee322b..f3df095cf 100644 --- a/docs/core-module/15-pr.html +++ b/docs/core-module/15-pr.html @@ -975,8 +975,7 @@ we find it, we compile it and return return Properties::iname(Properties::EitherOr::get_negation(prn)); if (prn->prop_iname == NULL) { package_request *R = Hierarchy::package(prn->owning_module, PROPERTIES_HAP); - prn->prop_iname = InterNames::one_off(I"P", R); - if (Wordings::nonempty(prn->name)) InterNames::attach_memo(prn->prop_iname, prn->name); + prn->prop_iname = Hierarchy::make_iname_with_memo(PROPERTY_HL, R, prn->name); } return prn->prop_iname; } diff --git a/docs/core-module/16-ic.html b/docs/core-module/16-ic.html index a31ec14e2..6fe2e1bbd 100644 --- a/docs/core-module/16-ic.html +++ b/docs/core-module/16-ic.html @@ -245,20 +245,17 @@ since Inform always compiles code which knows which kind it's looping over.
     inter_name *PL::Counting::first_instance(kind *K) {
-        inter_name *iname = InterNames::letter_parametrised_name(
-            FIRST_INSTANCE_INAMEF, Kinds::RunTime::iname(K), FIRST_INSTANCE_INDERIV, Kinds::Behaviour::package(K));
+        inter_name *iname = Hierarchy::derive_iname_in(FIRST_INSTANCE_HL, Kinds::RunTime::iname(K), Kinds::Behaviour::package(K));
         return iname;
     }
 
     inter_name *PL::Counting::next_instance(kind *K) {
-        inter_name *iname = InterNames::letter_parametrised_name(
-            NEXT_INSTANCE_INAMEF, Kinds::RunTime::iname(K), NEXT_INSTANCE_INDERIV, Kinds::Behaviour::package(K));
+        inter_name *iname = Hierarchy::derive_iname_in(NEXT_INSTANCE_HL, Kinds::RunTime::iname(K), Kinds::Behaviour::package(K));
         return iname;
     }
 
     inter_name *PL::Counting::instance_count_iname(kind *K) {
-        inter_name *iname = InterNames::letter_parametrised_name(
-            COUNT_INSTANCE_INAMEF, Kinds::RunTime::iname(K), COUNT_INSTANCE_INDERIV, Kinds::Behaviour::package(K));
+        inter_name *iname = Hierarchy::derive_iname_in(COUNT_INSTANCE_HL, Kinds::RunTime::iname(K), Kinds::Behaviour::package(K));
         return iname;
     }
 
@@ -268,8 +265,7 @@ since Inform always compiles code which knows which kind it's looping over.
             if (Kinds::Compare::lt(K, K_object)) {
                 inter_name *iname = PL::Counting::first_instance(K);
                 instance *next = PL::Counting::next_instance_of(NULL, K);
-                package_request *PR = Kinds::Behaviour::package(K);
-                packaging_state save = Packaging::enter(PR);
+                packaging_state save = Packaging::enter_home_of(iname);
                 if (next) {
                     Emit::named_iname_constant(iname, K_object, Instances::emitted_iname(next));
                 } else {
diff --git a/docs/core-module/19-tb.html b/docs/core-module/19-tb.html
index f50b01be4..ac59f065b 100644
--- a/docs/core-module/19-tb.html
+++ b/docs/core-module/19-tb.html
@@ -461,10 +461,7 @@ table and then destroy the temporary one made here.
         if (connection != TABLE_IS_NEW) <Require the previous table to exist 20.5>
         else <Require the previous table not to exist 20.6>;
 
-    InterNames::attach_memo(t->table_identifier, t->table_name_text);
-
         if (connection == TABLE_IS_NEW) {
-    InterNames::to_symbol(t->table_identifier);
             <Register the names of the new table 20.7>;
             LOGIF(TABLES, "Created: $B\n", t);
         }
diff --git a/docs/core-module/21-fao.html b/docs/core-module/21-fao.html
index e2e629f79..920da4b5d 100644
--- a/docs/core-module/21-fao.html
+++ b/docs/core-module/21-fao.html
@@ -354,8 +354,7 @@ can be used in a void context as a sort of return-from-rule phrase.
         rbno->name = Nouns::new_proper_noun(W, NEUTER_GENDER,
             REGISTER_SINGULAR_NTOPT + PARSE_EXACTLY_NTOPT,
             MISCELLANEOUS_MC, Rvalues::from_named_rulebook_outcome(rbno));
-        rbno->nro_iname = InterNames::one_off(I"outcome", R);
-        InterNames::attach_memo(rbno->nro_iname, W);
+        rbno->nro_iname = Hierarchy::make_iname_with_memo(OUTCOME_HL, R, W);
         return rbno;
     }
 
diff --git a/docs/core-module/21-rl.html b/docs/core-module/21-rl.html
index c1c6dbf01..91004b9c0 100644
--- a/docs/core-module/21-rl.html
+++ b/docs/core-module/21-rl.html
@@ -68,6 +68,7 @@ see below.
         struct inter_name *shell_routine_iname;
         struct inter_name *rule_extern_iname;     if externally defined, this is the I6 routine
         struct text_stream *rule_extern_iname_as_text;     and this is it in plain text
+        struct inter_name *xiname;
         struct inter_name *rule_extern_response_handler_iname;     and this produces any response texts it has
         int do_not_import;     veto importation of this from the Standard Rules precompiled inter code
         int defn_compiled;     has the definition of this rule, if needed, been compiled yet?
@@ -163,6 +164,7 @@ later: see below.
         R->defn_as_phrase = NULL;
         R->rule_extern_iname = NULL;
         R->rule_extern_iname_as_text = NULL;
+        R->xiname = NULL;
         R->rule_extern_response_handler_iname = NULL;
         R->name = W;
         R->italicised_text = EMPTY_WORDING;
@@ -300,18 +302,15 @@ must be added after the rule has been created:
         Inter::Symbols::to_data(Emit::repository(), Packaging::incarnate(R->rule_package), InterNames::to_symbol(xiname), &v1, &v2);
         Emit::named_generic_constant(R->rule_extern_iname, v1, v2);
         Packaging::exit(save);
+        R->xiname = xiname;
         R->rule_extern_iname_as_text = Str::duplicate(XT);
         DISCARD_TEXT(XT);
     }
 
     inter_name *Rules::get_handler_definition(rule *R) {
-        if (R->rule_extern_response_handler_iname == NULL) {
-            TEMPORARY_TEXT(XT);
-            WRITE_TO(XT, "%SM", R->rule_extern_iname_as_text);
+        if (R->rule_extern_response_handler_iname == NULL)
             R->rule_extern_response_handler_iname =
-                Packaging::function_text(InterNames::one_off(I"responder_fn", R->rule_package), R->rule_package, XT);
-            DISCARD_TEXT(XT);
-        }
+                Hierarchy::derive_iname_in(RESPONDER_FN_HL, R->xiname, R->rule_package);
         return R->rule_extern_response_handler_iname;
     }
 
diff --git a/docs/core-module/26-rt.html b/docs/core-module/26-rt.html
index b48e890ec..39ee3d29e 100644
--- a/docs/core-module/26-rt.html
+++ b/docs/core-module/26-rt.html
@@ -131,7 +131,7 @@ create a new nonphrasal stack frame.
         if ((currently_compiling_in_frame->allocated_pointers) ||
             (currently_compiling_in_frame->no_formal_parameters_needed > 0)) {
             if (Packaging::houseed_in_function(public_name)) {
-                kernel_name = InterNames::one_off(I"kernel", public_name->eventual_owner);
+                kernel_name = Hierarchy::make_kernel_iname(public_name->eventual_owner);
                 Inter::Symbols::set_flag(InterNames::to_symbol(kernel_name), MAKE_NAME_UNIQUE);
             } else {
                 internal_error("routine not housed in function");
diff --git a/docs/core-module/27-hl.html b/docs/core-module/27-hl.html
index 82fc2d390..743dba043 100644
--- a/docs/core-module/27-hl.html
+++ b/docs/core-module/27-hl.html
@@ -226,13 +226,17 @@
         return nrl->equates_to_iname;
     }
 
-    inter_name *HierarchyLocations::find_in_package(int id, package_request *P, wording W, compilation_module *C) {
+    inter_name *HierarchyLocations::find_in_package(int id, package_request *P, wording W, compilation_module *C, inter_name *derive_from) {
         if (nrls_created == FALSE) HierarchyLocations::create_nrls();
         if ((id < 0) || (id >= MAX_HL) || (nrls_indexed_by_id[id] == NULL))
             internal_error("bad nrl ID");
         named_resource_location *nrl = nrls_indexed_by_id[id];
-        if (nrl->requirements.any_package_of_this_type == NULL) internal_error("NRL accessed inappropriately");
-        if ((P == NULL) || (P->eventual_type != nrl->requirements.any_package_of_this_type)) {
+        if ((nrl->requirements.any_package_of_this_type == NULL) &&
+            (nrl->requirements.any_enclosure == FALSE)) internal_error("NRL accessed inappropriately");
+        if (nrl->requirements.any_enclosure) {
+            if (Inter::Symbols::read_annotation(P->eventual_type, ENCLOSING_IANN) != 1)
+                internal_error("subpackage not in enclosing superpackage");
+        } else if ((P == NULL) || (P->eventual_type != nrl->requirements.any_package_of_this_type)) {
             LOG("AN: %S, FPN: %S\n", nrl->access_name, nrl->function_package_name);
             LOG("Have type: $3, required: $3\n", P->eventual_type, nrl->requirements.any_package_of_this_type);
             internal_error("constant in wrong superpackage");
@@ -245,12 +249,20 @@
         } else if (nrl->trans.generate_from >= 0) {
             TEMPORARY_TEXT(T);
             inter_name *temp_iname = NULL;
-            if (nrl->trans.localise)
-                temp_iname = InterNames::new_in(nrl->trans.generate_from, C);
-            else
-                temp_iname = InterNames::new(nrl->trans.generate_from);
+            if (derive_from) {
+                if (nrl->trans.faux_letter >= 0)
+                    temp_iname = InterNames::letter_parametrised_name(nrl->trans.generate_from, derive_from, nrl->trans.faux_letter, P);
+                else
+                    temp_iname = InterNames::new_derived(nrl->trans.generate_from, derive_from);
+            } else {
+                if (nrl->trans.localise)
+                    temp_iname = InterNames::new_in(nrl->trans.generate_from, C);
+                else
+                    temp_iname = InterNames::new(nrl->trans.generate_from);
+            }
             WRITE_TO(T, "%n", temp_iname);
-            <Make the actual iname 1.1>;
+            if (nrl->trans.faux_letter >= 0) iname = temp_iname;
+            else <Make the actual iname 1.1>;
             DISCARD_TEXT(T);
         } else {
             text_stream *T = NULL;
@@ -273,7 +285,7 @@
 
 

The function HierarchyLocations::synoptic_submodule is used in 27/hr (§1.2, §1.4, §1.6, §1.10, §1.12, §1.18, §1.22, §1.26, §1.28, §1.32, §1.34, §1.36, §1.38, §1.40, §1.42).

-

The function HierarchyLocations::any_package_of_type is used in 27/hr (§1.4, §1.6, §1.8, §1.12, §1.14, §1.16, §1.20, §1.22, §1.24, §1.28, §1.30, §1.32, §1.34, §1.36, §1.38, §1.40, §1.42, §1.44, §1.46).

+

The function HierarchyLocations::any_package_of_type is used in 27/hr (§1.4, §1.6, §1.8, §1.12, §1.14, §1.16, §1.20, §1.22, §1.24, §1.26, §1.28, §1.30, §1.32, §1.34, §1.36, §1.38, §1.40, §1.42, §1.44, §1.46).

The function HierarchyLocations::any_enclosure is used in 27/hr (§1.46).

@@ -427,7 +439,7 @@

The function HierarchyLocations::index_ap appears nowhere else.

-

The function HierarchyLocations::ap is used in 27/hr (§1.4, §1.6, §1.8, §1.12, §1.14, §1.16, §1.20, §1.22, §1.24, §1.28, §1.30, §1.32, §1.34, §1.36, §1.38, §1.40, §1.42, §1.44, §1.46).

+

The function HierarchyLocations::ap is used in 27/hr (§1.4, §1.6, §1.8, §1.12, §1.14, §1.16, §1.20, §1.22, §1.24, §1.26, §1.28, §1.30, §1.32, §1.34, §1.36, §1.38, §1.40, §1.42, §1.44, §1.46).

The function HierarchyLocations::attach_new_package is used in 27/hr (§5).

diff --git a/docs/core-module/27-hr.html b/docs/core-module/27-hr.html index ae77f60a9..14e4aa414 100644 --- a/docs/core-module/27-hr.html +++ b/docs/core-module/27-hr.html @@ -19,6 +19,7 @@ home_for_weak_type_IDs = HierarchyLocations::blank(); Packaging::register_counter(I"code_block"); This will be counter number 0 + Packaging::register_counter(I"kernel"); This will be counter number 1 <Establish basics 1.2>; <Establish actions 1.4>; @@ -147,6 +148,8 @@ enum MISTAKEACTION_HL enum ACTIONS_HAP enum ACTION_BASE_NAME_HL + enum DOUBLE_SHARP_NAME_HL + enum PERFORM_FN_HL enum CHECK_RB_HL enum CARRY_OUT_RB_HL enum REPORT_RB_HL @@ -174,6 +177,8 @@ HierarchyLocations::ap(ACTIONS_HAP, local_actions, I"action", I"_action"); location_requirement in_action = HierarchyLocations::any_package_of_type(I"_action"); HierarchyLocations::con(ACTION_BASE_NAME_HL, NULL, Translation::generate(ACTION_BASE_INAMEF), in_action); + HierarchyLocations::con(DOUBLE_SHARP_NAME_HL, NULL, Translation::derive(ACTION_INAMEF), in_action); + HierarchyLocations::func(PERFORM_FN_HL, I"perform_fn", Translation::derive(ACTION_ROUTINE_INAMEF), in_action); HierarchyLocations::package(CHECK_RB_HL, I"check_rb", I"_rulebook", in_action); HierarchyLocations::package(CARRY_OUT_RB_HL, I"carry_out_rb", I"_rulebook", in_action); HierarchyLocations::package(REPORT_RB_HL, I"report_rb", I"_rulebook", in_action); @@ -596,6 +601,7 @@
     enum INSTANCES_HAP
+    enum INSTANCE_HL
     enum BACKDROP_FOUND_IN_FN_HL
     enum REGION_FOUND_IN_FN_HL
     enum SHORT_NAME_FN_HL
@@ -616,6 +622,7 @@
         location_requirement local_instances = HierarchyLocations::local_submodule(instances);
         HierarchyLocations::ap(INSTANCES_HAP, local_instances, I"instance", I"_instance");
             location_requirement in_instance = HierarchyLocations::any_package_of_type(I"_instance");
+            HierarchyLocations::con(INSTANCE_HL, I"I", Translation::uniqued(), in_instance);
             HierarchyLocations::func(BACKDROP_FOUND_IN_FN_HL, I"backdrop_found_in_fn", Translation::uniqued(), in_instance);
             HierarchyLocations::func(SHORT_NAME_FN_HL, I"short_name_fn", Translation::generate(SHORT_NAME_ROUTINE_INAMEF), in_instance);
             HierarchyLocations::func(SHORT_NAME_PROPERTY_FN_HL, I"short_name_property_fn", Translation::generate(SHORT_NAME_PROPERTY_ROUTINE_INAMEF), in_instance);
@@ -647,6 +654,8 @@
     enum START_ROOM_INIS_HL
     enum START_TIME_INIS_HL
     enum DONE_INIS_HL
+    enum DIRECTIONS_HAP
+    enum DIRECTION_HL
 

§1.26. <Establish int-fiction 1.26> = @@ -669,6 +678,9 @@ HierarchyLocations::con(START_ROOM_INIS_HL, I"START_ROOM_INIS", Translation::same(), synoptic_IF); HierarchyLocations::con(START_TIME_INIS_HL, I"START_TIME_INIS", Translation::same(), synoptic_IF); HierarchyLocations::con(DONE_INIS_HL, I"DONE_INIS", Translation::same(), synoptic_IF); + HierarchyLocations::ap(DIRECTIONS_HAP, synoptic_IF, I"direction", I"_direction"); + location_requirement in_direction = HierarchyLocations::any_package_of_type(I"_direction"); + HierarchyLocations::con(DIRECTION_HL, NULL, Translation::generate(DIRECTION_OBJECT_INAMEF), in_direction);

@@ -695,6 +707,9 @@ enum DEFAULT_CLOSURE_FN_HL enum GPR_FN_HL enum INSTANCE_GPR_FN_HL + enum FIRST_INSTANCE_HL + enum NEXT_INSTANCE_HL + enum COUNT_INSTANCE_HL enum KIND_INLINE_PROPERTIES_HAP enum KIND_INLINE_PROPERTY_HL enum DEFAULTVALUEOFKOV_HL @@ -736,6 +751,9 @@ HierarchyLocations::func(DEFAULT_CLOSURE_FN_HL, I"default_closure_fn", Translation::uniqued(), in_kind); HierarchyLocations::func(GPR_FN_HL, I"gpr_fn", Translation::uniqued(), in_kind); HierarchyLocations::func(INSTANCE_GPR_FN_HL, I"instance_gpr_fn", Translation::uniqued(), in_kind); + HierarchyLocations::con(FIRST_INSTANCE_HL, NULL, Translation::derive_lettered(FIRST_INSTANCE_INAMEF, FIRST_INSTANCE_INDERIV), in_kind); + HierarchyLocations::con(NEXT_INSTANCE_HL, NULL, Translation::derive_lettered(NEXT_INSTANCE_INAMEF, NEXT_INSTANCE_INDERIV), in_kind); + HierarchyLocations::con(COUNT_INSTANCE_HL, NULL, Translation::derive_lettered(COUNT_INSTANCE_INAMEF, COUNT_INSTANCE_INDERIV), in_kind); HierarchyLocations::ap(KIND_INLINE_PROPERTIES_HAP, in_kind, I"inline_property", I"_inline_property"); location_requirement in_kind_inline_property = HierarchyLocations::any_package_of_type(I"_inline_property"); HierarchyLocations::con(KIND_INLINE_PROPERTY_HL, I"inline", Translation::uniqued(), in_kind_inline_property); @@ -830,6 +848,7 @@
     enum PROPERTIES_HAP
+    enum PROPERTY_HL
     enum EITHER_OR_GPR_FN_HL
     enum CCOUNT_PROPERTY_HL
 
@@ -844,6 +863,7 @@ location_requirement local_properties = HierarchyLocations::local_submodule(properties); HierarchyLocations::ap(PROPERTIES_HAP, local_properties, I"property", I"_property"); location_requirement in_property = HierarchyLocations::any_package_of_type(I"_property"); + HierarchyLocations::con(PROPERTY_HL, I"P", Translation::same(), in_property); HierarchyLocations::func(EITHER_OR_GPR_FN_HL, I"either_or_GPR_fn", Translation::generate(GPR_FOR_EITHER_OR_PROPERTY_INAMEF), in_property); location_requirement synoptic_props = HierarchyLocations::synoptic_submodule(properties); @@ -953,6 +973,7 @@
     enum EMPTY_RULEBOOK_INAME_HL
     enum OUTCOMES_HAP
+    enum OUTCOME_HL
     enum RULEBOOKS_HAP
     enum RUN_FN_HL
     enum RULEBOOK_STV_CREATOR_FN_HL
@@ -975,6 +996,8 @@
 
         location_requirement local_rulebooks = HierarchyLocations::local_submodule(rulebooks);
         HierarchyLocations::ap(OUTCOMES_HAP, local_rulebooks, I"rulebook_outcome", I"_outcome");
+            location_requirement in_outcome = HierarchyLocations::any_package_of_type(I"_outcome");
+            HierarchyLocations::con(OUTCOME_HL, I"outcome", Translation::uniqued(), in_outcome);
         HierarchyLocations::ap(RULEBOOKS_HAP, local_rulebooks, I"rulebook", I"_rulebook");
             location_requirement in_rulebook = HierarchyLocations::any_package_of_type(I"_rulebook");
             HierarchyLocations::func(RUN_FN_HL, I"run_fn", Translation::uniqued(), in_rulebook);
@@ -1000,6 +1023,7 @@
     enum SHELL_FN_HL
     enum RULE_FN_HL
     enum EXTERIOR_RULE_HL
+    enum RESPONDER_FN_HL
     enum RESPONSES_HAP
     enum AS_CONSTANT_HL
     enum AS_BLOCK_CONSTANT_HL
@@ -1021,6 +1045,7 @@
             HierarchyLocations::func(SHELL_FN_HL, I"shell_fn", Translation::generate_in(RULE_SHELL_ROUTINE_INAMEF), in_rule);
             HierarchyLocations::func(RULE_FN_HL, I"rule_fn", Translation::generate_in(PHRASE_INAMEF), in_rule);
             HierarchyLocations::con(EXTERIOR_RULE_HL, I"exterior_rule", Translation::uniqued(), in_rule);
+            HierarchyLocations::func(RESPONDER_FN_HL, I"responder_fn", Translation::derive(RESPONDER_INAMEF), in_rule);
             HierarchyLocations::ap(RESPONSES_HAP, in_rule, I"response", I"_response");
                 location_requirement in_response = HierarchyLocations::any_package_of_type(I"_response");
                 HierarchyLocations::con(AS_CONSTANT_HL, I"as_constant", Translation::uniqued(), in_response);
@@ -1101,7 +1126,6 @@
 
 
 
-    enum BLOCK_HL
     enum LITERALS_HAP
     enum TEXT_LITERAL_HL
     enum LIST_LITERAL_HL
@@ -1109,6 +1133,7 @@
     enum TEXT_SUBSTITUTION_FN_HL
     enum PROPOSITIONS_HAP
     enum PROPOSITION_HL
+    enum RTP_HL
     enum BLOCK_CONSTANTS_HAP
     enum BLOCK_CONSTANT_HL
     enum BOX_QUOTATIONS_HAP
@@ -1122,7 +1147,6 @@
 
 
         location_requirement in_any_enclosure = HierarchyLocations::any_enclosure();
-        HierarchyLocations::con(BLOCK_HL, I"block", Translation::uniqued(), in_any_enclosure);
         HierarchyLocations::ap(LITERALS_HAP, in_any_enclosure, I"literal", I"_literal");
             location_requirement in_literal = HierarchyLocations::any_package_of_type(I"_literal");
             HierarchyLocations::con(TEXT_LITERAL_HL, I"text", Translation::uniqued(), in_literal);
@@ -1138,6 +1162,7 @@
         HierarchyLocations::ap(BOX_QUOTATIONS_HAP, in_any_enclosure, I"block_constant", I"_box_quotation");
             location_requirement in_box_quotation = HierarchyLocations::any_package_of_type(I"_box_quotation");
             HierarchyLocations::func(BOX_QUOTATION_FN_HL, I"quotation_fn", Translation::uniqued(), in_box_quotation);
+        HierarchyLocations::con(RTP_HL, I"rtp", Translation::uniqued(), in_any_enclosure);
 

@@ -1157,10 +1182,15 @@ enum K_FIGURE_NAME_XPACKAGE enum K_SOUND_NAME_XPACKAGE enum K_USE_OPTION_XPACKAGE + enum K_EXTERNAL_FILE_XPACKAGE + enum K_RULEBOOK_OUTCOME_XPACKAGE + enum K_RESPONSE_XPACKAGE + enum K_SCENE_XPACKAGE enum V_COMMAND_PROMPT_XPACKAGE enum NOTHING_HL enum OBJECT_HL enum TESTUSEOPTION_HL + enum PRINT_USE_OPTION_HL enum TABLEOFTABLES_HL enum TABLEOFVERBS_HL enum CAPSHORTNAME_HL @@ -1171,6 +1201,15 @@ enum RESOURCEIDSOFSOUNDS_HL enum TIME_TOKEN_INNER_HL enum TRUTH_STATE_TOKEN_INNER_HL + enum PRINT_TABLE_HL + enum PRINT_RULEBOOK_OUTCOME_HL + enum PRINT_RESPONSE_HL + enum PRINT_FIGURE_NAME_HL + enum PRINT_SOUND_NAME_HL + enum PRINT_EXTERNAL_FILE_NAME_HL + enum NO_EXTERNAL_FILES_HL + enum TABLEOFEXTERNALFILES_HL + enum PRINT_SCENE_HL

§1.48. <The rest 1.48> = @@ -1194,22 +1233,40 @@ location_requirement in_K_table = HierarchyLocations::this_exotic_package(K_TABLE_XPACKAGE); HierarchyLocations::con(TABLEOFTABLES_HL, I"TableOfTables", Translation::same(), in_K_table); + HierarchyLocations::func(PRINT_TABLE_HL, I"print_fn", Translation::to(I"PrintTableName"), in_K_table); location_requirement in_K_verb = HierarchyLocations::this_exotic_package(K_VERB_XPACKAGE); HierarchyLocations::con(TABLEOFVERBS_HL, I"TableOfVerbs", Translation::same(), in_K_verb); location_requirement in_K_figure_name = HierarchyLocations::this_exotic_package(K_FIGURE_NAME_XPACKAGE); HierarchyLocations::con(RESOURCEIDSOFFIGURES_HL, I"ResourceIDsOfFigures", Translation::same(), in_K_figure_name); + HierarchyLocations::func(PRINT_FIGURE_NAME_HL, I"print_fn", Translation::to(I"PrintFigureName"), in_K_figure_name); location_requirement in_K_sound_name = HierarchyLocations::this_exotic_package(K_SOUND_NAME_XPACKAGE); HierarchyLocations::con(RESOURCEIDSOFSOUNDS_HL, I"ResourceIDsOfSounds", Translation::same(), in_K_sound_name); + HierarchyLocations::func(PRINT_SOUND_NAME_HL, I"print_fn", Translation::to(I"PrintSoundName"), in_K_sound_name); location_requirement in_K_use_option = HierarchyLocations::this_exotic_package(K_USE_OPTION_XPACKAGE); HierarchyLocations::con(NO_USE_OPTIONS_HL, I"NO_USE_OPTIONS", Translation::same(), in_K_use_option); HierarchyLocations::func(TESTUSEOPTION_HL, I"test_fn", Translation::to(I"TestUseOption"), in_K_use_option); + HierarchyLocations::func(PRINT_USE_OPTION_HL, I"print_fn", Translation::to(I"PrintUseOption"), in_K_use_option); location_requirement in_V_command_prompt = HierarchyLocations::this_exotic_package(V_COMMAND_PROMPT_XPACKAGE); HierarchyLocations::func(COMMANDPROMPTTEXT_HL, I"command_prompt_text_fn", Translation::to(I"CommandPromptText"), in_V_command_prompt); + + location_requirement in_K_external_file = HierarchyLocations::this_exotic_package(K_EXTERNAL_FILE_XPACKAGE); + HierarchyLocations::con(NO_EXTERNAL_FILES_HL, I"NO_EXTERNAL_FILES", Translation::same(), in_K_external_file); + HierarchyLocations::con(TABLEOFEXTERNALFILES_HL, I"TableOfExternalFiles", Translation::same(), in_K_external_file); + HierarchyLocations::func(PRINT_EXTERNAL_FILE_NAME_HL, I"print_fn", Translation::to(I"PrintExternalFileName"), in_K_external_file); + + location_requirement in_K_rulebook_outcome = HierarchyLocations::this_exotic_package(K_RULEBOOK_OUTCOME_XPACKAGE); + HierarchyLocations::func(PRINT_RULEBOOK_OUTCOME_HL, I"print_fn", Translation::to(I"RulebookOutcomePrintingRule"), in_K_rulebook_outcome); + + location_requirement in_K_response = HierarchyLocations::this_exotic_package(K_RESPONSE_XPACKAGE); + HierarchyLocations::func(PRINT_RESPONSE_HL, I"print_fn", Translation::to(I"PrintResponse"), in_K_response); + + location_requirement in_K_scene = HierarchyLocations::this_exotic_package(K_SCENE_XPACKAGE); + HierarchyLocations::func(PRINT_SCENE_HL, I"print_fn", Translation::to(I"PrintSceneName"), in_K_scene);

@@ -1722,6 +1779,10 @@ case K_FIGURE_NAME_XPACKAGE: return Kinds::Behaviour::package(K_figure_name); case K_SOUND_NAME_XPACKAGE: return Kinds::Behaviour::package(K_sound_name); case K_USE_OPTION_XPACKAGE: return Kinds::Behaviour::package(K_use_option); + case K_EXTERNAL_FILE_XPACKAGE: return Kinds::Behaviour::package(K_external_file); + case K_RULEBOOK_OUTCOME_XPACKAGE: return Kinds::Behaviour::package(K_rulebook_outcome); + case K_RESPONSE_XPACKAGE: return Kinds::Behaviour::package(K_response); + case K_SCENE_XPACKAGE: return Kinds::Behaviour::package(K_scene); case V_COMMAND_PROMPT_XPACKAGE: return Packaging::home_of(NonlocalVariables::iname(command_prompt_VAR)); } @@ -1839,19 +1900,27 @@ } inter_name *Hierarchy::make_iname_in(int id, package_request *P) { - return HierarchyLocations::find_in_package(id, P, EMPTY_WORDING, NULL); + return HierarchyLocations::find_in_package(id, P, EMPTY_WORDING, NULL, NULL); + } + + inter_name *Hierarchy::derive_iname_in(int id, inter_name *derive_from, package_request *P) { + return HierarchyLocations::find_in_package(id, P, EMPTY_WORDING, NULL, derive_from); } inter_name *Hierarchy::make_localised_iname_in(int id, package_request *P, compilation_module *C) { - return HierarchyLocations::find_in_package(id, P, EMPTY_WORDING, C); + return HierarchyLocations::find_in_package(id, P, EMPTY_WORDING, C, NULL); } inter_name *Hierarchy::make_block_iname(package_request *P) { return Packaging::supply_iname(P, 0); } + inter_name *Hierarchy::make_kernel_iname(package_request *P) { + return Packaging::supply_iname(P, 1); + } + inter_name *Hierarchy::make_iname_with_memo(int id, package_request *P, wording W) { - return HierarchyLocations::find_in_package(id, P, W, NULL); + return HierarchyLocations::find_in_package(id, P, W, NULL, NULL); } package_request *Hierarchy::make_package_in(int id, package_request *P) { @@ -1887,13 +1956,17 @@

The function Hierarchy::package_within is used in 4/am (§6), 17/ts (§5), 17/rs (§5), 19/tc (§9), 22/pav (§7), 22/tp (§7).

-

The function Hierarchy::make_iname_in is used in 4/am (§6), 6/bp (§32, §42), 6/rlt (§9, §9.13, §15.1.2, §20, §20.3), 12/dtd (§4), 13/rsfk (§4, §13.1.1, §15), 15/ma (§11.3), 17/tl (§7, §10.2.1, §14.2, §16), 17/ts (§5, §8.1), 17/rs (§5, §6.1), 18/lc (§11), 19/tc (§9), 19/tb (§9), 20/eq (§10.1), 21/rl (§9, §19), 21/rl2 (§10, §14), 21/ac (§8), 22/ph (§11), 22/pav (§7, §9), 24/ch (§3), 26/lt (§3), 26/jl (§3), 26/ts (§9.1).

+

The function Hierarchy::make_iname_in is used in 4/am (§6), 6/bp (§32, §42), 6/rlt (§9, §9.13, §15.1.2, §20, §20.3), 12/dtd (§4), 12/cdp (§5), 13/rsfk (§4, §13.1.1, §15), 15/ma (§11.3), 17/tl (§7, §10.2.1, §14.2, §16), 17/ts (§5, §8.1), 17/rs (§5, §6.1), 18/lc (§11), 19/tc (§9), 19/tb (§9), 20/eq (§10.1), 21/rl (§9, §19), 21/rl2 (§10, §14), 21/ac (§8), 22/ph (§11), 22/pav (§7, §9), 24/ch (§3), 26/lt (§3), 26/jl (§3), 26/ts (§9.1).

+ +

The function Hierarchy::derive_iname_in is used in 16/ic (§10), 21/rl (§9).

The function Hierarchy::make_localised_iname_in is used in 22/pu (§6), 22/tp (§7).

The function Hierarchy::make_block_iname is used in 27/ei (§4).

-

The function Hierarchy::make_iname_with_memo is used in 5/nv (§16), 13/rsfk (§13.1.1), 21/ac (§6).

+

The function Hierarchy::make_kernel_iname is used in 26/rt (§4).

+ +

The function Hierarchy::make_iname_with_memo is used in 5/un (§1), 5/nv (§16), 13/rsfk (§13.1.1), 15/pr (§27), 21/fao (§10), 21/ac (§6).

The function Hierarchy::make_package_in is used in 21/ac (§6).

diff --git a/docs/core-module/27-in.html b/docs/core-module/27-in.html index 80b3111ed..feb53d0ba 100644 --- a/docs/core-module/27-in.html +++ b/docs/core-module/27-in.html @@ -338,11 +338,11 @@

The function InterNames::new_in_space is used in §4.

-

The function InterNames::one_off is used in 5/un (§1), 12/cdp (§5), 15/pr (§27), 21/rl (§9), 21/fao (§10), 26/rt (§4), 27/pc (§7, §7.1, §8), 27/hl (§1, §1.1, §2), 27/hr (§5).

+

The function InterNames::one_off is used in 27/pc (§7, §7.1, §8), 27/hl (§1, §1.1, §2), 27/hr (§5).

-

The function InterNames::attach_memo is used in §4, 5/un (§1), 13/rsfk (§13.1.1), 15/pr (§27), 15/ep (§4), 15/vp (§3), 19/tb (§20), 21/fao (§10), 27/hl (§1.1).

+

The function InterNames::attach_memo is used in §4, 15/ep (§4), 15/vp (§3), 27/hl (§1.1).

-

The function InterNames::to_symbol is used in §5, 4/am (§43), 5/lp (§19, §19.3.1, §19.3.1.1, §19.3.2, §19.2.1), 5/un (§1), 5/ins (§14), 5/nv (§12), 6/bp (§33), 6/rlt (§15, §15.1.3, §15.2.1, §15.2.5.1, §15.2.6, §15.2.10, §15.2.11, §15.2.12, §15.2.9.1, §15.2.10.1, §15.2.12.1, §29.5, §29.6), 6/nv (§17, §18.2), 12/dtd (§7.1.2, §11, §17, §27), 12/cdp (§2.1.6.1.8, §2.1.6.1.2.2.3, §2.1.6.1.9, §5), 13/ca (§1, §1.2, §1.3, §1.4, §1.5, §1.6, §1.7, §1.8, §1.9, §1.11, §1.12), 13/rsfk (§5, §7, §9, §12, §13.1.1, §19, §25.6.1, §25.6.2, §25.6.3, §25.6.4, §25.6.5, §25.6.6), 14/lv (§14.3, §14.4, §14.5), 14/cfs (§7), 15/pr (§21, §22.1, §27), 17/tl (§7, §13), 17/ts (§7, §8), 17/rs (§6.1, §6.2, §7.2), 19/tc (§8), 19/tb (§20), 20/eq (§48), 21/rl (§9, §11.2, §22, §22.1), 21/rb (§24.1.3.1), 21/fao (§10), 21/sv (§3.2), 21/ac (§14), 22/prcd (§10, §10.1.1.1), 22/pav (§9.2), 24/lv (§41), 24/ch (§4), 25/ci (§3.2.3.6), 25/ciac (§2), 25/cii (§3.1.1.4.7.1, §3.1.1.4.9, §3.1.1.4.10, §3.5.3, §3.5.8, §3.5.8.1), 25/cp (§6), 26/rt (§4, §4.1.2, §4.1.3, §4.1.4), 26/iti (§9), 26/ts (§10, §12), 27/is (§32), 27/ei (§3, §4, §5), 27/pc (§8), 27/hl (§1), 27/hr (§5).

+

The function InterNames::to_symbol is used in §5, 4/am (§43), 5/lp (§19, §19.3.1, §19.3.1.1, §19.3.2, §19.2.1), 5/un (§1), 5/ins (§14), 5/nv (§12), 6/bp (§33), 6/rlt (§15, §15.1.3, §15.2.1, §15.2.5.1, §15.2.6, §15.2.10, §15.2.11, §15.2.12, §15.2.9.1, §15.2.10.1, §15.2.12.1, §29.5, §29.6), 6/nv (§17, §18.2), 12/dtd (§7.1.2, §11, §17, §27), 12/cdp (§2.1.6.1.8, §2.1.6.1.2.2.3, §2.1.6.1.9), 13/ca (§1, §1.2, §1.3, §1.4, §1.5, §1.6, §1.7, §1.8, §1.9, §1.11, §1.12), 13/rsfk (§5, §7, §9, §12, §19, §25.6.1, §25.6.2, §25.6.3, §25.6.4, §25.6.5, §25.6.6), 14/lv (§14.3, §14.4, §14.5), 14/cfs (§7), 15/pr (§21, §22.1, §27), 17/tl (§7, §13), 17/ts (§7, §8), 17/rs (§6.1, §6.2, §7.2), 19/tc (§8), 20/eq (§48), 21/rl (§9, §11.2, §22, §22.1), 21/rb (§24.1.3.1), 21/fao (§10), 21/sv (§3.2), 21/ac (§14), 22/prcd (§10, §10.1.1.1), 22/pav (§9.2), 24/lv (§41), 24/ch (§4), 25/ci (§3.2.3.6), 25/ciac (§2), 25/cii (§3.1.1.4.7.1, §3.1.1.4.9, §3.1.1.4.10, §3.5.3, §3.5.8, §3.5.8.1), 25/cp (§6), 26/rt (§4, §4.1.2, §4.1.3, §4.1.4), 26/iti (§9), 26/ts (§10, §12), 27/is (§32), 27/ei (§3, §4, §5), 27/pc (§8), 27/hl (§1), 27/hr (§5).

The function InterNames::to_text is used in 15/vp (§3).

@@ -471,6 +471,7 @@ enum LABEL_STORAGE_INAMEF enum ICOUNT_CONSTANT_INAMEF enum WEAK_ID_CONSTANT_INAMEF + enum RESPONDER_INAMEF enum FINAL_INAMEF @@ -514,11 +515,6 @@ inter_name *InterNames::new_derived(int fnum, inter_name *from) { inter_name_family *F = InterNames::get_family(fnum); if (F->fusage != DERIVED_FUSAGE) internal_error("not a derived family"); - if (from->family != F->derivative_of) { - LOG("From = %n in X\n", from, Packaging::home_of(from)); - LOG("From family %S but derivative should be of %S\n", from->family->family_name, F->derivative_of->family_name); - internal_error("derived from name of wrong family"); - } inter_name *N = InterNames::new_in_space(InterNames::root(), F, TRUE); Packaging::house_with(N, from); N->derived_from = from; @@ -581,7 +577,7 @@

-

The function InterNames::new is used in §5, 13/rsfk (§13.1.1), 27/hl (§1).

+

The function InterNames::new is used in §5, 27/hl (§1).

The function InterNames::new_in is used in 27/hl (§1).

@@ -593,7 +589,7 @@

The function InterNames::new_overridden appears nowhere else.

-

The function InterNames::new_derived appears nowhere else.

+

The function InterNames::new_derived is used in 27/hl (§1).

The function InterNames::icount_name is used in 13/rsfk (§25).

@@ -626,7 +622,7 @@ if ((marker < 0) || (marker >= FINAL_INDERIV)) internal_error("respomse parameter out of range"); if (rname->parametrised_derivatives[marker] == NULL) { rname->parametrised_derivatives[marker] = InterNames::new(family); - Packaging::house(rname->parametrised_derivatives[marker], R); + if (R) Packaging::house(rname->parametrised_derivatives[marker], R); rname->parametrised_derivatives[marker]->derived_from = rname; } @@ -651,7 +647,7 @@

-

The function InterNames::letter_parametrised_name is used in 16/ic (§10).

+

The function InterNames::letter_parametrised_name is used in 27/hl (§1).

The function InterNames::override_action_base_iname appears nowhere else.

@@ -770,6 +766,7 @@ case VARIABLE_INAMEF: S = I"V"; break; case VERB_DECLARATION_ARRAY_INAMEF: S = I"GV_Grammar"; break; case WEAK_ID_CONSTANT_INAMEF: S = I"always_overridden"; break; + case RESPONDER_INAMEF: D = RULE_SHELL_ROUTINE_INAMEF; Suf = I"M"; break; } if ((S) || (D >= 0)) { diff --git a/docs/core-module/27-pc.html b/docs/core-module/27-pc.html index 8c3fb8c4b..1d060ac07 100644 --- a/docs/core-module/27-pc.html +++ b/docs/core-module/27-pc.html @@ -155,9 +155,9 @@

The function Packaging::stateless is used in 15/epv (§2).

-

The function Packaging::home_of is used in 12/cdp (§5), 27/in (§4), 27/hl (§1), 27/hr (§3).

+

The function Packaging::home_of is used in 12/cdp (§5), 27/hl (§1), 27/hr (§3).

-

The function Packaging::enter_home_of is used in 6/bp (§42), 6/rlt (§14, §15.1, §20, §20.3), 6/nv (§18), 12/cdp (§2.1.1), 13/kak (§5), 13/rsfk (§4, §16.2, §25), 15/pr (§27), 15/epv (§1.1.2), 17/tl (§14.1, §14.2, §16), 17/ts (§8.1, §11), 17/rs (§7.3), 18/lc (§11, §12.1), 19/rsft (§1.1.1.1, §1.1.1.1.1, §1.2, §1.3), 21/rl2 (§14, §20), 21/fao (§10), 21/ac (§6, §8, §14), 22/cs (§8), 22/pav (§8.1), 22/tp2 (§4), 24/ch (§6, §8), 26/vm (§8), 26/uo (§21), 26/lt (§4.1), 26/jl (§6), 26/rt (§1), 26/iti (§10), 26/pl (§12), 26/ts (§10), 27/ei (§3, §4), 27/hr (§4).

+

The function Packaging::enter_home_of is used in 6/bp (§42), 6/rlt (§14, §15.1, §20, §20.3), 6/nv (§18), 12/cdp (§2.1.1), 13/kak (§5), 13/rsfk (§4, §16.2, §25), 15/pr (§27), 15/epv (§1.1.2), 16/ic (§10), 17/tl (§14.1, §14.2, §16), 17/ts (§8.1, §11), 17/rs (§7.3), 18/lc (§11, §12.1), 19/rsft (§1.1.1.1, §1.1.1.1.1, §1.2, §1.3), 21/rl2 (§14, §20), 21/fao (§10), 21/ac (§6, §8, §14), 22/cs (§8), 22/pav (§8.1), 22/tp2 (§4), 24/ch (§6, §8), 26/vm (§8), 26/uo (§21), 26/lt (§4.1), 26/jl (§6), 26/rt (§1), 26/iti (§10), 26/pl (§12), 26/ts (§10), 27/ei (§3, §4), 27/hr (§4).

The function Packaging::enter_current_enclosure appears nowhere else.

@@ -236,7 +236,7 @@

-

The function Packaging::enter is used in §5, 5/ins (§34), 5/nv (§16), 13/rsfk (§16.1, §25), 15/epv (§2), 16/ic (§10), 17/rs (§6.1, §7.1), 21/rl (§9), 21/rl2 (§20), 22/ph (§12), 27/ei (§3, §4), 27/hl (§1).

+

The function Packaging::enter is used in §5, 5/ins (§34), 5/nv (§16), 13/rsfk (§16.1, §25), 15/epv (§2), 17/rs (§6.1, §7.1), 21/rl (§9), 21/rl2 (§20), 22/ph (§12), 27/ei (§3, §4), 27/hl (§1).

The function Packaging::exit is used in 5/ins (§34), 5/nv (§16), 6/bp (§42), 6/rlt (§14, §15.1, §20, §20.3), 6/nv (§18), 12/cdp (§2.1.1), 13/kak (§5), 13/rsfk (§4, §16.1, §16.2, §25), 15/pr (§27), 15/epv (§1.1.2, §2), 16/ic (§10), 17/tl (§14.1, §14.2, §16), 17/ts (§8.1, §11), 17/rs (§6.1, §7.1, §7.3), 18/lc (§11, §12.1), 19/rsft (§1.1.1.1, §1.1.1.1.1, §1.2, §1.3), 21/rl (§9), 21/rl2 (§14, §20), 21/fao (§10), 21/ac (§6, §8, §14), 22/cs (§8), 22/ph (§12), 22/pav (§8.1), 22/tp2 (§4), 24/ch (§6, §8), 26/vm (§8), 26/uo (§21), 26/lt (§4.1), 26/jl (§6), 26/rt (§4), 26/iti (§10), 26/pl (§12), 26/ts (§10), 27/ei (§3, §4), 27/hl (§1), 27/hr (§4).

@@ -502,11 +502,11 @@

The function Packaging::function is used in 27/hl (§1).

-

The function Packaging::function_text is used in 21/rl (§9), 27/hl (§1, §1.1).

+

The function Packaging::function_text is used in 27/hl (§1, §1.1).

The function Packaging::datum_text is used in 27/hl (§1).

-

The function Packaging::house is used in 13/rsfk (§13.1.1, §25), 15/ep (§4), 27/in (§5).

+

The function Packaging::house is used in 13/rsfk (§25), 15/ep (§4), 27/in (§5).

The function Packaging::house_with is used in 26/rt (§4), 27/in (§4).

diff --git a/docs/core-module/27-tr.html b/docs/core-module/27-tr.html index 6feae2bd8..cd2698e0e 100644 --- a/docs/core-module/27-tr.html +++ b/docs/core-module/27-tr.html @@ -18,6 +18,8 @@ int then_make_unique; int generate_from; int localise; + int derive; + int faux_letter; } name_translation; name_translation Translation::same(void) { @@ -26,6 +28,8 @@ nt.then_make_unique = FALSE; nt.generate_from = -1; nt.localise = FALSE; + nt.derive = FALSE; + nt.faux_letter = -1; return nt; } @@ -48,6 +52,21 @@ return nt; } + name_translation Translation::derive(int f) { + name_translation nt = Translation::same(); + nt.generate_from = f; + nt.derive = TRUE; + return nt; + } + + name_translation Translation::derive_lettered(int f, int faux_letter) { + name_translation nt = Translation::same(); + nt.generate_from = f; + nt.derive = TRUE; + nt.faux_letter = faux_letter; + return nt; + } + name_translation Translation::generate(int f) { name_translation nt = Translation::same(); nt.generate_from = f; @@ -72,7 +91,11 @@

The function Translation::to_uniqued appears nowhere else.

-

The function Translation::generate is used in 27/hr (§1.4, §1.6, §1.8, §1.12, §1.14, §1.22, §1.24, §1.28, §1.30, §1.34, §1.36, §1.44).

+

The function Translation::derive is used in 27/hr (§1.4, §1.40).

+ +

The function Translation::derive_lettered is used in 27/hr (§1.28).

+ +

The function Translation::generate is used in 27/hr (§1.4, §1.6, §1.8, §1.12, §1.14, §1.22, §1.24, §1.26, §1.28, §1.30, §1.34, §1.36, §1.44).

The function Translation::generate_in is used in 27/hr (§1.32, §1.40).

diff --git a/docs/core-module/5-nv.html b/docs/core-module/5-nv.html index b1402120a..84b3c6615 100644 --- a/docs/core-module/5-nv.html +++ b/docs/core-module/5-nv.html @@ -609,7 +609,6 @@ there's very little to say. text_stream *rvalue = NULL; if (nlv->housed_in_variables_array == FALSE) rvalue = NonlocalVariables::identifier(nlv); - LOG("Doing stuff with %W %n %S as rvalue\n", nlv->name, iname, rvalue); Emit::variable(iname, nlv->nlv_kind, v1, v2, rvalue); if (nlv == command_prompt_VAR) { packaging_state save = Routines::begin(Hierarchy::find(COMMANDPROMPTTEXT_HL)); diff --git a/docs/core-module/5-un.html b/docs/core-module/5-un.html index 269891709..d85da0676 100644 --- a/docs/core-module/5-un.html +++ b/docs/core-module/5-un.html @@ -40,9 +40,7 @@ it's convenient to associate them with nametags. void UseNouns::noun_compose_identifier(package_request *R, noun *t, int N) { if (t->nt_iname == NULL) { wording W = Nouns::get_name(t, FALSE); - t->nt_iname = InterNames::one_off(I"I", R); - if (Wordings::nonempty(W)) InterNames::attach_memo(t->nt_iname, W); - Inter::Symbols::set_flag(InterNames::to_symbol(t->nt_iname), MAKE_NAME_UNIQUE); + t->nt_iname = Hierarchy::make_iname_with_memo(INSTANCE_HL, R, W); } } diff --git a/docs/if-module/3-tm.html b/docs/if-module/3-tm.html index b72845258..7b79be26a 100644 --- a/docs/if-module/3-tm.html +++ b/docs/if-module/3-tm.html @@ -474,8 +474,8 @@ no need to translate this to other languages.)
         registered_directions++;
-        inter_name *dname = InterNames::new(DIRECTION_OBJECT_INAMEF);
-        Packaging::house(dname, Kinds::Behaviour::package(K_direction));
+        package_request *PR = Hierarchy::synoptic_package(DIRECTIONS_HAP);
+        inter_name *dname = Hierarchy::make_iname_in(DIRECTION_HL, PR);
         PF_I(map, I)->direction_iname = dname;
         PL::MapDirections::make_mapped_predicate(I, dname);
 
diff --git a/docs/if-module/4-act.html b/docs/if-module/4-act.html index 5e7e4323d..8963a4b8b 100644 --- a/docs/if-module/4-act.html +++ b/docs/if-module/4-act.html @@ -562,8 +562,7 @@ then that's what "listening" will match.) inter_name *PL::Actions::double_sharp(action_name *an) { if (an->an_iname == NULL) { - an->an_iname = InterNames::new_derived(ACTION_INAMEF, an->an_base_iname); - Packaging::house(an->an_iname, an->an_package); + an->an_iname = Hierarchy::derive_iname_in(DOUBLE_SHARP_NAME_HL, an->an_base_iname, an->an_package); packaging_state save = Packaging::enter(an->an_package); Emit::ds_named_pseudo_numeric_constant(an->an_iname, K_value, (inter_t) an->allocation_id); InterNames::annotate_i(an->an_iname, ACTION_IANN, 1); @@ -573,13 +572,8 @@ then that's what "listening" will match.) } inter_name *PL::Actions::Sub(action_name *an) { - if (an->an_routine_iname == NULL) { - an->an_routine_iname = - Packaging::function( - InterNames::one_off(I"perform_fn", an->an_package), - an->an_package, - InterNames::new_derived(ACTION_ROUTINE_INAMEF, an->an_base_iname)); - } + if (an->an_routine_iname == NULL) + an->an_routine_iname = Hierarchy::derive_iname_in(PERFORM_FN_HL, an->an_base_iname, an->an_package); return an->an_routine_iname; } diff --git a/docs/kinds-module/2-uk.html b/docs/kinds-module/2-uk.html index 5aa6fce82..174719389 100644 --- a/docs/kinds-module/2-uk.html +++ b/docs/kinds-module/2-uk.html @@ -692,20 +692,42 @@ in some human-readable format. internal_error("null kind has no printing routine"); } if (K->construct->pr_iname) return K->construct->pr_iname; - package_request *R = NULL; - int external = TRUE; + if (Kinds::Compare::eq(K, K_use_option)) { - R = Kinds::Behaviour::package(K); external = FALSE; - } - if (Kinds::Compare::eq(K, K_rulebook_outcome)) { - R = Kinds::Behaviour::package(K); external = FALSE; - } - if (Kinds::Compare::eq(K, K_response)) { - R = Kinds::Behaviour::package(K); external = FALSE; + K->construct->pr_iname = Hierarchy::find(PRINT_USE_OPTION_HL); + return K->construct->pr_iname; } if (Kinds::Compare::eq(K, K_table)) { - R = Kinds::Behaviour::package(K); external = FALSE; + K->construct->pr_iname = Hierarchy::find(PRINT_TABLE_HL); + return K->construct->pr_iname; } + if (Kinds::Compare::eq(K, K_rulebook_outcome)) { + K->construct->pr_iname = Hierarchy::find(PRINT_RULEBOOK_OUTCOME_HL); + return K->construct->pr_iname; + } + if (Kinds::Compare::eq(K, K_response)) { + K->construct->pr_iname = Hierarchy::find(PRINT_RESPONSE_HL); + return K->construct->pr_iname; + } + if (Kinds::Compare::eq(K, K_figure_name)) { + K->construct->pr_iname = Hierarchy::find(PRINT_FIGURE_NAME_HL); + return K->construct->pr_iname; + } + if (Kinds::Compare::eq(K, K_sound_name)) { + K->construct->pr_iname = Hierarchy::find(PRINT_SOUND_NAME_HL); + return K->construct->pr_iname; + } + if (Kinds::Compare::eq(K, K_external_file)) { + K->construct->pr_iname = Hierarchy::find(PRINT_EXTERNAL_FILE_NAME_HL); + return K->construct->pr_iname; + } + if (Kinds::Compare::eq(K, K_scene)) { + K->construct->pr_iname = Hierarchy::find(PRINT_SCENE_HL); + return K->construct->pr_iname; + } + + package_request *R = NULL; + int external = TRUE; if ((Kinds::get_construct(K) == CON_rule) || (Kinds::get_construct(K) == CON_rulebook)) external = TRUE; if (Kinds::Behaviour::is_an_enumeration(K)) { @@ -719,22 +741,15 @@ in some human-readable format. if (Kinds::Compare::eq(K, K_number)) external = TRUE; if (Kinds::Compare::eq(K, K_real_number)) external = TRUE; if (Str::len(X) == 0) X = I"DecimalNumber"; + if (R) { if (external) { - LOG("Here for u with %S\n", K, X); K->construct->pr_iname = Hierarchy::make_iname_in(PRINT_FN_HL, R); - LOG("Made 3\n", K->construct->pr_iname); inter_name *actual_iname = Hierarchy::find_by_name(X); packaging_state save = Packaging::enter_home_of(K->construct->pr_iname); Emit::named_iname_constant(K->construct->pr_iname, K_value, actual_iname); Packaging::exit(save); - } else { - K->construct->pr_iname = - Packaging::function_text( - InterNames::one_off(I"print_fn", R), - R, - X); - } + } else internal_error("internal but unknown kind printing routine"); } else { if (external) K->construct->pr_iname = Hierarchy::find_by_name(X); else internal_error("internal but unpackaged kind printing routine"); diff --git a/docs/multimedia-module/2-ef.html b/docs/multimedia-module/2-ef.html index 77af0ab13..895b0c4fd 100644 --- a/docs/multimedia-module/2-ef.html +++ b/docs/multimedia-module/2-ef.html @@ -354,9 +354,8 @@ letters or digits, with the first being a letter. void PL::Files::arrays(void) { if (Plugins::Manage::plugged_in(files_plugin) == FALSE) return; - package_request *PR = Kinds::Behaviour::package(K_external_file); - inter_name *iname = InterNames::one_off(I"NO_EXTERNAL_FILES", PR); - packaging_state save = Packaging::enter(PR); + inter_name *iname = Hierarchy::find(NO_EXTERNAL_FILES_HL); + packaging_state save = Packaging::enter_home_of(iname); Emit::named_numeric_constant(iname, (inter_t) (NUMBER_CREATED(external_file))); Packaging::exit(save); @@ -397,8 +396,8 @@ letters or digits, with the first being a letter. Packaging::exit(save); } - iname = InterNames::one_off(I"TableOfExternalFiles", PR); - save = Packaging::enter(PR); + iname = Hierarchy::find(TABLEOFEXTERNALFILES_HL); + save = Packaging::enter_home_of(iname); Emit::named_array_begin(iname, K_value); Emit::array_numeric_entry(0); LOOP_OVER(exf, external_file) Emit::array_iname_entry(exf->exf_iname); diff --git a/inform7/core-module/Chapter 12/Compile Deferred Propositions.w b/inform7/core-module/Chapter 12/Compile Deferred Propositions.w index ef4a15a1c..db5471b9b 100644 --- a/inform7/core-module/Chapter 12/Compile Deferred Propositions.w +++ b/inform7/core-module/Chapter 12/Compile Deferred Propositions.w @@ -1595,8 +1595,7 @@ pcalc_prop *Calculus::Propositions::Deferred::compile_loop_header(int var, local if (Calculus::Deferrals::write_loop_schema(&loop_schema, K) == FALSE) { if (pdef->rtp_iname == NULL) { package_request *P = Packaging::home_of(pdef->ppd_iname); - pdef->rtp_iname = InterNames::one_off(I"rtp", P); - Inter::Symbols::set_flag(InterNames::to_symbol(pdef->rtp_iname), MAKE_NAME_UNIQUE); + pdef->rtp_iname = Hierarchy::make_iname_in(RTP_HL, P); } Calculus::Schemas::modify(&loop_schema, "if (RunTimeProblem(RTP_CANTITERATE, %n))", pdef->rtp_iname); diff --git a/inform7/core-module/Chapter 13/Runtime Support for Kinds.w b/inform7/core-module/Chapter 13/Runtime Support for Kinds.w index 6f43f27fc..90012f4cf 100644 --- a/inform7/core-module/Chapter 13/Runtime Support for Kinds.w +++ b/inform7/core-module/Chapter 13/Runtime Support for Kinds.w @@ -587,15 +587,11 @@ compile under Inform 6. rks->make_default = FALSE; rks->default_requested_here = NULL; package_request *PR = Kinds::Behaviour::package(K); -// rks->rks_iname = InterNames::new(KIND_ID_INAMEF); -// Packaging::house(rks->rks_iname, PR); TEMPORARY_TEXT(TEMP); Kinds::Textual::write(TEMP, K); wording W = Feeds::feed_stream(TEMP); rks->rks_iname = Hierarchy::make_iname_with_memo(KIND_HL, PR, W); DISCARD_TEXT(TEMP); -// InterNames::attach_memo(rks->rks_iname, W); -// InterNames::to_symbol(rks->rks_iname); rks->rks_dv_iname = Hierarchy::make_iname_in(DEFAULT_VALUE_HL, PR); @ It's convenient to combine this system with one which constructs default diff --git a/inform7/core-module/Chapter 15/Properties.w b/inform7/core-module/Chapter 15/Properties.w index 1bb8732df..e7cbccfd7 100644 --- a/inform7/core-module/Chapter 15/Properties.w +++ b/inform7/core-module/Chapter 15/Properties.w @@ -681,8 +681,7 @@ inter_name *Properties::iname(property *prn) { return Properties::iname(Properties::EitherOr::get_negation(prn)); if (prn->prop_iname == NULL) { package_request *R = Hierarchy::package(prn->owning_module, PROPERTIES_HAP); - prn->prop_iname = InterNames::one_off(I"P", R); - if (Wordings::nonempty(prn->name)) InterNames::attach_memo(prn->prop_iname, prn->name); + prn->prop_iname = Hierarchy::make_iname_with_memo(PROPERTY_HL, R, prn->name); } return prn->prop_iname; } diff --git a/inform7/core-module/Chapter 16/Instance Counting.w b/inform7/core-module/Chapter 16/Instance Counting.w index 5617cf2bd..8949eec81 100644 --- a/inform7/core-module/Chapter 16/Instance Counting.w +++ b/inform7/core-module/Chapter 16/Instance Counting.w @@ -158,20 +158,17 @@ since Inform always compiles code which knows which kind it's looping over. = inter_name *PL::Counting::first_instance(kind *K) { - inter_name *iname = InterNames::letter_parametrised_name( - FIRST_INSTANCE_INAMEF, Kinds::RunTime::iname(K), FIRST_INSTANCE_INDERIV, Kinds::Behaviour::package(K)); + inter_name *iname = Hierarchy::derive_iname_in(FIRST_INSTANCE_HL, Kinds::RunTime::iname(K), Kinds::Behaviour::package(K)); return iname; } inter_name *PL::Counting::next_instance(kind *K) { - inter_name *iname = InterNames::letter_parametrised_name( - NEXT_INSTANCE_INAMEF, Kinds::RunTime::iname(K), NEXT_INSTANCE_INDERIV, Kinds::Behaviour::package(K)); + inter_name *iname = Hierarchy::derive_iname_in(NEXT_INSTANCE_HL, Kinds::RunTime::iname(K), Kinds::Behaviour::package(K)); return iname; } inter_name *PL::Counting::instance_count_iname(kind *K) { - inter_name *iname = InterNames::letter_parametrised_name( - COUNT_INSTANCE_INAMEF, Kinds::RunTime::iname(K), COUNT_INSTANCE_INDERIV, Kinds::Behaviour::package(K)); + inter_name *iname = Hierarchy::derive_iname_in(COUNT_INSTANCE_HL, Kinds::RunTime::iname(K), Kinds::Behaviour::package(K)); return iname; } @@ -181,8 +178,7 @@ int PL::Counting::counting_compile_model_tables(void) { if (Kinds::Compare::lt(K, K_object)) { inter_name *iname = PL::Counting::first_instance(K); instance *next = PL::Counting::next_instance_of(NULL, K); - package_request *PR = Kinds::Behaviour::package(K); - packaging_state save = Packaging::enter(PR); + packaging_state save = Packaging::enter_home_of(iname); if (next) { Emit::named_iname_constant(iname, K_object, Instances::emitted_iname(next)); } else { diff --git a/inform7/core-module/Chapter 19/Tables.w b/inform7/core-module/Chapter 19/Tables.w index 8a702d169..3a3a3c741 100644 --- a/inform7/core-module/Chapter 19/Tables.w +++ b/inform7/core-module/Chapter 19/Tables.w @@ -316,10 +316,7 @@ void Tables::create_table(parse_node *PN) { if (connection != TABLE_IS_NEW) @ else @; -// InterNames::attach_memo(t->table_identifier, t->table_name_text); - if (connection == TABLE_IS_NEW) { -// InterNames::to_symbol(t->table_identifier); @; LOGIF(TABLES, "Created: $B\n", t); } diff --git a/inform7/core-module/Chapter 21/Focus and Outcome.w b/inform7/core-module/Chapter 21/Focus and Outcome.w index ce3043af4..ee97da9c5 100644 --- a/inform7/core-module/Chapter 21/Focus and Outcome.w +++ b/inform7/core-module/Chapter 21/Focus and Outcome.w @@ -228,8 +228,7 @@ named_rulebook_outcome *Rulebooks::Outcomes::rbno_by_name(wording W) { rbno->name = Nouns::new_proper_noun(W, NEUTER_GENDER, REGISTER_SINGULAR_NTOPT + PARSE_EXACTLY_NTOPT, MISCELLANEOUS_MC, Rvalues::from_named_rulebook_outcome(rbno)); - rbno->nro_iname = InterNames::one_off(I"outcome", R); - InterNames::attach_memo(rbno->nro_iname, W); + rbno->nro_iname = Hierarchy::make_iname_with_memo(OUTCOME_HL, R, W); return rbno; } diff --git a/inform7/core-module/Chapter 21/Rules.w b/inform7/core-module/Chapter 21/Rules.w index f6b26f49a..561a36fa5 100644 --- a/inform7/core-module/Chapter 21/Rules.w +++ b/inform7/core-module/Chapter 21/Rules.w @@ -47,6 +47,7 @@ typedef struct rule { struct inter_name *shell_routine_iname; struct inter_name *rule_extern_iname; /* if externally defined, this is the I6 routine */ struct text_stream *rule_extern_iname_as_text; /* and this is it in plain text */ + struct inter_name *xiname; struct inter_name *rule_extern_response_handler_iname; /* and this produces any response texts it has */ int do_not_import; /* veto importation of this from the Standard Rules precompiled inter code */ int defn_compiled; /* has the definition of this rule, if needed, been compiled yet? */ @@ -113,6 +114,7 @@ rule *Rules::new(wording W, int named) { R->defn_as_phrase = NULL; R->rule_extern_iname = NULL; R->rule_extern_iname_as_text = NULL; + R->xiname = NULL; R->rule_extern_response_handler_iname = NULL; R->name = W; R->italicised_text = EMPTY_WORDING; @@ -211,18 +213,15 @@ void Rules::set_I6_definition(rule *R, wchar_t *identifier) { Inter::Symbols::to_data(Emit::repository(), Packaging::incarnate(R->rule_package), InterNames::to_symbol(xiname), &v1, &v2); Emit::named_generic_constant(R->rule_extern_iname, v1, v2); Packaging::exit(save); + R->xiname = xiname; R->rule_extern_iname_as_text = Str::duplicate(XT); DISCARD_TEXT(XT); } inter_name *Rules::get_handler_definition(rule *R) { - if (R->rule_extern_response_handler_iname == NULL) { - TEMPORARY_TEXT(XT); - WRITE_TO(XT, "%SM", R->rule_extern_iname_as_text); + if (R->rule_extern_response_handler_iname == NULL) R->rule_extern_response_handler_iname = - Packaging::function_text(InterNames::one_off(I"responder_fn", R->rule_package), R->rule_package, XT); - DISCARD_TEXT(XT); - } + Hierarchy::derive_iname_in(RESPONDER_FN_HL, R->xiname, R->rule_package); return R->rule_extern_response_handler_iname; } diff --git a/inform7/core-module/Chapter 26/Routines.w b/inform7/core-module/Chapter 26/Routines.w index 10ce2f919..6b878af28 100644 --- a/inform7/core-module/Chapter 26/Routines.w +++ b/inform7/core-module/Chapter 26/Routines.w @@ -84,7 +84,7 @@ void Routines::end_in_current_package(void) { if ((currently_compiling_in_frame->allocated_pointers) || (currently_compiling_in_frame->no_formal_parameters_needed > 0)) { if (Packaging::houseed_in_function(public_name)) { - kernel_name = InterNames::one_off(I"kernel", public_name->eventual_owner); + kernel_name = Hierarchy::make_kernel_iname(public_name->eventual_owner); Inter::Symbols::set_flag(InterNames::to_symbol(kernel_name), MAKE_NAME_UNIQUE); } else { internal_error("routine not housed in function"); diff --git a/inform7/core-module/Chapter 27/Hierarchy Locations.w b/inform7/core-module/Chapter 27/Hierarchy Locations.w index 6721f62fe..56f8b8423 100644 --- a/inform7/core-module/Chapter 27/Hierarchy Locations.w +++ b/inform7/core-module/Chapter 27/Hierarchy Locations.w @@ -216,13 +216,17 @@ inter_name *HierarchyLocations::nrl_to_iname(named_resource_location *nrl) { return nrl->equates_to_iname; } -inter_name *HierarchyLocations::find_in_package(int id, package_request *P, wording W, compilation_module *C) { +inter_name *HierarchyLocations::find_in_package(int id, package_request *P, wording W, compilation_module *C, inter_name *derive_from) { if (nrls_created == FALSE) HierarchyLocations::create_nrls(); if ((id < 0) || (id >= MAX_HL) || (nrls_indexed_by_id[id] == NULL)) internal_error("bad nrl ID"); named_resource_location *nrl = nrls_indexed_by_id[id]; - if (nrl->requirements.any_package_of_this_type == NULL) internal_error("NRL accessed inappropriately"); - if ((P == NULL) || (P->eventual_type != nrl->requirements.any_package_of_this_type)) { + if ((nrl->requirements.any_package_of_this_type == NULL) && + (nrl->requirements.any_enclosure == FALSE)) internal_error("NRL accessed inappropriately"); + if (nrl->requirements.any_enclosure) { + if (Inter::Symbols::read_annotation(P->eventual_type, ENCLOSING_IANN) != 1) + internal_error("subpackage not in enclosing superpackage"); + } else if ((P == NULL) || (P->eventual_type != nrl->requirements.any_package_of_this_type)) { LOG("AN: %S, FPN: %S\n", nrl->access_name, nrl->function_package_name); LOG("Have type: $3, required: $3\n", P->eventual_type, nrl->requirements.any_package_of_this_type); internal_error("constant in wrong superpackage"); @@ -235,12 +239,20 @@ inter_name *HierarchyLocations::find_in_package(int id, package_request *P, word } else if (nrl->trans.generate_from >= 0) { TEMPORARY_TEXT(T); inter_name *temp_iname = NULL; - if (nrl->trans.localise) - temp_iname = InterNames::new_in(nrl->trans.generate_from, C); - else - temp_iname = InterNames::new(nrl->trans.generate_from); + if (derive_from) { + if (nrl->trans.faux_letter >= 0) + temp_iname = InterNames::letter_parametrised_name(nrl->trans.generate_from, derive_from, nrl->trans.faux_letter, P); + else + temp_iname = InterNames::new_derived(nrl->trans.generate_from, derive_from); + } else { + if (nrl->trans.localise) + temp_iname = InterNames::new_in(nrl->trans.generate_from, C); + else + temp_iname = InterNames::new(nrl->trans.generate_from); + } WRITE_TO(T, "%n", temp_iname); - @; + if (nrl->trans.faux_letter >= 0) iname = temp_iname; + else @; DISCARD_TEXT(T); } else { text_stream *T = NULL; diff --git a/inform7/core-module/Chapter 27/Hierarchy.w b/inform7/core-module/Chapter 27/Hierarchy.w index 6cca449b0..8254cbf13 100644 --- a/inform7/core-module/Chapter 27/Hierarchy.w +++ b/inform7/core-module/Chapter 27/Hierarchy.w @@ -9,6 +9,7 @@ void Hierarchy::establish(void) { home_for_weak_type_IDs = HierarchyLocations::blank(); Packaging::register_counter(I"code_block"); // This will be counter number 0 + Packaging::register_counter(I"kernel"); // This will be counter number 1 @; @; @@ -120,6 +121,8 @@ void Hierarchy::establish(void) { @e ACTIONS_HAP @e ACTION_BASE_NAME_HL +@e DOUBLE_SHARP_NAME_HL +@e PERFORM_FN_HL @e CHECK_RB_HL @e CARRY_OUT_RB_HL @e REPORT_RB_HL @@ -143,6 +146,8 @@ void Hierarchy::establish(void) { HierarchyLocations::ap(ACTIONS_HAP, local_actions, I"action", I"_action"); location_requirement in_action = HierarchyLocations::any_package_of_type(I"_action"); HierarchyLocations::con(ACTION_BASE_NAME_HL, NULL, Translation::generate(ACTION_BASE_INAMEF), in_action); + HierarchyLocations::con(DOUBLE_SHARP_NAME_HL, NULL, Translation::derive(ACTION_INAMEF), in_action); + HierarchyLocations::func(PERFORM_FN_HL, I"perform_fn", Translation::derive(ACTION_ROUTINE_INAMEF), in_action); HierarchyLocations::package(CHECK_RB_HL, I"check_rb", I"_rulebook", in_action); HierarchyLocations::package(CARRY_OUT_RB_HL, I"carry_out_rb", I"_rulebook", in_action); HierarchyLocations::package(REPORT_RB_HL, I"report_rb", I"_rulebook", in_action); @@ -454,6 +459,7 @@ void Hierarchy::establish(void) { @h Instances. @e INSTANCES_HAP +@e INSTANCE_HL @e BACKDROP_FOUND_IN_FN_HL @e REGION_FOUND_IN_FN_HL @e SHORT_NAME_FN_HL @@ -469,6 +475,7 @@ void Hierarchy::establish(void) { location_requirement local_instances = HierarchyLocations::local_submodule(instances); HierarchyLocations::ap(INSTANCES_HAP, local_instances, I"instance", I"_instance"); location_requirement in_instance = HierarchyLocations::any_package_of_type(I"_instance"); + HierarchyLocations::con(INSTANCE_HL, I"I", Translation::uniqued(), in_instance); HierarchyLocations::func(BACKDROP_FOUND_IN_FN_HL, I"backdrop_found_in_fn", Translation::uniqued(), in_instance); HierarchyLocations::func(SHORT_NAME_FN_HL, I"short_name_fn", Translation::generate(SHORT_NAME_ROUTINE_INAMEF), in_instance); HierarchyLocations::func(SHORT_NAME_PROPERTY_FN_HL, I"short_name_property_fn", Translation::generate(SHORT_NAME_PROPERTY_ROUTINE_INAMEF), in_instance); @@ -493,6 +500,8 @@ void Hierarchy::establish(void) { @e START_ROOM_INIS_HL @e START_TIME_INIS_HL @e DONE_INIS_HL +@e DIRECTIONS_HAP +@e DIRECTION_HL @ = submodule_identity *interactive_fiction = Packaging::register_submodule(I"interactive_fiction"); @@ -510,6 +519,9 @@ void Hierarchy::establish(void) { HierarchyLocations::con(START_ROOM_INIS_HL, I"START_ROOM_INIS", Translation::same(), synoptic_IF); HierarchyLocations::con(START_TIME_INIS_HL, I"START_TIME_INIS", Translation::same(), synoptic_IF); HierarchyLocations::con(DONE_INIS_HL, I"DONE_INIS", Translation::same(), synoptic_IF); + HierarchyLocations::ap(DIRECTIONS_HAP, synoptic_IF, I"direction", I"_direction"); + location_requirement in_direction = HierarchyLocations::any_package_of_type(I"_direction"); + HierarchyLocations::con(DIRECTION_HL, NULL, Translation::generate(DIRECTION_OBJECT_INAMEF), in_direction); @h Kinds. @@ -530,6 +542,9 @@ void Hierarchy::establish(void) { @e DEFAULT_CLOSURE_FN_HL @e GPR_FN_HL @e INSTANCE_GPR_FN_HL +@e FIRST_INSTANCE_HL +@e NEXT_INSTANCE_HL +@e COUNT_INSTANCE_HL @e KIND_INLINE_PROPERTIES_HAP @e KIND_INLINE_PROPERTY_HL @@ -567,6 +582,9 @@ void Hierarchy::establish(void) { HierarchyLocations::func(DEFAULT_CLOSURE_FN_HL, I"default_closure_fn", Translation::uniqued(), in_kind); HierarchyLocations::func(GPR_FN_HL, I"gpr_fn", Translation::uniqued(), in_kind); HierarchyLocations::func(INSTANCE_GPR_FN_HL, I"instance_gpr_fn", Translation::uniqued(), in_kind); + HierarchyLocations::con(FIRST_INSTANCE_HL, NULL, Translation::derive_lettered(FIRST_INSTANCE_INAMEF, FIRST_INSTANCE_INDERIV), in_kind); + HierarchyLocations::con(NEXT_INSTANCE_HL, NULL, Translation::derive_lettered(NEXT_INSTANCE_INAMEF, NEXT_INSTANCE_INDERIV), in_kind); + HierarchyLocations::con(COUNT_INSTANCE_HL, NULL, Translation::derive_lettered(COUNT_INSTANCE_INAMEF, COUNT_INSTANCE_INDERIV), in_kind); HierarchyLocations::ap(KIND_INLINE_PROPERTIES_HAP, in_kind, I"inline_property", I"_inline_property"); location_requirement in_kind_inline_property = HierarchyLocations::any_package_of_type(I"_inline_property"); HierarchyLocations::con(KIND_INLINE_PROPERTY_HL, I"inline", Translation::uniqued(), in_kind_inline_property); @@ -630,6 +648,7 @@ void Hierarchy::establish(void) { @h Properties. @e PROPERTIES_HAP +@e PROPERTY_HL @e EITHER_OR_GPR_FN_HL @e CCOUNT_PROPERTY_HL @@ -640,6 +659,7 @@ void Hierarchy::establish(void) { location_requirement local_properties = HierarchyLocations::local_submodule(properties); HierarchyLocations::ap(PROPERTIES_HAP, local_properties, I"property", I"_property"); location_requirement in_property = HierarchyLocations::any_package_of_type(I"_property"); + HierarchyLocations::con(PROPERTY_HL, I"P", Translation::same(), in_property); HierarchyLocations::func(EITHER_OR_GPR_FN_HL, I"either_or_GPR_fn", Translation::generate(GPR_FOR_EITHER_OR_PROPERTY_INAMEF), in_property); location_requirement synoptic_props = HierarchyLocations::synoptic_submodule(properties); @@ -733,6 +753,7 @@ void Hierarchy::establish(void) { @e EMPTY_RULEBOOK_INAME_HL @e OUTCOMES_HAP +@e OUTCOME_HL @e RULEBOOKS_HAP @e RUN_FN_HL @e RULEBOOK_STV_CREATOR_FN_HL @@ -751,6 +772,8 @@ void Hierarchy::establish(void) { location_requirement local_rulebooks = HierarchyLocations::local_submodule(rulebooks); HierarchyLocations::ap(OUTCOMES_HAP, local_rulebooks, I"rulebook_outcome", I"_outcome"); + location_requirement in_outcome = HierarchyLocations::any_package_of_type(I"_outcome"); + HierarchyLocations::con(OUTCOME_HL, I"outcome", Translation::uniqued(), in_outcome); HierarchyLocations::ap(RULEBOOKS_HAP, local_rulebooks, I"rulebook", I"_rulebook"); location_requirement in_rulebook = HierarchyLocations::any_package_of_type(I"_rulebook"); HierarchyLocations::func(RUN_FN_HL, I"run_fn", Translation::uniqued(), in_rulebook); @@ -769,6 +792,7 @@ void Hierarchy::establish(void) { @e SHELL_FN_HL @e RULE_FN_HL @e EXTERIOR_RULE_HL +@e RESPONDER_FN_HL @e RESPONSES_HAP @e AS_CONSTANT_HL @e AS_BLOCK_CONSTANT_HL @@ -786,6 +810,7 @@ void Hierarchy::establish(void) { HierarchyLocations::func(SHELL_FN_HL, I"shell_fn", Translation::generate_in(RULE_SHELL_ROUTINE_INAMEF), in_rule); HierarchyLocations::func(RULE_FN_HL, I"rule_fn", Translation::generate_in(PHRASE_INAMEF), in_rule); HierarchyLocations::con(EXTERIOR_RULE_HL, I"exterior_rule", Translation::uniqued(), in_rule); + HierarchyLocations::func(RESPONDER_FN_HL, I"responder_fn", Translation::derive(RESPONDER_INAMEF), in_rule); HierarchyLocations::ap(RESPONSES_HAP, in_rule, I"response", I"_response"); location_requirement in_response = HierarchyLocations::any_package_of_type(I"_response"); HierarchyLocations::con(AS_CONSTANT_HL, I"as_constant", Translation::uniqued(), in_response); @@ -836,7 +861,6 @@ void Hierarchy::establish(void) { @h Enclosed matter. -@e BLOCK_HL @e LITERALS_HAP @e TEXT_LITERAL_HL @e LIST_LITERAL_HL @@ -844,6 +868,7 @@ void Hierarchy::establish(void) { @e TEXT_SUBSTITUTION_FN_HL @e PROPOSITIONS_HAP @e PROPOSITION_HL +@e RTP_HL @e BLOCK_CONSTANTS_HAP @e BLOCK_CONSTANT_HL @e BOX_QUOTATIONS_HAP @@ -852,7 +877,6 @@ void Hierarchy::establish(void) { @ = location_requirement in_any_enclosure = HierarchyLocations::any_enclosure(); - HierarchyLocations::con(BLOCK_HL, I"block", Translation::uniqued(), in_any_enclosure); HierarchyLocations::ap(LITERALS_HAP, in_any_enclosure, I"literal", I"_literal"); location_requirement in_literal = HierarchyLocations::any_package_of_type(I"_literal"); HierarchyLocations::con(TEXT_LITERAL_HL, I"text", Translation::uniqued(), in_literal); @@ -868,6 +892,7 @@ void Hierarchy::establish(void) { HierarchyLocations::ap(BOX_QUOTATIONS_HAP, in_any_enclosure, I"block_constant", I"_box_quotation"); location_requirement in_box_quotation = HierarchyLocations::any_package_of_type(I"_box_quotation"); HierarchyLocations::func(BOX_QUOTATION_FN_HL, I"quotation_fn", Translation::uniqued(), in_box_quotation); + HierarchyLocations::con(RTP_HL, I"rtp", Translation::uniqued(), in_any_enclosure); @ @@ -880,11 +905,16 @@ void Hierarchy::establish(void) { @e K_FIGURE_NAME_XPACKAGE @e K_SOUND_NAME_XPACKAGE @e K_USE_OPTION_XPACKAGE +@e K_EXTERNAL_FILE_XPACKAGE +@e K_RULEBOOK_OUTCOME_XPACKAGE +@e K_RESPONSE_XPACKAGE +@e K_SCENE_XPACKAGE @e V_COMMAND_PROMPT_XPACKAGE @e NOTHING_HL @e OBJECT_HL @e TESTUSEOPTION_HL +@e PRINT_USE_OPTION_HL @e TABLEOFTABLES_HL @e TABLEOFVERBS_HL @e CAPSHORTNAME_HL @@ -896,6 +926,16 @@ void Hierarchy::establish(void) { @e TIME_TOKEN_INNER_HL @e TRUTH_STATE_TOKEN_INNER_HL +@e PRINT_TABLE_HL +@e PRINT_RULEBOOK_OUTCOME_HL +@e PRINT_RESPONSE_HL +@e PRINT_FIGURE_NAME_HL +@e PRINT_SOUND_NAME_HL +@e PRINT_EXTERNAL_FILE_NAME_HL +@e NO_EXTERNAL_FILES_HL +@e TABLEOFEXTERNALFILES_HL +@e PRINT_SCENE_HL + @ @ = @@ -915,23 +955,41 @@ void Hierarchy::establish(void) { location_requirement in_K_table = HierarchyLocations::this_exotic_package(K_TABLE_XPACKAGE); HierarchyLocations::con(TABLEOFTABLES_HL, I"TableOfTables", Translation::same(), in_K_table); + HierarchyLocations::func(PRINT_TABLE_HL, I"print_fn", Translation::to(I"PrintTableName"), in_K_table); location_requirement in_K_verb = HierarchyLocations::this_exotic_package(K_VERB_XPACKAGE); HierarchyLocations::con(TABLEOFVERBS_HL, I"TableOfVerbs", Translation::same(), in_K_verb); location_requirement in_K_figure_name = HierarchyLocations::this_exotic_package(K_FIGURE_NAME_XPACKAGE); HierarchyLocations::con(RESOURCEIDSOFFIGURES_HL, I"ResourceIDsOfFigures", Translation::same(), in_K_figure_name); + HierarchyLocations::func(PRINT_FIGURE_NAME_HL, I"print_fn", Translation::to(I"PrintFigureName"), in_K_figure_name); location_requirement in_K_sound_name = HierarchyLocations::this_exotic_package(K_SOUND_NAME_XPACKAGE); HierarchyLocations::con(RESOURCEIDSOFSOUNDS_HL, I"ResourceIDsOfSounds", Translation::same(), in_K_sound_name); + HierarchyLocations::func(PRINT_SOUND_NAME_HL, I"print_fn", Translation::to(I"PrintSoundName"), in_K_sound_name); location_requirement in_K_use_option = HierarchyLocations::this_exotic_package(K_USE_OPTION_XPACKAGE); HierarchyLocations::con(NO_USE_OPTIONS_HL, I"NO_USE_OPTIONS", Translation::same(), in_K_use_option); HierarchyLocations::func(TESTUSEOPTION_HL, I"test_fn", Translation::to(I"TestUseOption"), in_K_use_option); + HierarchyLocations::func(PRINT_USE_OPTION_HL, I"print_fn", Translation::to(I"PrintUseOption"), in_K_use_option); location_requirement in_V_command_prompt = HierarchyLocations::this_exotic_package(V_COMMAND_PROMPT_XPACKAGE); HierarchyLocations::func(COMMANDPROMPTTEXT_HL, I"command_prompt_text_fn", Translation::to(I"CommandPromptText"), in_V_command_prompt); + location_requirement in_K_external_file = HierarchyLocations::this_exotic_package(K_EXTERNAL_FILE_XPACKAGE); + HierarchyLocations::con(NO_EXTERNAL_FILES_HL, I"NO_EXTERNAL_FILES", Translation::same(), in_K_external_file); + HierarchyLocations::con(TABLEOFEXTERNALFILES_HL, I"TableOfExternalFiles", Translation::same(), in_K_external_file); + HierarchyLocations::func(PRINT_EXTERNAL_FILE_NAME_HL, I"print_fn", Translation::to(I"PrintExternalFileName"), in_K_external_file); + + location_requirement in_K_rulebook_outcome = HierarchyLocations::this_exotic_package(K_RULEBOOK_OUTCOME_XPACKAGE); + HierarchyLocations::func(PRINT_RULEBOOK_OUTCOME_HL, I"print_fn", Translation::to(I"RulebookOutcomePrintingRule"), in_K_rulebook_outcome); + + location_requirement in_K_response = HierarchyLocations::this_exotic_package(K_RESPONSE_XPACKAGE); + HierarchyLocations::func(PRINT_RESPONSE_HL, I"print_fn", Translation::to(I"PrintResponse"), in_K_response); + + location_requirement in_K_scene = HierarchyLocations::this_exotic_package(K_SCENE_XPACKAGE); + HierarchyLocations::func(PRINT_SCENE_HL, I"print_fn", Translation::to(I"PrintSceneName"), in_K_scene); + @ @e ACT_REQUESTER_HL @@ -1423,6 +1481,10 @@ package_request *Hierarchy::exotic_package(int x) { case K_FIGURE_NAME_XPACKAGE: return Kinds::Behaviour::package(K_figure_name); case K_SOUND_NAME_XPACKAGE: return Kinds::Behaviour::package(K_sound_name); case K_USE_OPTION_XPACKAGE: return Kinds::Behaviour::package(K_use_option); + case K_EXTERNAL_FILE_XPACKAGE: return Kinds::Behaviour::package(K_external_file); + case K_RULEBOOK_OUTCOME_XPACKAGE: return Kinds::Behaviour::package(K_rulebook_outcome); + case K_RESPONSE_XPACKAGE: return Kinds::Behaviour::package(K_response); + case K_SCENE_XPACKAGE: return Kinds::Behaviour::package(K_scene); case V_COMMAND_PROMPT_XPACKAGE: return Packaging::home_of(NonlocalVariables::iname(command_prompt_VAR)); } @@ -1528,19 +1590,27 @@ package_request *Hierarchy::package_within(int hap_id, package_request *super) { } inter_name *Hierarchy::make_iname_in(int id, package_request *P) { - return HierarchyLocations::find_in_package(id, P, EMPTY_WORDING, NULL); + return HierarchyLocations::find_in_package(id, P, EMPTY_WORDING, NULL, NULL); +} + +inter_name *Hierarchy::derive_iname_in(int id, inter_name *derive_from, package_request *P) { + return HierarchyLocations::find_in_package(id, P, EMPTY_WORDING, NULL, derive_from); } inter_name *Hierarchy::make_localised_iname_in(int id, package_request *P, compilation_module *C) { - return HierarchyLocations::find_in_package(id, P, EMPTY_WORDING, C); + return HierarchyLocations::find_in_package(id, P, EMPTY_WORDING, C, NULL); } inter_name *Hierarchy::make_block_iname(package_request *P) { return Packaging::supply_iname(P, 0); } +inter_name *Hierarchy::make_kernel_iname(package_request *P) { + return Packaging::supply_iname(P, 1); +} + inter_name *Hierarchy::make_iname_with_memo(int id, package_request *P, wording W) { - return HierarchyLocations::find_in_package(id, P, W, NULL); + return HierarchyLocations::find_in_package(id, P, W, NULL, NULL); } package_request *Hierarchy::make_package_in(int id, package_request *P) { diff --git a/inform7/core-module/Chapter 27/Inter Namespace.w b/inform7/core-module/Chapter 27/Inter Namespace.w index e223b60c0..aceebc4fe 100644 --- a/inform7/core-module/Chapter 27/Inter Namespace.w +++ b/inform7/core-module/Chapter 27/Inter Namespace.w @@ -397,6 +397,7 @@ int InterNames::defined(inter_name *iname) { @e LABEL_STORAGE_INAMEF @e ICOUNT_CONSTANT_INAMEF @e WEAK_ID_CONSTANT_INAMEF +@e RESPONDER_INAMEF @e FINAL_INAMEF @@ -440,11 +441,6 @@ inter_name *InterNames::new_overridden(int fnum, text_stream *identifier) { inter_name *InterNames::new_derived(int fnum, inter_name *from) { inter_name_family *F = InterNames::get_family(fnum); if (F->fusage != DERIVED_FUSAGE) internal_error("not a derived family"); -// if (from->family != F->derivative_of) { -// LOG("From = %n in $X\n", from, Packaging::home_of(from)); -// LOG("From family %S but derivative should be of %S\n", from->family->family_name, F->derivative_of->family_name); -// internal_error("derived from name of wrong family"); -// } inter_name *N = InterNames::new_in_space(InterNames::root(), F, TRUE); Packaging::house_with(N, from); N->derived_from = from; @@ -522,7 +518,7 @@ inter_name *InterNames::letter_parametrised_name(int family, inter_name *rname, if ((marker < 0) || (marker >= FINAL_INDERIV)) internal_error("respomse parameter out of range"); if (rname->parametrised_derivatives[marker] == NULL) { rname->parametrised_derivatives[marker] = InterNames::new(family); - Packaging::house(rname->parametrised_derivatives[marker], R); + if (R) Packaging::house(rname->parametrised_derivatives[marker], R); rname->parametrised_derivatives[marker]->derived_from = rname; } @@ -654,6 +650,7 @@ inter_name_family *InterNames::get_family(int fnum) { case VARIABLE_INAMEF: S = I"V"; break; case VERB_DECLARATION_ARRAY_INAMEF: S = I"GV_Grammar"; break; case WEAK_ID_CONSTANT_INAMEF: S = I"always_overridden"; break; + case RESPONDER_INAMEF: D = RULE_SHELL_ROUTINE_INAMEF; Suf = I"M"; break; } if ((S) || (D >= 0)) { diff --git a/inform7/core-module/Chapter 27/Translation.w b/inform7/core-module/Chapter 27/Translation.w index e81d365ae..165891a02 100644 --- a/inform7/core-module/Chapter 27/Translation.w +++ b/inform7/core-module/Chapter 27/Translation.w @@ -8,6 +8,8 @@ typedef struct name_translation { int then_make_unique; int generate_from; int localise; + int derive; + int faux_letter; } name_translation; name_translation Translation::same(void) { @@ -16,6 +18,8 @@ name_translation Translation::same(void) { nt.then_make_unique = FALSE; nt.generate_from = -1; nt.localise = FALSE; + nt.derive = FALSE; + nt.faux_letter = -1; return nt; } @@ -38,6 +42,21 @@ name_translation Translation::to_uniqued(text_stream *S) { return nt; } +name_translation Translation::derive(int f) { + name_translation nt = Translation::same(); + nt.generate_from = f; + nt.derive = TRUE; + return nt; +} + +name_translation Translation::derive_lettered(int f, int faux_letter) { + name_translation nt = Translation::same(); + nt.generate_from = f; + nt.derive = TRUE; + nt.faux_letter = faux_letter; + return nt; +} + name_translation Translation::generate(int f) { name_translation nt = Translation::same(); nt.generate_from = f; diff --git a/inform7/core-module/Chapter 5/Nonlocal Variables.w b/inform7/core-module/Chapter 5/Nonlocal Variables.w index 8cbf097bc..d3c16f783 100644 --- a/inform7/core-module/Chapter 5/Nonlocal Variables.w +++ b/inform7/core-module/Chapter 5/Nonlocal Variables.w @@ -429,7 +429,6 @@ int NonlocalVariables::SUBJ_compile_all(void) { text_stream *rvalue = NULL; if (nlv->housed_in_variables_array == FALSE) rvalue = NonlocalVariables::identifier(nlv); -LOG("Doing stuff with %W %n %S as rvalue\n", nlv->name, iname, rvalue); Emit::variable(iname, nlv->nlv_kind, v1, v2, rvalue); if (nlv == command_prompt_VAR) { packaging_state save = Routines::begin(Hierarchy::find(COMMANDPROMPTTEXT_HL)); diff --git a/inform7/core-module/Chapter 5/Using Nametags.w b/inform7/core-module/Chapter 5/Using Nametags.w index f5c2cd77e..7f683f0bb 100644 --- a/inform7/core-module/Chapter 5/Using Nametags.w +++ b/inform7/core-module/Chapter 5/Using Nametags.w @@ -29,9 +29,7 @@ int UseNouns::iname_set(noun *t) { void UseNouns::noun_compose_identifier(package_request *R, noun *t, int N) { if (t->nt_iname == NULL) { wording W = Nouns::get_name(t, FALSE); - t->nt_iname = InterNames::one_off(I"I", R); - if (Wordings::nonempty(W)) InterNames::attach_memo(t->nt_iname, W); - Inter::Symbols::set_flag(InterNames::to_symbol(t->nt_iname), MAKE_NAME_UNIQUE); + t->nt_iname = Hierarchy::make_iname_with_memo(INSTANCE_HL, R, W); } } diff --git a/inform7/if-module/Chapter 3/The Map.w b/inform7/if-module/Chapter 3/The Map.w index 4d213fcc1..361705f9e 100644 --- a/inform7/if-module/Chapter 3/The Map.w +++ b/inform7/if-module/Chapter 3/The Map.w @@ -320,8 +320,8 @@ int PL::Map::map_set_kind_notify(instance *I, kind *k) { @ = registered_directions++; - inter_name *dname = InterNames::new(DIRECTION_OBJECT_INAMEF); - Packaging::house(dname, Kinds::Behaviour::package(K_direction)); + package_request *PR = Hierarchy::synoptic_package(DIRECTIONS_HAP); + inter_name *dname = Hierarchy::make_iname_in(DIRECTION_HL, PR); PF_I(map, I)->direction_iname = dname; PL::MapDirections::make_mapped_predicate(I, dname); diff --git a/inform7/if-module/Chapter 4/Actions.w b/inform7/if-module/Chapter 4/Actions.w index 94e8cc744..2edec1dd4 100644 --- a/inform7/if-module/Chapter 4/Actions.w +++ b/inform7/if-module/Chapter 4/Actions.w @@ -423,8 +423,7 @@ action_name *PL::Actions::Wait(void) { inter_name *PL::Actions::double_sharp(action_name *an) { if (an->an_iname == NULL) { - an->an_iname = InterNames::new_derived(ACTION_INAMEF, an->an_base_iname); - Packaging::house(an->an_iname, an->an_package); + an->an_iname = Hierarchy::derive_iname_in(DOUBLE_SHARP_NAME_HL, an->an_base_iname, an->an_package); packaging_state save = Packaging::enter(an->an_package); Emit::ds_named_pseudo_numeric_constant(an->an_iname, K_value, (inter_t) an->allocation_id); InterNames::annotate_i(an->an_iname, ACTION_IANN, 1); @@ -434,13 +433,8 @@ inter_name *PL::Actions::double_sharp(action_name *an) { } inter_name *PL::Actions::Sub(action_name *an) { - if (an->an_routine_iname == NULL) { - an->an_routine_iname = - Packaging::function( - InterNames::one_off(I"perform_fn", an->an_package), - an->an_package, - InterNames::new_derived(ACTION_ROUTINE_INAMEF, an->an_base_iname)); - } + if (an->an_routine_iname == NULL) + an->an_routine_iname = Hierarchy::derive_iname_in(PERFORM_FN_HL, an->an_base_iname, an->an_package); return an->an_routine_iname; } diff --git a/inform7/kinds-module/Chapter 2/Using Kinds.w b/inform7/kinds-module/Chapter 2/Using Kinds.w index fede11780..15bf15012 100644 --- a/inform7/kinds-module/Chapter 2/Using Kinds.w +++ b/inform7/kinds-module/Chapter 2/Using Kinds.w @@ -448,20 +448,42 @@ inter_name *Kinds::Behaviour::get_iname(kind *K) { internal_error("null kind has no printing routine"); } if (K->construct->pr_iname) return K->construct->pr_iname; - package_request *R = NULL; - int external = TRUE; + if (Kinds::Compare::eq(K, K_use_option)) { - R = Kinds::Behaviour::package(K); external = FALSE; - } - if (Kinds::Compare::eq(K, K_rulebook_outcome)) { - R = Kinds::Behaviour::package(K); external = FALSE; - } - if (Kinds::Compare::eq(K, K_response)) { - R = Kinds::Behaviour::package(K); external = FALSE; + K->construct->pr_iname = Hierarchy::find(PRINT_USE_OPTION_HL); + return K->construct->pr_iname; } if (Kinds::Compare::eq(K, K_table)) { - R = Kinds::Behaviour::package(K); external = FALSE; + K->construct->pr_iname = Hierarchy::find(PRINT_TABLE_HL); + return K->construct->pr_iname; } + if (Kinds::Compare::eq(K, K_rulebook_outcome)) { + K->construct->pr_iname = Hierarchy::find(PRINT_RULEBOOK_OUTCOME_HL); + return K->construct->pr_iname; + } + if (Kinds::Compare::eq(K, K_response)) { + K->construct->pr_iname = Hierarchy::find(PRINT_RESPONSE_HL); + return K->construct->pr_iname; + } + if (Kinds::Compare::eq(K, K_figure_name)) { + K->construct->pr_iname = Hierarchy::find(PRINT_FIGURE_NAME_HL); + return K->construct->pr_iname; + } + if (Kinds::Compare::eq(K, K_sound_name)) { + K->construct->pr_iname = Hierarchy::find(PRINT_SOUND_NAME_HL); + return K->construct->pr_iname; + } + if (Kinds::Compare::eq(K, K_external_file)) { + K->construct->pr_iname = Hierarchy::find(PRINT_EXTERNAL_FILE_NAME_HL); + return K->construct->pr_iname; + } + if (Kinds::Compare::eq(K, K_scene)) { + K->construct->pr_iname = Hierarchy::find(PRINT_SCENE_HL); + return K->construct->pr_iname; + } + + package_request *R = NULL; + int external = TRUE; if ((Kinds::get_construct(K) == CON_rule) || (Kinds::get_construct(K) == CON_rulebook)) external = TRUE; if (Kinds::Behaviour::is_an_enumeration(K)) { @@ -475,22 +497,15 @@ inter_name *Kinds::Behaviour::get_iname(kind *K) { if (Kinds::Compare::eq(K, K_number)) external = TRUE; if (Kinds::Compare::eq(K, K_real_number)) external = TRUE; if (Str::len(X) == 0) X = I"DecimalNumber"; + if (R) { if (external) { -// LOG("Here for $u with %S\n", K, X); K->construct->pr_iname = Hierarchy::make_iname_in(PRINT_FN_HL, R); -// LOG("Made $3\n", K->construct->pr_iname); inter_name *actual_iname = Hierarchy::find_by_name(X); packaging_state save = Packaging::enter_home_of(K->construct->pr_iname); Emit::named_iname_constant(K->construct->pr_iname, K_value, actual_iname); Packaging::exit(save); - } else { - K->construct->pr_iname = - Packaging::function_text( - InterNames::one_off(I"print_fn", R), - R, - X); - } + } else internal_error("internal but unknown kind printing routine"); } else { if (external) K->construct->pr_iname = Hierarchy::find_by_name(X); else internal_error("internal but unpackaged kind printing routine"); diff --git a/inform7/multimedia-module/Chapter 2/External Files.w b/inform7/multimedia-module/Chapter 2/External Files.w index a0019524e..5b3270800 100644 --- a/inform7/multimedia-module/Chapter 2/External Files.w +++ b/inform7/multimedia-module/Chapter 2/External Files.w @@ -254,9 +254,8 @@ External files are written in I6 as their array names: void PL::Files::arrays(void) { if (Plugins::Manage::plugged_in(files_plugin) == FALSE) return; - package_request *PR = Kinds::Behaviour::package(K_external_file); - inter_name *iname = InterNames::one_off(I"NO_EXTERNAL_FILES", PR); - packaging_state save = Packaging::enter(PR); + inter_name *iname = Hierarchy::find(NO_EXTERNAL_FILES_HL); + packaging_state save = Packaging::enter_home_of(iname); Emit::named_numeric_constant(iname, (inter_t) (NUMBER_CREATED(external_file))); Packaging::exit(save); @@ -297,8 +296,8 @@ void PL::Files::arrays(void) { Packaging::exit(save); } - iname = InterNames::one_off(I"TableOfExternalFiles", PR); - save = Packaging::enter(PR); + iname = Hierarchy::find(TABLEOFEXTERNALFILES_HL); + save = Packaging::enter_home_of(iname); Emit::named_array_begin(iname, K_value); Emit::array_numeric_entry(0); LOOP_OVER(exf, external_file) Emit::array_iname_entry(exf->exf_iname);