diff --git a/docs/core-module/12-cdp.html b/docs/core-module/12-cdp.html index 3d688c987..6acee13c1 100644 --- a/docs/core-module/12-cdp.html +++ b/docs/core-module/12-cdp.html @@ -2355,8 +2355,7 @@ then expand it into the output. if ((K) && (parent_optimised == FALSE)) { parent optimisation is stronger, so we prefer that 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 = Hierarchy::make_iname_in(RTP_HL, P); + pdef->rtp_iname = Hierarchy::make_iname_in(RTP_HL, pdef->ppd_package); } Calculus::Schemas::modify(&loop_schema, "if (RunTimeProblem(RTP_CANTITERATE, %n))", pdef->rtp_iname); diff --git a/docs/core-module/12-dtd.html b/docs/core-module/12-dtd.html index 478bb53cc..2dca874f4 100644 --- a/docs/core-module/12-dtd.html +++ b/docs/core-module/12-dtd.html @@ -43,6 +43,7 @@ for a number of different reasons, enumerated as follows: struct parse_node *deferred_from; remember where it came from, for Problem reports struct general_pointer defn_ref; sometimes we must remember other things too struct kind *cinder_kinds[16]; the kinds of value being cindered (see below) + struct package_request *ppd_package; where to put both of the following: struct inter_name *ppd_iname; routine to implement this struct inter_name *rtp_iname; compile a string of the origin text for run-time problems? MEMORY_MANAGEMENT @@ -80,8 +81,8 @@ all deferral requests are redeemed — they would then never be reached. pdef->reason = reason; pdef->deferred_from = current_sentence; pdef->rtp_iname = NULL; - package_request *PR = Hierarchy::package_in_enclosure(PROPOSITIONS_HAP); - pdef->ppd_iname = Hierarchy::make_iname_in(PROPOSITION_HL, PR); + pdef->ppd_package = Hierarchy::package_in_enclosure(PROPOSITIONS_HAP); + pdef->ppd_iname = Hierarchy::make_iname_in(PROPOSITION_HL, pdef->ppd_package); if (no_further_deferrals) internal_error("Too late now to defer propositions"); return pdef; diff --git a/docs/core-module/13-rsfk.html b/docs/core-module/13-rsfk.html index 967357f8c..2d17d4afd 100644 --- a/docs/core-module/13-rsfk.html +++ b/docs/core-module/13-rsfk.html @@ -11,7 +11,7 @@
To compile I6 material needed at runtime to enable kinds to function as they should.
-Class<
-The function Kinds::RunTime::I6_classname is used in §26, 6/bp (§25), 6/rlt (§29.2, §29.3, §29.4, §29.5, §29.6), 12/ter (§8.6), 12/ca (§6.2), 12/dtd (§24), 13/kak (§2), 25/cii (§3.1.1.4.7.1), 26/iti (§9), 27/hr (§4), 27/is (§31.8.1).
+The function Kinds::RunTime::I6_classname is used in §25, 6/bp (§25), 6/rlt (§29.2, §29.3, §29.4, §29.5, §29.6), 12/ter (§8.6), 12/ca (§6.2), 12/dtd (§24), 13/kak (§2), 25/cii (§3.1.1.4.7.1), 26/iti (§9), 27/hr (§4), 27/is (§31.8.1).
-The function Kinds::RunTime::I6_classnumber is used in §24, 16/ic (§6, §10).
+The function Kinds::RunTime::I6_classnumber is used in §23, 16/ic (§6, §10).
§4. Default values. When we create a new variable (or other storage object) of a given kind, but
never say what its value is to be, Inform tries to initialise it to the
@@ -185,7 +185,7 @@ chosen), but no problem message has been issued about this, or
The function Kinds::RunTime::emit_default_value is used in 19/rsft (§1.1.1.1.1.5).
-The function Kinds::RunTime::emit_default_value_as_val is used in §25.6.2, 22/pav (§9.2), 24/lv (§43), 25/cii (§3.2.1, §3.5.3), 25/cp (§3.3.1).
+The function Kinds::RunTime::emit_default_value_as_val is used in §24.6.2, 22/pav (§9.2), 24/lv (§43), 25/cii (§3.2.1, §3.5.3), 25/cp (§3.3.1).
The function Kinds::RunTime::compile_default_value_vh is used in 5/nv (§25.1), 15/vp (§11).
@@ -534,7 +534,7 @@ like variables. That's what makes them intermediate.)
-The function Kinds::RunTime::weak_id is used in §9, §25, §25.1, 4/am (§20, §29.1, §30, §34.2).
+The function Kinds::RunTime::weak_id is used in §9, §24, §24.1, 4/am (§20, §29.1, §30, §34.2).
§9. And the following compiles an easier-on-the-eye form of the weak ID, but
which might occupy up to 31 characters, the maximum length of an I6 identifier:
@@ -572,7 +572,7 @@ which might occupy up to 31 characters, the maximum length of an I6 identifier:
The function Kinds::RunTime::emit_weak_id is used in §12, §16.1, §20.
-The function Kinds::RunTime::emit_weak_id_as_val is used in §12, §25.6.1, §25.6.2, §25.6.3, §25.6.4, §25.6.5, §25.6.6, 12/is (§8), 14/lv (§14.3), 21/fao (§10), 25/cii (§3.2.8).
+The function Kinds::RunTime::emit_weak_id_as_val is used in §12, §24.6.1, §24.6.2, §24.6.3, §24.6.4, §24.6.5, §24.6.6, 12/is (§8), 14/lv (§14.3), 21/fao (§10), 25/cii (§3.2.8).
§10. The strong ID is a faithful representation of the kind
structure,
so we don't need access to its value for comparison purposes; we just need
@@ -791,7 +791,7 @@ values for kinds, since both involve tracking constructions uniquely.
if (K == NULL) return NULL;
kind_constructor *con = Kinds::get_construct(K);
if (con->kind_GPR_iname == NULL) {
- package_request *R = Kinds::RunTime::package(K);
+ package_request *R = Kinds::Behaviour::package(K);
con->kind_GPR_iname = Hierarchy::make_iname_in(GPR_FN_HL, R);
}
return con->kind_GPR_iname;
@@ -801,7 +801,7 @@ values for kinds, since both involve tracking constructions uniquely.
if (K == NULL) return NULL;
kind_constructor *con = Kinds::get_construct(K);
if (con->instance_GPR_iname == NULL) {
- package_request *R = Kinds::RunTime::package(K);
+ package_request *R = Kinds::Behaviour::package(K);
con->instance_GPR_iname = Hierarchy::make_iname_in(INSTANCE_GPR_FN_HL, R);
}
return con->instance_GPR_iname;
@@ -945,7 +945,6 @@ K, we have also seen its bases.
inter_name *identifier = rks->rks_dv_iname;
current_sentence = rks->default_requested_here;
- packaging_state save = Packaging::enter_home_of(identifier);
if (Kinds::get_construct(K) == CON_phrase) {
Phrases::Constants::compile_default_closure(identifier, K);
} else if (Kinds::get_construct(K) == CON_relation) {
@@ -961,7 +960,6 @@ K, we have also seen its bases.
"for the kind '%2', but there's no obvious way to make one.");
Problems::issue_problem_end();
}
- Packaging::exit(save);
@@ -1197,27 +1195,13 @@ each such kind, and needed at run-time.
-The function Kinds::RunTime::base_represented_in_inter is used in §23, §24, §25.
+The function Kinds::RunTime::base_represented_in_inter is used in §22, §23, §24.
The structure kind_interaction is private to this section.
-
- package_request *Kinds::RunTime::package(kind *K) {
- inter_name *iname = Kinds::RunTime::iname(K);
- return Packaging::home_of(iname);
- }
-
-
-
-
-The function Kinds::RunTime::package is used in §15, 15/epv (§2), 22/pav (§9), 27/ei (§3).
-
-
-
-
define MAX_KIND_ARITY 32
@@ -1239,13 +1223,13 @@ each such kind, and needed at run-time.
kind *operands[MAX_KIND_ARITY];
int icon = -1;
inter_t idt = ROUTINE_IDT;
- if (Kinds::get_construct(K) == CON_description) <Run out inter kind for description 23.2>
- else if (Kinds::get_construct(K) == CON_list_of) <Run out inter kind for list 23.1>
- else if (Kinds::get_construct(K) == CON_phrase) <Run out inter kind for phrase 23.5>
- else if (Kinds::get_construct(K) == CON_rule) <Run out inter kind for rule 23.6>
- else if (Kinds::get_construct(K) == CON_rulebook) <Run out inter kind for rulebook 23.7>
- else if (Kinds::get_construct(K) == CON_table_column) <Run out inter kind for column 23.3>
- else if (Kinds::get_construct(K) == CON_relation) <Run out inter kind for relation 23.4>
+ if (Kinds::get_construct(K) == CON_description) <Run out inter kind for description 22.2>
+ else if (Kinds::get_construct(K) == CON_list_of) <Run out inter kind for list 22.1>
+ else if (Kinds::get_construct(K) == CON_phrase) <Run out inter kind for phrase 22.5>
+ else if (Kinds::get_construct(K) == CON_rule) <Run out inter kind for rule 22.6>
+ else if (Kinds::get_construct(K) == CON_rulebook) <Run out inter kind for rulebook 22.7>
+ else if (Kinds::get_construct(K) == CON_table_column) <Run out inter kind for column 22.3>
+ else if (Kinds::get_construct(K) == CON_relation) <Run out inter kind for relation 22.4>
else {
LOG("Unfortunate kind is: $u\n", K);
internal_error("unable to represent kind in inter");
@@ -1259,10 +1243,10 @@ each such kind, and needed at run-time.
-The function Kinds::RunTime::iname is used in §3, §22, §25, 15/epv (§1), 16/ic (§10), 27/ei (§2).
+The function Kinds::RunTime::iname is used in §3, §24, 15/epv (§1), 16/ic (§10), 27/ei (§2).
-§23.1.
-<Run out inter kind for list 23.1> =
+§22.1.
+<Run out inter kind for list 22.1> =
@@ -1275,10 +1259,10 @@ each such kind, and needed at run-time.
-This code is used in §23.
+This code is used in §22.
-§23.2.
-<Run out inter kind for description 23.2> =
+§22.2.
+<Run out inter kind for description 22.2> =
@@ -1290,10 +1274,10 @@ each such kind, and needed at run-time.
-This code is used in §23.
+This code is used in §22.
-§23.3.
-<Run out inter kind for column 23.3> =
+§22.3.
+<Run out inter kind for column 22.3> =
@@ -1305,10 +1289,10 @@ each such kind, and needed at run-time.
-This code is used in §23.
+This code is used in §22.
-§23.4.
-<Run out inter kind for relation 23.4> =
+§22.4.
+<Run out inter kind for relation 22.4> =
@@ -1320,10 +1304,10 @@ each such kind, and needed at run-time.
-This code is used in §23.
+This code is used in §22.
-§23.5.
-<Run out inter kind for phrase 23.5> =
+§22.5.
+<Run out inter kind for phrase 22.5> =
@@ -1344,10 +1328,10 @@ each such kind, and needed at run-time.
-This code is used in §23.
+This code is used in §22.
-§23.6.
-<Run out inter kind for rule 23.6> =
+§22.6.
+<Run out inter kind for rule 22.6> =
@@ -1359,10 +1343,10 @@ each such kind, and needed at run-time.
-This code is used in §23.
+This code is used in §22.
-§23.7.
-<Run out inter kind for rulebook 23.7> =
+§22.7.
+<Run out inter kind for rulebook 22.7> =
@@ -1376,9 +1360,9 @@ each such kind, and needed at run-time.
-This code is used in §23.
+This code is used in §22.
-
+
@@ -1418,13 +1402,13 @@ each such kind, and needed at run-time.
-The function Kinds::RunTime::iname_inner is used in §23.
+The function Kinds::RunTime::iname_inner is used in §22.
The function Kinds::RunTime::assure_iname_exists is used in 5/un (§2).
The function Kinds::RunTime::constructed_kind_name appears nowhere else.
-
+
@@ -1498,9 +1482,9 @@ each such kind, and needed at run-time.
if (Kinds::Behaviour::stored_as(K) == NULL)
if (Kinds::Behaviour::is_an_enumeration(K)) {
inter_name *printing_rule_name = Kinds::Behaviour::get_iname(K);
- <Compile I6 printing routine for an enumerated kind 25.3>;
- <Compile the A and B routines for an enumerated kind 25.4>;
- <Compile random-ranger routine for this kind 25.5>;
+ <Compile I6 printing routine for an enumerated kind 24.3>;
+ <Compile the A and B routines for an enumerated kind 24.4>;
+ <Compile random-ranger routine for this kind 24.5>;
}
}
LOOP_OVER_BASE_KINDS(K) {
@@ -1510,15 +1494,15 @@ each such kind, and needed at run-time.
if (Kinds::Behaviour::stored_as(K) == NULL) {
inter_name *printing_rule_name = Kinds::Behaviour::get_iname(K);
if (Kinds::Behaviour::is_quasinumerical(K)) {
- <Compile I6 printing routine for a unit kind 25.2>;
- <Compile random-ranger routine for this kind 25.5>;
+ <Compile I6 printing routine for a unit kind 24.2>;
+ <Compile random-ranger routine for this kind 24.5>;
} else {
- <Compile I6 printing routine for a vacant but named kind 25.1>;
+ <Compile I6 printing routine for a vacant but named kind 24.1>;
}
}
}
- <Compile a suite of I6 routines taking kind IDs as arguments 25.6>;
+ <Compile a suite of I6 routines taking kind IDs as arguments 24.6>;
}
@@ -1534,7 +1518,7 @@ each such kind, and needed at run-time.
The function Kinds::RunTime::compile_data_type_support_routines is used in 1/mr (§4.14).
-§25.1. A slightly bogus case first. If the source text declares a kind but never
+
§24.1. A slightly bogus case first. If the source text declares a kind but never
gives any enumerated values or literal patterns, then such values will never
appear at run-time; but we need the printing routine to exist to avoid
compilation errors.
@@ -1542,7 +1526,7 @@ compilation errors.
-<Compile I6 printing routine for a vacant but named kind 25.1> =
+<Compile I6 printing routine for a vacant but named kind 24.1> =
@@ -1562,16 +1546,16 @@ compilation errors.
-This code is used in §25.
+This code is used in §24.
-§25.2. A unit is printed back with its earliest-defined literal pattern used as
+
§24.2. A unit is printed back with its earliest-defined literal pattern used as
notation. If it had no literal patterns, it would come out as decimal numbers,
but at present this can't happen.
-<Compile I6 printing routine for a unit kind 25.2> =
+<Compile I6 printing routine for a unit kind 24.2> =
@@ -1592,10 +1576,10 @@ but at present this can't happen.
-This code is used in §25.
+This code is used in §24.
-§25.3.
-<Compile I6 printing routine for an enumerated kind 25.3> =
+§24.3.
+<Compile I6 printing routine for an enumerated kind 24.3> =
@@ -1654,9 +1638,9 @@ but at present this can't happen.
-This code is used in §25.
+This code is used in §24.
-§25.4. The suite of standard routines provided for enumerative types is a little
+
§24.4. The suite of standard routines provided for enumerative types is a little
like the one in Ada (T'Succ
, T'Pred
, and so on).
@@ -1673,7 +1657,7 @@ to A_T1_colour(v)
.
-<Compile the A and B routines for an enumerated kind 25.4> =
+<Compile the A and B routines for an enumerated kind 24.4> =
@@ -1684,26 +1668,26 @@ to A_T1_colour(v)
.
inter_name *iname_i = Kinds::Behaviour::get_inc_iname(K);
packaging_state save = Routines::begin(iname_i);
- <Implement the A routine 25.4.1>;
+ <Implement the A routine 24.4.1>;
Routines::end(save);
inter_name *iname_d = Kinds::Behaviour::get_dec_iname(K);
save = Routines::begin(iname_d);
- <Implement the B routine 25.4.2>;
+ <Implement the B routine 24.4.2>;
Routines::end(save);
-This code is used in §25.
+This code is used in §24.
-§25.4.1. There should be a blue historical plaque on the wall here: this was the
+
§24.4.1. There should be a blue historical plaque on the wall here: this was the
first routine implemented by emitting Inter code, on 12 November 2017.
-<Implement the A routine 25.4.1> =
+<Implement the A routine 24.4.1> =
@@ -1738,14 +1722,14 @@ first routine implemented by emitting Inter code, on 12 November 2017.
-This code is used in §25.4.
+This code is used in §24.4.
-§25.4.2. And this was the second, a few minutes later.
+
§24.4.2. And this was the second, a few minutes later.
-<Implement the B routine 25.4.2> =
+<Implement the B routine 24.4.2> =
@@ -1793,9 +1777,9 @@ first routine implemented by emitting Inter code, on 12 November 2017.
-This code is used in §25.4.
+This code is used in §24.4.
-
@@ -1808,7 +1792,7 @@ and b
inclusive.
-<Compile random-ranger routine for this kind 25.5> =
+<Compile random-ranger routine for this kind 24.5> =
@@ -1878,7 +1862,7 @@ and b
inclusive.
Emit::inv_primitive(return_interp);
Emit::down();
smaller = b_s; larger = a_s;
- <Formula for range 25.5.1>;
+ <Formula for range 24.5.1>;
Emit::up();
Emit::up();
Emit::up();
@@ -1886,7 +1870,7 @@ and b
inclusive.
Emit::inv_primitive(return_interp);
Emit::down();
smaller = a_s; larger = b_s;
- <Formula for range 25.5.1>;
+ <Formula for range 24.5.1>;
Emit::up();
Routines::end(save);
@@ -1894,10 +1878,10 @@ and b
inclusive.
-This code is used in §25 (twice).
+This code is used in §24 (twice).
-§25.5.1.
-<Formula for range 25.5.1> =
+§24.5.1.
+<Formula for range 24.5.1> =
@@ -1926,39 +1910,39 @@ and b
inclusive.
-This code is used in §25.5 (twice).
+This code is used in §24.5 (twice).
-§25.6. Further runtime support. These last routines are synoptic: they take the ID number of the kind as an
+
§24.6. Further runtime support. These last routines are synoptic: they take the ID number of the kind as an
argument, so there is only one of each routine.
-<Compile a suite of I6 routines taking kind IDs as arguments 25.6> =
+<Compile a suite of I6 routines taking kind IDs as arguments 24.6> =
- <Compile PrintKindValuePair 25.6.1>;
- <Compile DefaultValueOfKOV 25.6.2>;
- <Compile KOVComparisonFunction 25.6.3>;
- <Compile KOVDomainSize 25.6.4>;
- <Compile KOVIsBlockValue 25.6.5>;
- <Compile KOVSupportFunction 25.6.6>;
+ <Compile PrintKindValuePair 24.6.1>;
+ <Compile DefaultValueOfKOV 24.6.2>;
+ <Compile KOVComparisonFunction 24.6.3>;
+ <Compile KOVDomainSize 24.6.4>;
+ <Compile KOVIsBlockValue 24.6.5>;
+ <Compile KOVSupportFunction 24.6.6>;
-This code is used in §25.
+This code is used in §24.
-§25.6.1. PrintKindValuePair(K, V)
prints out the value V
, declaring its kind to
+
§24.6.1. PrintKindValuePair(K, V)
prints out the value V
, declaring its kind to
be K
. (Since I6 is typeless and in general the kind of V
cannot be
deduced from its value alone, K
must explicitly be supplied.)
-<Compile PrintKindValuePair 25.6.1> =
+<Compile PrintKindValuePair 24.6.1> =
@@ -2016,16 +2000,16 @@ deduced from its value alone, K
-This code is used in §25.6.
+This code is used in §24.6.
-§25.6.2. DefaultValueOfKOV(K)
returns the default value for kind K
: it's needed,
+
§24.6.2. DefaultValueOfKOV(K)
returns the default value for kind K
: it's needed,
for instance, when increasing the size of a list of K to include new entries,
which have to be given some type-safe value to start out at.
-<Compile DefaultValueOfKOV 25.6.2> =
+<Compile DefaultValueOfKOV 24.6.2> =
@@ -2093,9 +2077,9 @@ which have to be given some type-safe value to start out at.
-This code is used in §25.6.
+This code is used in §24.6.
-§25.6.3. KOVComparisonFunction(K)
returns either the address of a function to
+
§24.6.3. KOVComparisonFunction(K)
returns either the address of a function to
perform a comparison between two values, or else 0 to signal that no
special sort of comparison is needed. (In which case signed numerical
comparison will be used.) The function F
may be used in a sorting algorithm,
@@ -2106,7 +2090,7 @@ unless the two values are genuinely equal.
-<Compile KOVComparisonFunction 25.6.3> =
+<Compile KOVComparisonFunction 24.6.3> =
@@ -2168,10 +2152,10 @@ unless the two values are genuinely equal.
-This code is used in §25.6.
+This code is used in §24.6.
-§25.6.4.
-<Compile KOVDomainSize 25.6.4> =
+§24.6.4.
+<Compile KOVDomainSize 24.6.4> =
@@ -2231,15 +2215,15 @@ unless the two values are genuinely equal.
-This code is used in §25.6.
+This code is used in §24.6.
-§25.6.5. KOVIsBlockValue(K)
is true if and only if K
is the I6 ID of a kind
+
§24.6.5. KOVIsBlockValue(K)
is true if and only if K
is the I6 ID of a kind
storing pointers to blocks on the heap.
-<Compile KOVIsBlockValue 25.6.5> =
+<Compile KOVIsBlockValue 24.6.5> =
@@ -2282,16 +2266,16 @@ storing pointers to blocks on the heap.
-This code is used in §25.6.
+This code is used in §24.6.
-§25.6.6. KOVSupportFunction(K)
returns the address of the specific support function
+
§24.6.6. KOVSupportFunction(K)
returns the address of the specific support function
for a pointer-value kind K
, or returns 0 if K
is not such a kind. For what
such a function does, see "BlockValues.i6t".
-<Compile KOVSupportFunction 25.6.6> =
+<Compile KOVSupportFunction 24.6.6> =
@@ -2353,9 +2337,9 @@ such a function does, see "BlockValues.i6t".
-This code is used in §25.6.
+This code is used in §24.6.
-§26. Code for printing names of kinds at run-time. This needn't run quickly, and
+
§25. Code for printing names of kinds at run-time. This needn't run quickly, and
making it a routine rather than using an array saves a few bytes of precious
Z-machine array space.
@@ -2395,7 +2379,7 @@ Z-machine array space.
The function Kinds::RunTime::I7_Kind_Name_routine is used in 1/mr (§4.14).
-
+
diff --git a/docs/core-module/14-vh.html b/docs/core-module/14-vh.html
index 163447d3c..4608269aa 100644
--- a/docs/core-module/14-vh.html
+++ b/docs/core-module/14-vh.html
@@ -51,7 +51,7 @@
-The function Holsters::new is used in 5/nv (§16, §25), 12/is (§7), 12/ca (§5), 12/dtd (§7), 13/rsfk (§4), 14/cfs (§9), 15/epv (§2), 24/pb (§14), 25/ci (§3.1.1, §3.2.3.3.1.3), 25/cp (§6), 26/iti (§9), 27/is (§31.1).
+The function Holsters::new is used in 5/nv (§25), 12/is (§7), 12/ca (§5), 12/dtd (§7), 13/rsfk (§4), 14/cfs (§9), 15/epv (§2), 24/pb (§14), 25/ci (§3.1.1, §3.2.3.3.1.3), 25/cp (§6), 26/iti (§9), 27/is (§31.1), 27/ei (§5).
@@ -114,7 +114,7 @@
The function Holsters::holster_pair is used in 5/nv (§25.1), 13/rsfk (§4), 14/rv (§24.1, §24.3), 15/ep (§11), 15/vp (§11), 17/rs (§12), 27/ei (§5).
-The function Holsters::unholster_pair is used in 5/nv (§16, §25), 13/rsfk (§4), 14/cfs (§9), 15/epv (§2.1), 26/iti (§9).
+The function Holsters::unholster_pair is used in 5/nv (§25), 13/rsfk (§4), 14/cfs (§9), 15/epv (§2.1), 26/iti (§9), 27/ei (§5).
- (This section begins Chapter 14: Specifications.)
- Continue with 'Specifications'
diff --git a/docs/core-module/15-ep.html b/docs/core-module/15-ep.html
index 900afc485..d8316628d 100644
--- a/docs/core-module/15-ep.html
+++ b/docs/core-module/15-ep.html
@@ -110,7 +110,7 @@ relies on adjectival meanings.
property *Properties::EitherOr::new_nameless(wchar_t *I6_form) {
wording W = Feeds::feed_text(I6_form);
inter_name *iname = Hierarchy::make_iname_with_memo(PROPERTY_HL, Hierarchy::template(), W);
- property *prn = Properties::create(EMPTY_WORDING, iname);
+ property *prn = Properties::create(EMPTY_WORDING, Hierarchy::template(), iname);
prn->either_or = TRUE;
Properties::exclude_from_index(prn);
Properties::set_translation(prn, I6_form);
diff --git a/docs/core-module/15-epv.html b/docs/core-module/15-epv.html
index fc7155493..8b3639c38 100644
--- a/docs/core-module/15-epv.html
+++ b/docs/core-module/15-epv.html
@@ -192,7 +192,7 @@ value the property will have, and compiles a clause as appropriate.
instance *I = InferenceSubjects::as_instance(know);
if (I) R = Instances::package(I);
kind *K = InferenceSubjects::as_kind(know);
- if (K) R = Kinds::RunTime::package(K);
+ if (K) R = Kinds::Behaviour::package(K);
int storage_cost = 0;
if ((Properties::visited_in_traverse(prn) == FALSE) &&
(Properties::can_be_compiled(prn))) {
diff --git a/docs/core-module/15-pr.html b/docs/core-module/15-pr.html
index 1744eabbd..47ac3ef13 100644
--- a/docs/core-module/15-pr.html
+++ b/docs/core-module/15-pr.html
@@ -49,6 +49,7 @@ a value with the owner; it isn't that either/or properties are unloved.)
runtime implementation
int metadata_table_offset; position in the property_metadata
word array at run-time
+ struct package_request *prop_package; where to find:
struct inter_name *prop_iname; the identifier we would like to use at run-time for this property
int translated; has this been given an explicit translation?
int prn_emitted; has this been emitted to Inter yet?
@@ -115,7 +116,7 @@ either/or property where a valued property is wanted, or vice versa.
parse_node *p = ExParser::parse_excerpt(PROPERTY_MC, W);
property *prn;
if (p == NULL) {
- prn = Properties::create(W, NULL);
+ prn = Properties::create(W, NULL, NULL);
if (valued) {
Properties::Valued::make_setting_relation(prn, W);
prn->either_or = FALSE;
@@ -142,7 +143,7 @@ either/or property where a valued property is wanted, or vice versa.
- property *Properties::create(wording W, inter_name *using_iname) {
+ property *Properties::create(wording W, package_request *using_package, inter_name *using_iname) {
W = Articles::remove_article(W);
<Ensure that the new property name is one we can live with 5.1>;
<See if the property name already has a meaning, which may or may not be okay 5.2>;
@@ -263,6 +264,7 @@ something.
prn->ambiguous_name = <name-looking-like-property-test>(W);
prn->applicable_to = NULL;
prn->either_or = FALSE;
+ prn->prop_package = using_package;
prn->prop_iname = using_iname;
prn->prn_emitted = FALSE;
prn->translated = FALSE;
@@ -975,12 +977,20 @@ we find it, we compile it and return if ((Properties::is_either_or(prn)) && (prn->stored_in_negation))
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 = Hierarchy::make_iname_with_memo(PROPERTY_HL, R, prn->name);
+ prn->prop_package = Hierarchy::package(prn->owning_module, PROPERTIES_HAP);
+ prn->prop_iname = Hierarchy::make_iname_with_memo(PROPERTY_HL, prn->prop_package, prn->name);
}
return prn->prop_iname;
}
+ package_request *Properties::package(property *prn) {
+ if (prn == NULL) internal_error("tried to find package for null property");
+ if ((Properties::is_either_or(prn)) && (prn->stored_in_negation))
+ return Properties::package(Properties::EitherOr::get_negation(prn));
+ Properties::iname(prn);
+ return prn->prop_package;
+ }
+
void Properties::emit_single(property *prn) {
if (prn == NULL) internal_error("tried to find emit single for null property");
if ((Properties::is_either_or(prn)) && (prn->stored_in_negation)) {
@@ -1068,6 +1078,8 @@ we find it, we compile it and return The function Properties::iname is used in §21, §22.1, 5/ins (§38.3), 6/rlt (§9.3.8, §15.1.3), 12/ter (§8.1), 12/dtd (§19, §22), 12/cdp (§2.1.6.1.2.2.5, §2.1.6.1.2.2.6.1), 14/rv (§24.3.1), 15/ep (§15.1, §15.2), 15/ma (§14.1), 15/cr (§7.1), 15/spr (§2), 15/spr2 (§8, §11), 15/epv (§4), 16/ic (§13), 26/iti (§9), 27/ei (§3).
+The function Properties::package appears nowhere else.
+
The function Properties::emit_single is used in 27/ei (§3).
The function Properties::emit is used in 1/mr (§4.11).
diff --git a/docs/core-module/15-vp.html b/docs/core-module/15-vp.html
index c376a3dbb..630247d8d 100644
--- a/docs/core-module/15-vp.html
+++ b/docs/core-module/15-vp.html
@@ -98,7 +98,7 @@ to the end user.
if (K == NULL) internal_error("new nameless property without kind");
package_request *R = Hierarchy::package(Modules::find(current_sentence), PROPERTIES_HAP);
inter_name *using_iname = Hierarchy::make_iname_with_memo(PROPERTY_HL, R, W);
- property *prn = Properties::create(EMPTY_WORDING, using_iname);
+ property *prn = Properties::create(EMPTY_WORDING, R, using_iname);
Properties::exclude_from_index(prn);
prn->either_or = FALSE;
Properties::set_translation_S(prn, I6_form);
@@ -109,9 +109,9 @@ to the end user.
return prn;
}
- property *Properties::Valued::new_nameless_using(kind *K, inter_name *using) {
+ property *Properties::Valued::new_nameless_using(kind *K, package_request *R, inter_name *using) {
if (K == NULL) internal_error("new nameless property without kind");
- property *prn = Properties::create(EMPTY_WORDING, using);
+ property *prn = Properties::create(EMPTY_WORDING, R, using);
Properties::exclude_from_index(prn);
prn->either_or = FALSE;
prn->property_value_kind = K;
diff --git a/docs/core-module/16-ic.html b/docs/core-module/16-ic.html
index e9fb7f09a..1ee3424e7 100644
--- a/docs/core-module/16-ic.html
+++ b/docs/core-module/16-ic.html
@@ -400,11 +400,11 @@ for the relation-route-finding code at run time.
inter_name *count_iname = PL::Counting::instance_count_iname(K);
PF_S(counting, subj)->instance_count_prop =
- Properties::Valued::new_nameless_using(K_number, count_iname);
+ Properties::Valued::new_nameless_using(K_number, Kinds::Behaviour::package(K), count_iname);
inter_name *next_iname = PL::Counting::next_instance(K);
PF_S(counting, subj)->instance_link_prop =
- Properties::Valued::new_nameless_using(K_object, next_iname);
+ Properties::Valued::new_nameless_using(K_object, Kinds::Behaviour::package(K), next_iname);
}
P_KD_Count = Properties::Valued::new_nameless(I"KD_Count", K_number);
diff --git a/docs/core-module/17-tl.html b/docs/core-module/17-tl.html
index 6407b1e14..a9a819fec 100644
--- a/docs/core-module/17-tl.html
+++ b/docs/core-module/17-tl.html
@@ -391,19 +391,16 @@ different for compilation purposes.
The function Strings::TextLiterals::compile_quotation is used in 17/rs (§12).
-The function Strings::TextLiterals::CCOUNT_QUOTATIONS is used in 13/rsfk (§25).
+The function Strings::TextLiterals::CCOUNT_QUOTATIONS is used in 13/rsfk (§24).
§13. A version from fixed text:
- void Strings::TextLiterals::compile_literal_from_text(inter_name *iname, inter_t *v1, inter_t *v2, wchar_t *p) {
+ void Strings::TextLiterals::compile_literal_from_text(inter_name *context, inter_t *v1, inter_t *v2, wchar_t *p) {
literal_text *lt = Strings::TextLiterals::compile_literal(NULL, TRUE, Feeds::feed_text(p));
- packaging_state save = Packaging::enter_home_of(iname);
- inter_reading_state *IRS = Emit::IRS();
- Emit::to_ival(IRS->read_into, IRS->current_package, v1, v2, lt->lt_sba_iname);
- Packaging::exit(save);
+ Emit::to_ival_in_context(context, v1, v2, lt->lt_sba_iname);
}
diff --git a/docs/core-module/17-ts.html b/docs/core-module/17-ts.html
index d0e5b4fa0..9d3b00627 100644
--- a/docs/core-module/17-ts.html
+++ b/docs/core-module/17-ts.html
@@ -214,7 +214,7 @@ that routine later. This appearance of the routine name is called the "cue".
Frames::emit_allocation(K_text);
}
text_substitution *ts = Strings::TextSubstitutions::new_text_substitution(W, phsf,
- adopted_rule_for_compilation, adopted_marker_for_compilation, Packaging::current_enclosure());
+ adopted_rule_for_compilation, adopted_marker_for_compilation, Emit::current_enclosure());
inter_name *tin = Strings::TextSubstitutions::text_substitution_iname(ts);
if (VH->vhmode_wanted == INTER_DATA_VHMODE)
Emit::holster(VH, tin);
@@ -240,7 +240,7 @@ that routine later. This appearance of the routine name is called the "cue".
text_substitution *ts = Strings::TextSubstitutions::new_text_substitution(W, phsf,
- adopted_rule_for_compilation, adopted_marker_for_compilation, Packaging::current_enclosure());
+ adopted_rule_for_compilation, adopted_marker_for_compilation, Emit::current_enclosure());
if (TEST_COMPILATION_MODE(CONSTANT_CMODE)) {
package_request *PR = Hierarchy::package_in_enclosure(BLOCK_CONSTANTS_HAP);
inter_name *N = Hierarchy::make_iname_in(BLOCK_CONSTANT_HL, PR);
diff --git a/docs/core-module/18-lc.html b/docs/core-module/18-lc.html
index fde0c59c1..b481d7f23 100644
--- a/docs/core-module/18-lc.html
+++ b/docs/core-module/18-lc.html
@@ -116,7 +116,7 @@ with a call to:
ll->ll_iname = NULL;
ll->first_llist_entry = NULL;
ll->list_text = NULL;
- ll->ll_package = Packaging::current_enclosure();
+ ll->ll_package = Emit::current_enclosure();
Kinds::RunTime::ensure_basic_heap_present();
return ll;
}
diff --git a/docs/core-module/2-sq.html b/docs/core-module/2-sq.html
index c4527c028..1c2a01321 100644
--- a/docs/core-module/2-sq.html
+++ b/docs/core-module/2-sq.html
@@ -164,7 +164,7 @@ this as some kind of marginal will-never-happen case.
-The function Problems::quote_kind is used in §4, 5/lp (§34.5, §34.6), 5/ins (§19.1), 5/nv (§7.1, §23, §25.2), 6/tur (§5), 9/tc (§5.4.2.6, §5.4.2.7, §5.4.2.8, §8.1), 9/ma (§3.3.39.1), 9/pk (§2.1, §4.4), 9/pd (§5.6.1, §7.1.3), 11/tc (§7.1), 11/tcp (§6.9, §6.10, §6.11, §10, §11, §11.3, §12), 12/ter (§5.1, §8.4), 12/qr (§5), 12/ca (§6.2), 13/kak (§7), 13/rsfk (§4.1, §4.2, §16.2, §27), 14/ds2 (§10.1.1.3.1, §11.8.1, §11.9.1.1.2.2.2, §11.9.1.1.3.1.1, §11.9.1.1.5.2, §11.9.1.2.3.3, §11.9.1.2.4, §15.4, §19.1, §19.2, §19.2.1, §19.5.3.2, §19.6.1.1, §19.6.2.1, §19.6.2.2), 15/vp (§5), 15/cp (§3), 15/tpr (§5), 15/spr2 (§9.1, §9.2), 15/pov (§4.1), 16/in (§14), 18/lc (§8.2.1), 19/tc (§6.1, §14.1, §15, §15.6), 19/tod (§6.2, §6.3.3), 20/eq (§41.4.1, §41.4.2, §47.3.2), 21/rl (§15, §18), 22/pu (§20.1.1.2), 25/ci (§3.1.1.2), 25/cii (§3.2.1.1, §3.1.1.4.7.1.2, §3.5.3, §3.5.4.3), 25/cp (§5.3.5).
+The function Problems::quote_kind is used in §4, 5/lp (§34.5, §34.6), 5/ins (§19.1), 5/nv (§7.1, §23, §25.2), 6/tur (§5), 9/tc (§5.4.2.6, §5.4.2.7, §5.4.2.8, §8.1), 9/ma (§3.3.39.1), 9/pk (§2.1, §4.4), 9/pd (§5.6.1, §7.1.3), 11/tc (§7.1), 11/tcp (§6.9, §6.10, §6.11, §10, §11, §11.3, §12), 12/ter (§5.1, §8.4), 12/qr (§5), 12/ca (§6.2), 13/kak (§7), 13/rsfk (§4.1, §4.2, §16.2, §26), 14/ds2 (§10.1.1.3.1, §11.8.1, §11.9.1.1.2.2.2, §11.9.1.1.3.1.1, §11.9.1.1.5.2, §11.9.1.2.3.3, §11.9.1.2.4, §15.4, §19.1, §19.2, §19.2.1, §19.5.3.2, §19.6.1.1, §19.6.2.1, §19.6.2.2), 15/vp (§5), 15/cp (§3), 15/tpr (§5), 15/spr2 (§9.1, §9.2), 15/pov (§4.1), 16/in (§14), 18/lc (§8.2.1), 19/tc (§6.1, §14.1, §15, §15.6), 19/tod (§6.2, §6.3.3), 20/eq (§41.4.1, §41.4.2, §47.3.2), 21/rl (§15, §18), 22/pu (§20.1.1.2), 25/ci (§3.1.1.2), 25/cii (§3.2.1.1, §3.1.1.4.7.1.2, §3.5.3, §3.5.4.3), 25/cp (§5.3.5).
The function Problems::expand_kind appears nowhere else.
diff --git a/docs/core-module/21-rb.html b/docs/core-module/21-rb.html
index 5aed2ea63..d654fb2c9 100644
--- a/docs/core-module/21-rb.html
+++ b/docs/core-module/21-rb.html
@@ -1079,7 +1079,7 @@ than once for each rule.
if (action_based == FALSE) grouping = FALSE;
inter_symbol *forbid_breaks_s = NULL, *rv_s = NULL, *original_deadflag_s = NULL, *p_s = NULL;
- packaging_state save_array = Packaging::stateless();
+ packaging_state save_array = Emit::unused_packaging_state();
<Open the rulebook compilation 24.1.1>;
int group_size = 0, group_started = FALSE, entry_count = 0, action_group_open = FALSE;
diff --git a/docs/core-module/21-rl.html b/docs/core-module/21-rl.html
index f7dcd24cf..c1213b2fd 100644
--- a/docs/core-module/21-rl.html
+++ b/docs/core-module/21-rl.html
@@ -297,9 +297,8 @@ must be added after the rule has been created:
R->rule_extern_iname = Hierarchy::make_iname_in(EXTERIOR_RULE_HL, R->rule_package);
inter_name *xiname = Hierarchy::find_by_name(XT);
- inter_t v1 = 0, v2 = 0;
- 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);
+ Emit::named_generic_constant_xiname(R->rule_package, R->rule_extern_iname, xiname);
+
R->xiname = xiname;
R->rule_extern_iname_as_text = Str::duplicate(XT);
DISCARD_TEXT(XT);
diff --git a/docs/core-module/21-rl2.html b/docs/core-module/21-rl2.html
index d6db085dc..665305d9a 100644
--- a/docs/core-module/21-rl2.html
+++ b/docs/core-module/21-rl2.html
@@ -1105,9 +1105,7 @@ code are the real outcome of the code in this section.
if (Rulebooks::focus(rb) == PARAMETER_FOCUS) par = TRUE;
LOGIF(RULEBOOK_COMPILATION, "Compiling rulebook: %W = %n\n",
rb->primary_name, rb->rb_iname);
- packaging_state save = Packaging::enter_home_of(rb->rb_iname);
Rules::Bookings::list_compile(rb->rule_list, rb->rb_iname, act, par);
- Packaging::exit(save);
}
Rules::check_placement_safety();
}
diff --git a/docs/core-module/22-pav.html b/docs/core-module/22-pav.html
index e485f3857..d584889a7 100644
--- a/docs/core-module/22-pav.html
+++ b/docs/core-module/22-pav.html
@@ -250,7 +250,7 @@ compilation.
void Phrases::Constants::compile_default_closure(inter_name *closure_identifier, kind *K) {
- package_request *P = Kinds::RunTime::package(K);
+ package_request *P = Kinds::Behaviour::package(K);
inter_name *rname = Hierarchy::make_iname_in(DEFAULT_CLOSURE_FN_HL, P);
<Compile the default routine 9.2>;
diff --git a/docs/core-module/22-ph.html b/docs/core-module/22-ph.html
index ea2f64a39..f52f1f315 100644
--- a/docs/core-module/22-ph.html
+++ b/docs/core-module/22-ph.html
@@ -588,7 +588,7 @@ what number is...", for instance.
The function Phrases::get_inter_tail is used in 25/cii (§1.3).
-The function Phrases::iname is used in §9, §12, 21/rl (§19), 22/prcd (§10, §10.1), 22/tp2 (§4), 23/abp (§1), 25/cp (§4).
+The function Phrases::iname is used in §9, 21/rl (§19), 22/prcd (§10, §10.1), 22/tp2 (§4), 23/abp (§1), 25/cp (§4).
The function Phrases::declaration_node is used in 22/cs (§10.6, §10.7), 22/pu (§10.2.1), 22/tp (§4, §7.1, §8), 22/pi (§1).
@@ -610,15 +610,11 @@ response to "requests". All other phrases are compiled just once.
int effect = Phrases::Usage::get_effect(&(ph->usage_data));
if (effect == RULE_NOT_IN_RULEBOOK_EFF) effect = RULE_IN_RULEBOOK_EFF;
if (effect == TO_PHRASE_EFF) {
- packaging_state save = Packaging::enter_home_of(req->req_iname);
Routines::Compile::routine(ph, legible, req, acl);
- Packaging::exit(save);
<Move along the progress bar if it's this phrase's first compilation 12.1>;
} else {
if (ph->at_least_one_compiled_form_needed) {
- packaging_state save = Packaging::enter_home_of(Phrases::iname(ph));
Routines::Compile::routine(ph, legible, NULL, acl);
- Packaging::exit(save);
<Move along the progress bar if it's this phrase's first compilation 12.1>;
}
}
diff --git a/docs/core-module/22-tp.html b/docs/core-module/22-tp.html
index 9550d813a..7a9a49727 100644
--- a/docs/core-module/22-tp.html
+++ b/docs/core-module/22-tp.html
@@ -33,7 +33,7 @@ we use the following chits to keep track of what's outstanding:
-The structure to_phrase_request is accessed in 22/ph, 25/cp, 26/ts and here.
+The structure to_phrase_request is accessed in 25/cp, 26/ts and here.
§3. Logical priority of To phrases. "To" phrases are insertion-sorted, as they are defined, into a linked list
held in logical priority order. This essentially means that two lexically
diff --git a/docs/core-module/24-lv.html b/docs/core-module/24-lv.html
index 7d024610b..1f757b4a9 100644
--- a/docs/core-module/24-lv.html
+++ b/docs/core-module/24-lv.html
@@ -460,13 +460,13 @@ scratch work-space which can be used in the compiled code.
The function LocalVariables::add_internal_local_as_symbol_noting is used in 12/cdp (§2.1.5).
-The function LocalVariables::add_named_call is used in §47, 13/rsfk (§25.6.3), 21/rb (§23), 22/pav (§9.2).
+The function LocalVariables::add_named_call is used in §47, 13/rsfk (§24.6.3), 21/rb (§23), 22/pav (§9.2).
-The function LocalVariables::add_named_call_as_symbol is used in 4/am (§43), 5/lp (§27), 6/rlt (§15.2, §17, §29.1), 6/nv (§18.1, §18.2), 8/ef (§19), 12/cad (§5), 12/cdp (§2.1.5, §2.1.5.2), 13/rsfk (§16.3, §25.1, §25.2, §25.3, §25.5, §25.6.1, §25.6.2, §25.6.5, §25.6.6, §26), 17/rs (§6.2, §7.2), 19/tc (§8), 19/rsft (§2), 21/rl (§20), 21/rb (§24.1.1), 21/rl2 (§14.1), 21/fao (§10), 21/sv (§3), 24/ch (§7), 26/uo (§21.1, §21.2).
+The function LocalVariables::add_named_call_as_symbol is used in 4/am (§43), 5/lp (§27), 6/rlt (§15.2, §17, §29.1), 6/nv (§18.1, §18.2), 8/ef (§19), 12/cad (§5), 12/cdp (§2.1.5, §2.1.5.2), 13/rsfk (§16.3, §24.1, §24.2, §24.3, §24.5, §24.6.1, §24.6.2, §24.6.5, §24.6.6, §25), 17/rs (§6.2, §7.2), 19/tc (§8), 19/rsft (§2), 21/rl (§20), 21/rb (§24.1.1), 21/rl2 (§14.1), 21/fao (§10), 21/sv (§3), 24/ch (§7), 26/uo (§21.1, §21.2).
The function LocalVariables::add_named_call_as_symbol_noting is used in 6/rlt (§15.2).
-The function LocalVariables::add_internal_local_c is used in §12, §13, 13/rsfk (§25.6.2, §25.6.3, §25.6.4).
+The function LocalVariables::add_internal_local_c is used in §12, §13, 13/rsfk (§24.6.2, §24.6.3, §24.6.4).
The function LocalVariables::add_internal_local_c_as_symbol is used in 6/rlt (§15), 21/rb (§24.1.1).
@@ -1648,9 +1648,9 @@ need in the compilation of any given routine:
The function LocalVariables::declare is used in 26/rt (§3, §4, §4.1.1).
-The function LocalVariables::declare_this is used in §8, §10, §11, §27, §28, §29, §41, §43, §45, 4/am (§34.2), 11/tr (§10), 12/dtd (§9, §23, §25, §26, §27), 12/cad (§7), 13/rsfk (§25.6.2, §25.6.3, §25.6.4), 14/lv (§14.1, §14.5), 14/cn (§16.3), 20/eq (§48), 25/cii (§1.2.1, §3.5.1, §3.5.3), 25/cp (§5.3.5), 27/is (§31.9).
+The function LocalVariables::declare_this is used in §8, §10, §11, §27, §28, §29, §41, §43, §45, 4/am (§34.2), 11/tr (§10), 12/dtd (§9, §23, §25, §26, §27), 12/cad (§7), 13/rsfk (§24.6.2, §24.6.3, §24.6.4), 14/lv (§14.1, §14.5), 14/cn (§16.3), 20/eq (§48), 25/cii (§1.2.1, §3.5.1, §3.5.3), 25/cp (§5.3.5), 27/is (§31.9).
-The function LocalVariables::create_and_declare is used in 13/rsfk (§25.4.1, §25.4.2).
+The function LocalVariables::create_and_declare is used in 13/rsfk (§24.4.1, §24.4.2).
§48. Note that a deallocated "let" variable retains its most recent name.
diff --git a/docs/core-module/25-cp.html b/docs/core-module/25-cp.html
index c75a2fc65..296fd71ee 100644
--- a/docs/core-module/25-cp.html
+++ b/docs/core-module/25-cp.html
@@ -62,11 +62,11 @@ should always be supplied for "To..." phrases, but left null for rules.
<Compile some commentary about the routine to follow 3.1>;
- Routines::begin_framed(Routines::Compile::iname(ph, req), &(ph->stack_frame));
+ packaging_state save = Routines::begin_framed(Routines::Compile::iname(ph, req), &(ph->stack_frame));
<Compile the body of the routine 3.3>;
- Routines::end_in_current_package();
+ Routines::end(save);
phrase_being_compiled = NULL;
current_sentence = NULL;
diff --git a/docs/core-module/26-ct.html b/docs/core-module/26-ct.html
index b97eb7d6c..52e4e893b 100644
--- a/docs/core-module/26-ct.html
+++ b/docs/core-module/26-ct.html
@@ -189,7 +189,7 @@ behave more like dictionary words and the
-The function CompiledText::from_wide_string is used in §5, 5/lp (§27.3.1), 13/rsfk (§25.3), 17/tl (§14.1).
+The function CompiledText::from_wide_string is used in §5, 5/lp (§27.3.1), 13/rsfk (§24.3), 17/tl (§14.1).
The function CompiledText::from_wide_string_for_emission is used in 25/cii (§3.5.8.1).
diff --git a/docs/core-module/26-iti.html b/docs/core-module/26-iti.html
index ecebd1c8c..bd79add3b 100644
--- a/docs/core-module/26-iti.html
+++ b/docs/core-module/26-iti.html
@@ -809,7 +809,7 @@ of defined adjectives. So:
Holsters::unholster_pair(&VH2, &v1, &v2);
if (v1 == ALIAS_IVAL) {
PUT(URL_SYMBOL_CHAR);
- inter_symbols_table *T = Inter::Packages::scope(Packaging::current_enclosure()->actual_package);
+ inter_symbols_table *T = Inter::Packages::scope(Emit::current_enclosure()->actual_package);
inter_symbol *S = Inter::SymbolsTables::symbol_from_id(T, v2);
Inter::SymbolsTables::symbol_to_url_name(OUT, S);
PUT(URL_SYMBOL_CHAR);
diff --git a/docs/core-module/26-rt.html b/docs/core-module/26-rt.html
index 07cc822a1..6ac9f5414 100644
--- a/docs/core-module/26-rt.html
+++ b/docs/core-module/26-rt.html
@@ -9,36 +9,26 @@
-To compile the bones of routines, and their local variable declarations.
+To compile the bones of functions, and their local variable declarations.
§1. The code following is used throughout Inform, whenever we want to compile
-an I6 routine. Sometimes that's in order to define a phrase, but often not.
+a function. Sometimes that's in order to define a phrase, but often not.
-We then compile the body code of our routine, and conclude with:
+
There are two ways to begin a function: specifying a stack frame which has
+already been set up, or not. Here's not:
-
-
- Routines::end_in_current_package();
packaging_state Routines::begin(inter_name *name) {
- packaging_state save = Packaging::enter_home_of(name);
- Routines::begin_framed(name, NULL);
- return save;
- }
-
- void Routines::begin_in_current_package(inter_name *name) {
- Routines::begin_framed(name, NULL);
+ return Routines::begin_framed(name, NULL);
}
-The function Routines::begin is used in 4/am (§34.2, §43), 5/lp (§27), 5/nv (§16), 6/bp (§33), 6/rlt (§15, §15.2, §17, §29.1, §29.2, §29.3, §29.4, §29.5, §29.6, §30), 6/nv (§18.1, §18.2), 8/ef (§19), 12/cdp (§2.1), 13/rsfk (§16.3, §25.1, §25.2, §25.3, §25.4, §25.5, §25.6.1, §25.6.2, §25.6.3, §25.6.4, §25.6.5, §25.6.6, §26), 15/ma (§13), 17/tl (§14.2), 17/ts (§11), 17/rs (§6.1, §6.2, §7.2), 19/tc (§8), 19/rsft (§2), 20/eq (§43), 21/rl (§20, §22.1), 21/rb (§23, §24.1.1), 21/rl2 (§14.1), 21/fao (§10), 21/sv (§3), 22/pav (§9.2), 24/ch (§6, §7), 26/uo (§21.1, §21.2), 26/lt (§4.1), 26/ts (§10, §11).
-
-The function Routines::begin_in_current_package appears nowhere else.
+The function Routines::begin is used in 4/am (§34.2, §43), 5/lp (§27), 5/nv (§16), 6/bp (§33), 6/rlt (§15, §15.2, §17, §29.1, §29.2, §29.3, §29.4, §29.5, §29.6, §30), 6/nv (§18.1, §18.2), 8/ef (§19), 12/cdp (§2.1), 13/rsfk (§16.3, §24.1, §24.2, §24.3, §24.4, §24.5, §24.6.1, §24.6.2, §24.6.3, §24.6.4, §24.6.5, §24.6.6, §25), 15/ma (§13), 17/tl (§14.2), 17/ts (§11), 17/rs (§6.1, §6.2, §7.2), 19/tc (§8), 19/rsft (§2), 20/eq (§43), 21/rl (§20, §22.1), 21/rb (§23, §24.1.1), 21/rl2 (§14.1), 21/fao (§10), 21/sv (§3), 22/pav (§9.2), 24/ch (§6, §7), 26/uo (§21.1, §21.2), 26/lt (§4.1), 26/ts (§10, §11).
§2. During the time when we're compiling the body of the routine,
we need to keep track of:
@@ -54,27 +44,24 @@ we need to keep track of:
-§3. So here is the general version, in which phsf
may or may not be a
+pre-existing stack frame:
- void Routines::begin_framed(inter_name *iname, ph_stack_frame *phsf) {
+ packaging_state Routines::begin_framed(inter_name *iname, ph_stack_frame *phsf) {
if (iname == NULL) internal_error("no iname for routine");
- package_request *R = Packaging::home_of(iname);
- if ((R == NULL) || (R == Hierarchy::main())) {
- LOG("Routine outside of package: ................................................ %n\n", iname);
- WRITE_TO(STDERR, "Routine outside of package: %n\n", iname);
- internal_error("routine outside of package");
- }
currently_compiling_iname = iname;
<Prepare a suitable stack frame 3.1>;
Frames::Blocks::begin_code_blocks();
- currently_compiling_inter_block = Emit::block(iname);
+ packaging_state save = Emit::unused_packaging_state();
+ currently_compiling_inter_block = Emit::block(&save, iname);
LocalVariables::declare(phsf, FALSE);
+ return save;
}
inter_symbol *Routines::self(void) {
@@ -113,26 +100,22 @@ create a new nonphrasal stack frame.
This code is used in §3.
-§4. As can be seen, very much more work is involved in finishing a function
+than in starting it. This is because we need to split into two cases: one
+where the code we've just compiled required allocation of heap memory
+(e.g. for dynamic strings or lists), and another simpler case where it
+did not.
void Routines::end(packaging_state save) {
- Routines::end_in_current_package();
- Packaging::exit(save);
- }
-
- void Routines::end_in_current_package(void) {
kind *R_kind = LocalVariables::deduced_function_kind(currently_compiling_in_frame);
inter_name *kernel_name = NULL, *public_name = currently_compiling_iname;
if ((currently_compiling_in_frame->allocated_pointers) ||
- (currently_compiling_in_frame->no_formal_parameters_needed > 0)) {
- if (Packaging::housed_in_function(public_name))
- kernel_name = Hierarchy::make_kernel_iname(Packaging::home_of(public_name));
- else internal_error("routine not housed in function");
- }
+ (currently_compiling_in_frame->no_formal_parameters_needed > 0))
+ kernel_name = Emit::kernel(public_name);
int needed = LocalVariables::count(currently_compiling_in_frame);
if (kernel_name) needed++;
@@ -150,14 +133,13 @@ create a new nonphrasal stack frame.
Frames::Blocks::end_code_blocks();
if (currently_compiling_nnp) Frames::remove_nonphrase_stack_frame();
Frames::remove_current();
+ Emit::end_main_block(save);
}
-The function Routines::end is used in 4/am (§34.2, §43), 5/lp (§27), 5/nv (§16), 6/bp (§33), 6/rlt (§15, §15.2, §17, §29.1, §29.2, §29.3, §29.4, §29.5, §29.6, §30), 6/nv (§18.1, §18.2), 8/ef (§19), 12/cdp (§2.1), 13/rsfk (§16.3, §25.1, §25.2, §25.3, §25.4, §25.5, §25.6.1, §25.6.2, §25.6.3, §25.6.4, §25.6.5, §25.6.6, §26), 15/ma (§13), 17/tl (§14.2), 17/ts (§11), 17/rs (§6.1, §6.2, §7.2), 19/tc (§8), 19/rsft (§2), 20/eq (§43), 21/rl (§20, §22.1), 21/rb (§23, §24.1.5), 21/rl2 (§14.1), 21/fao (§10), 21/sv (§3), 22/pav (§9.2), 24/ch (§6, §7), 26/uo (§21.1, §21.2), 26/lt (§4.1), 26/ts (§10, §11).
-
-The function Routines::end_in_current_package is used in 25/cp (§3).
+The function Routines::end is used in 4/am (§34.2, §43), 5/lp (§27), 5/nv (§16), 6/bp (§33), 6/rlt (§15, §15.2, §17, §29.1, §29.2, §29.3, §29.4, §29.5, §29.6, §30), 6/nv (§18.1, §18.2), 8/ef (§19), 12/cdp (§2.1), 13/rsfk (§16.3, §24.1, §24.2, §24.3, §24.4, §24.5, §24.6.1, §24.6.2, §24.6.3, §24.6.4, §24.6.5, §24.6.6, §25), 15/ma (§13), 17/tl (§14.2), 17/ts (§11), 17/rs (§6.1, §6.2, §7.2), 19/tc (§8), 19/rsft (§2), 20/eq (§43), 21/rl (§20, §22.1), 21/rb (§23, §24.1.5), 21/rl2 (§14.1), 21/fao (§10), 21/sv (§3), 22/pav (§9.2), 24/ch (§6, §7), 25/cp (§3), 26/uo (§21.1, §21.2), 26/lt (§4.1), 26/ts (§10, §11).
§4.1.
<Compile an outer shell routine with the public-facing name 4.1> =
@@ -168,7 +150,7 @@ create a new nonphrasal stack frame.
int returns_block_value =
Kinds::Behaviour::uses_pointer_values(currently_compiling_in_frame->kind_returned);
- inter_symbol *rsymb = Emit::block(public_name);
+ inter_symbol *rsymb = Emit::block(NULL, public_name);
inter_symbol *I7RBLK_symbol = NULL;
<Compile I6 locals for the outer shell 4.1.1>;
int NBV = 0;
diff --git a/docs/core-module/26-ts.html b/docs/core-module/26-ts.html
index f0c1ad768..023a36344 100644
--- a/docs/core-module/26-ts.html
+++ b/docs/core-module/26-ts.html
@@ -43,7 +43,7 @@ attached.
-The structure test_scenario is accessed in 2/sq, 2/si, 5/ins, 5/nv, 8/ed2, 9/ma, 9/pk, 11/sm, 14/lv, 14/ds2, 15/pr, 15/ep, 15/vp, 15/spr, 16/in, 16/cmw, 17/rs, 19/tc, 19/tb, 19/tod, 20/eq, 21/rl, 21/rl2, 21/fao, 21/rps, 21/sv, 21/ac, 22/ph, 22/pu, 22/dptd, 22/po, 22/pav, 22/tp, 25/cii, 25/cp, 26/uo and here.
+The structure test_scenario is accessed in 2/sq, 2/si, 5/ins, 5/nv, 8/ed2, 9/ma, 9/pk, 11/sm, 14/lv, 14/ds2, 15/pr, 15/ep, 15/vp, 15/spr, 16/in, 16/cmw, 17/rs, 19/tc, 19/tb, 19/tod, 20/eq, 21/rl, 21/rl2, 21/fao, 21/rps, 21/sv, 21/ac, 22/pu, 22/dptd, 22/po, 22/pav, 22/tp, 25/cii, 25/cp, 26/uo and here.
diff --git a/docs/core-module/26-vm.html b/docs/core-module/26-vm.html
index 561de5829..6bd4bdba4 100644
--- a/docs/core-module/26-vm.html
+++ b/docs/core-module/26-vm.html
@@ -350,7 +350,7 @@ at 15, but Glulx allows it to be set with an I6 memory setting.
-The function VirtualMachines::supports is used in 13/rsfk (§27), 20/eq (§41).
+The function VirtualMachines::supports is used in 13/rsfk (§26), 20/eq (§41).
§12. When releasing a blorbed story file, the file extension depends on the
story file wrapped inside. (This is a dubious idea, in the opinion of
diff --git a/docs/core-module/27-ei.html b/docs/core-module/27-ei.html
index ae5f7b1f5..4622189b6 100644
--- a/docs/core-module/27-ei.html
+++ b/docs/core-module/27-ei.html
@@ -84,7 +84,7 @@
Emit::comment(I"Primitives:");
Primitives::emit();
- Packaging::enter(Hierarchy::main()); We never exit this
+ Packaging::enter_home_of(NULL); Enters main, which we never exit
inter_name *KU = Hierarchy::find(K_UNCHECKED_HL);
packaging_state save = Packaging::enter_home_of(KU);
@@ -147,12 +147,10 @@
if (extern_symbols == NULL) extern_symbols = Dictionaries::new(1024, FALSE);
if (Dictionaries::find(extern_symbols, name))
return Dictionaries::read_value(extern_symbols, name);
- packaging_state save = Packaging::enter(Hierarchy::template());
inter_symbol *symb = Emit::new_symbol(Emit::main_scope(), name);
Inter::Symbols::extern(symb);
Dictionaries::create(extern_symbols, name);
Dictionaries::write_value(extern_symbols, name, symb);
- Packaging::exit(save);
return symb;
}
@@ -171,9 +169,9 @@
-The function Emit::IRS is used in §3, §4, §5, 13/rsfk (§5), 17/tl (§13), 26/iti (§9), 27/pc (§4).
+The function Emit::IRS is used in §3, §4, §5, 13/rsfk (§5), 26/iti (§9), 27/pc (§4).
-The function Emit::repository is used in §3, §4, 1/mr (§4.15), 21/rl (§9), 27/pc (§2, §4), 27/in (§8).
+The function Emit::repository is used in §3, §4, 1/mr (§4.15), 27/pc (§2, §4), 27/in (§8).
The function Emit::move_write_position is used in 27/pc (§4).
@@ -371,7 +369,7 @@ insert them into the Inter stream close to the top.
}
void Emit::permission(property *prn, kind *K, inter_name *name) {
- packaging_state save = Packaging::enter(Kinds::RunTime::package(K));
+ packaging_state save = Packaging::enter(Kinds::Behaviour::package(K));
inter_name *prop_name = Properties::iname(prn);
inter_symbol *owner_kind = Emit::kind_to_symbol(K);
inter_symbol *store = (name)?InterNames::to_symbol(name):NULL;
@@ -421,7 +419,7 @@ insert them into the Inter stream close to the top.
}
void Emit::defaultvalue(kind *K, inter_t v1, inter_t v2) {
- packaging_state save = Packaging::enter(Kinds::RunTime::package(K));
+ packaging_state save = Packaging::enter(Kinds::Behaviour::package(K));
inter_symbol *owner_kind = Emit::kind_to_symbol(K);
Emit::guard(Inter::DefaultValue::new(default_bookmark,
Inter::SymbolsTables::id_from_IRS_and_symbol(default_bookmark, owner_kind), v1, v2, Emit::baseline(default_bookmark), NULL));
@@ -464,6 +462,12 @@ insert them into the Inter stream close to the top.
Packaging::exit(save);
}
+ void Emit::named_generic_constant_xiname(package_request *PR, inter_name *name, inter_name *xiname) {
+ inter_t v1 = 0, v2 = 0;
+ Inter::Symbols::to_data(Emit::repository(), Packaging::incarnate(PR), InterNames::to_symbol(xiname), &v1, &v2);
+ Emit::named_generic_constant(name, v1, v2);
+ }
+
void Emit::named_generic_constant(inter_name *name, inter_t val1, inter_t val2) {
packaging_state save = Packaging::enter_home_of(name);
inter_symbol *con_name = Emit::define_symbol(name);
@@ -826,9 +830,19 @@ insert them into the Inter stream close to the top.
return rsymb;
}
- inter_symbol *Emit::block(inter_name *iname) {
+ inter_symbol *Emit::block(packaging_state *save, inter_name *iname) {
if (current_inter_routine) internal_error("nested routines");
if (Emit::IRS() == NULL) internal_error("no inter repository");
+
+ if (save) {
+ *save = Packaging::enter_home_of(iname);
+ package_request *R = Packaging::home_of(iname);
+ if ((R == NULL) || (R == Hierarchy::main())) {
+ LOG("Routine outside of package: %n\n", iname);
+ internal_error("routine outside of package");
+ }
+ }
+
inter_name *block_iname = NULL;
if (Packaging::housed_in_function(iname))
block_iname = Hierarchy::make_block_iname(Packaging::home_of(iname));
@@ -848,6 +862,16 @@ insert them into the Inter stream close to the top.
return rsymb;
}
+ inter_name *Emit::kernel(inter_name *public_name) {
+ if (Packaging::housed_in_function(public_name) == FALSE)
+ internal_error("routine not housed in function");
+ return Hierarchy::make_kernel_iname(Packaging::home_of(public_name));
+ }
+
+ void Emit::end_main_block(packaging_state save) {
+ Packaging::exit(save);
+ }
+
void Emit::routine(inter_name *rname, kind *rkind, inter_symbol *block_name) {
if (Emit::IRS() == NULL) internal_error("no inter repository");
inter_symbol *AB_symbol = Emit::kind_to_symbol(rkind);
@@ -986,11 +1010,11 @@ insert them into the Inter stream close to the top.
The function Emit::primitive is used in 27/ip (§2).
-The function Emit::main_scope is used in §2, 13/rsfk (§5, §25), 27/is (§32).
+The function Emit::main_scope is used in §2, 13/rsfk (§5, §24), 27/is (§32).
The function Emit::global_scope appears nowhere else.
-The function Emit::main_render_unique is used in 13/rsfk (§25).
+The function Emit::main_render_unique is used in 13/rsfk (§24).
The function Emit::seek_symbol is used in 13/rsfk (§5), 27/is (§32).
@@ -1010,7 +1034,7 @@ insert them into the Inter stream close to the top.
The function Emit::guard is used in §2, §4.
-The function Emit::kind is used in 13/rsfk (§23, §25).
+The function Emit::kind is used in 13/rsfk (§22, §24).
The function Emit::kind_inner is used in §2.
@@ -1038,9 +1062,11 @@ insert them into the Inter stream close to the top.
The function Emit::instance is used in 5/ins (§34).
-The function Emit::named_generic_constant is used in 21/rl (§9).
+The function Emit::named_generic_constant_xiname is used in 21/rl (§9).
-The function Emit::named_numeric_constant is used in 6/rlt (§20.3), 13/kak (§5), 13/rsfk (§25), 21/ac (§6), 22/cs (§8), 24/ch (§8), 26/vm (§8), 26/uo (§21), 26/pl (§12), 26/ts (§10), 27/hr (§4).
+The function Emit::named_generic_constant appears nowhere else.
+
+The function Emit::named_numeric_constant is used in 6/rlt (§20.3), 13/kak (§5), 13/rsfk (§24), 21/ac (§6), 22/cs (§8), 24/ch (§8), 26/vm (§8), 26/uo (§21), 26/pl (§12), 26/ts (§10), 27/hr (§4).
The function Emit::hold_numeric_constant appears nowhere else.
@@ -1106,12 +1132,16 @@ insert them into the Inter stream close to the top.
The function Emit::early_comment appears nowhere else.
-The function Emit::code_comment is used in 4/am (§34.2), 5/lp (§27, §29, §30), 6/nv (§18.2), 12/cdp (§1), 13/rsfk (§25.1), 20/eq (§47), 25/ci (§3.2.3), 25/cp (§5.1).
+The function Emit::code_comment is used in 4/am (§34.2), 5/lp (§27, §29, §30), 6/nv (§18.2), 12/cdp (§1), 13/rsfk (§24.1), 20/eq (§47), 25/ci (§3.2.3), 25/cp (§5.1).
The function Emit::package is used in 27/pc (§4).
The function Emit::block is used in 26/rt (§3, §4.1).
+The function Emit::kernel is used in 26/rt (§4).
+
+The function Emit::end_main_block is used in 26/rt (§4).
+
The function Emit::routine is used in 26/rt (§4, §4.1).
The function Emit::reserve_label is used in 5/lp (§19, §28), 12/cdp (§2.1.6.1.2.2.2.1, §2.1.6.1.6), 24/pb (§14, §17), 25/cii (§3.4.1), 25/cp (§5.4.3), 27/is (§31.1).
@@ -1122,11 +1152,11 @@ insert them into the Inter stream close to the top.
The function Emit::local is used in 24/lv (§47), 26/rt (§4.1.1).
-The function Emit::inv_primitive is used in 4/am (§35, §43), 5/lp (§19, §19.1, §19.2, §19.3, §19.3.1, §19.3.1.1, §19.3.2, §19.2.1, §19.2.2, §27, §27.2, §27.3, §27.3.1, §27.3.2, §27.3.3, §27.3.4), 5/ins (§29), 5/nv (§12, §16), 6/bp (§25), 6/rlt (§15, §15.2, §15.2.4, §15.2.5, §15.2.6, §15.2.7, §15.2.8, §15.2.9, §15.2.10, §15.2.11, §15.2.12, §15.2.9.1, §15.2.10.1, §15.2.12.1, §17, §29.1, §29.2, §29.3, §29.4, §29.5, §29.6, §30), 6/nv (§17, §18.1, §18.2, §18.1.2, §18.1.2.1, §18.1.2.2, §19), 8/ef (§19), 12/ca (§5.2), 12/dtd (§7.1, §7.1.1, §8, §9, §9.1, §15, §16, §18, §19, §20, §22, §23, §25, §26, §27), 12/cdp (§2.1.6, §2.1.6.1.2.2, §2.1.6.1.2.3.2, §2.1.6.1.2.3.7, §2.1.6.1.2.4, §2.1.6.1.2.5, §2.1.6.1.2.2.2, §2.1.6.1.2.2.2.1, §2.1.6.1.7, §2.1.6.1.8, §2.1.6.1.2.2.3, §2.1.6.1.9, §2.1.6.1.10, §2.1.6.1.2.2.4, §2.1.6.1.11, §2.1.6.1.2.2.5, §2.1.6.1.13, §2.1.6.1.14, §2.1.6.1.2.2.6, §2.1.6.1.2.2.6.1, §2.1.6.1.15, §2.1.6.1.17, §2.1.6.1.2.2.7, §2.1.6.1.18), 13/kak (§2), 13/ca (§1.2, §1.3, §1.4, §1.10, §1.11, §1.12, §1.13), 13/rsfk (§16.3, §25.1, §25.2, §25.3, §25.4.1, §25.4.2, §25.5, §25.5.1, §25.6.1, §25.6.2, §25.6.3, §25.6.4, §25.6.5, §25.6.6, §26), 14/rv (§24.3), 14/lv (§14.3.2), 14/cn (§16.1, §16.2, §16.3), 15/ma (§13), 15/epv (§4), 17/tl (§14.2), 17/ts (§11.1), 17/rs (§6.2, §7.2), 19/tc (§8), 19/rsft (§2), 21/rl (§11, §11.2, §20, §20.1, §20.2, §22.1), 21/rb (§24.1.1, §24.1.2, §24.1.3, §24.1.5, §24.1.3.1), 21/rl2 (§14.1), 21/fao (§10), 21/sv (§3, §3.1, §3.2), 21/ac (§14), 22/prcd (§10, §10.2, §10.3, §10.4, §10.5, §10.1.1.1), 22/pav (§9.2), 23/abc (§1), 24/lv (§28, §29, §43), 24/pb (§17), 24/ch (§3, §3.1, §6, §7, §7.1, §7.2, §7.3, §7.4, §7.4.1, §7.5), 25/ci (§3, §3.2.3, §3.2.3.2, §3.2.3.1.1, §3.2.3.3.1.2, §3.2.3.4.1.1, §3.2.3.3.1.2.1, §3.2.3.3.1.3, §4.2), 25/ciac (§2), 25/cii (§1.2.1, §3.1.1.4.10, §3.5.3, §3.5.8.1, §3.5.8.2, §3.5.8.3, §3.5.9), 25/cp (§3.3.1, §5.2.1, §5.3.4, §5.3.5, §5.3.5.1, §5.3.5.2, §5.3.5.3), 26/uo (§21.1, §21.2), 26/lt (§4.1), 26/rt (§4.1.3, §4.1.5), 26/ts (§10, §11, §12), 27/is (§31.4, §31.5, §31.6, §31.7, §31.8).
+The function Emit::inv_primitive is used in 4/am (§35, §43), 5/lp (§19, §19.1, §19.2, §19.3, §19.3.1, §19.3.1.1, §19.3.2, §19.2.1, §19.2.2, §27, §27.2, §27.3, §27.3.1, §27.3.2, §27.3.3, §27.3.4), 5/ins (§29), 5/nv (§12, §16), 6/bp (§25), 6/rlt (§15, §15.2, §15.2.4, §15.2.5, §15.2.6, §15.2.7, §15.2.8, §15.2.9, §15.2.10, §15.2.11, §15.2.12, §15.2.9.1, §15.2.10.1, §15.2.12.1, §17, §29.1, §29.2, §29.3, §29.4, §29.5, §29.6, §30), 6/nv (§17, §18.1, §18.2, §18.1.2, §18.1.2.1, §18.1.2.2, §19), 8/ef (§19), 12/ca (§5.2), 12/dtd (§7.1, §7.1.1, §8, §9, §9.1, §15, §16, §18, §19, §20, §22, §23, §25, §26, §27), 12/cdp (§2.1.6, §2.1.6.1.2.2, §2.1.6.1.2.3.2, §2.1.6.1.2.3.7, §2.1.6.1.2.4, §2.1.6.1.2.5, §2.1.6.1.2.2.2, §2.1.6.1.2.2.2.1, §2.1.6.1.7, §2.1.6.1.8, §2.1.6.1.2.2.3, §2.1.6.1.9, §2.1.6.1.10, §2.1.6.1.2.2.4, §2.1.6.1.11, §2.1.6.1.2.2.5, §2.1.6.1.13, §2.1.6.1.14, §2.1.6.1.2.2.6, §2.1.6.1.2.2.6.1, §2.1.6.1.15, §2.1.6.1.17, §2.1.6.1.2.2.7, §2.1.6.1.18), 13/kak (§2), 13/ca (§1.2, §1.3, §1.4, §1.10, §1.11, §1.12, §1.13), 13/rsfk (§16.3, §24.1, §24.2, §24.3, §24.4.1, §24.4.2, §24.5, §24.5.1, §24.6.1, §24.6.2, §24.6.3, §24.6.4, §24.6.5, §24.6.6, §25), 14/rv (§24.3), 14/lv (§14.3.2), 14/cn (§16.1, §16.2, §16.3), 15/ma (§13), 15/epv (§4), 17/tl (§14.2), 17/ts (§11.1), 17/rs (§6.2, §7.2), 19/tc (§8), 19/rsft (§2), 21/rl (§11, §11.2, §20, §20.1, §20.2, §22.1), 21/rb (§24.1.1, §24.1.2, §24.1.3, §24.1.5, §24.1.3.1), 21/rl2 (§14.1), 21/fao (§10), 21/sv (§3, §3.1, §3.2), 21/ac (§14), 22/prcd (§10, §10.2, §10.3, §10.4, §10.5, §10.1.1.1), 22/pav (§9.2), 23/abc (§1), 24/lv (§28, §29, §43), 24/pb (§17), 24/ch (§3, §3.1, §6, §7, §7.1, §7.2, §7.3, §7.4, §7.4.1, §7.5), 25/ci (§3, §3.2.3, §3.2.3.2, §3.2.3.1.1, §3.2.3.3.1.2, §3.2.3.4.1.1, §3.2.3.3.1.2.1, §3.2.3.3.1.3, §4.2), 25/ciac (§2), 25/cii (§1.2.1, §3.1.1.4.10, §3.5.3, §3.5.8.1, §3.5.8.2, §3.5.8.3, §3.5.9), 25/cp (§3.3.1, §5.2.1, §5.3.4, §5.3.5, §5.3.5.1, §5.3.5.2, §5.3.5.3), 26/uo (§21.1, §21.2), 26/lt (§4.1), 26/rt (§4.1.3, §4.1.5), 26/ts (§10, §11, §12), 27/is (§31.4, §31.5, §31.6, §31.7, §31.8).
The function Emit::inv_call is used in 27/is (§31.4).
-The function Emit::inv_call_iname is used in 4/am (§43), 5/lp (§19, §19.3.1, §19.3.1.1, §19.3.2, §19.2.1), 5/nv (§12), 6/bp (§33), 6/rlt (§15, §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 (§7, §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), 17/ts (§8), 17/rs (§6.1, §6.2, §7.2), 20/eq (§48), 21/rl (§11.2, §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.1.2, §4.1.3, §4.1.4), 26/ts (§10, §12).
+The function Emit::inv_call_iname is used in 4/am (§43), 5/lp (§19, §19.3.1, §19.3.1.1, §19.3.2, §19.2.1), 5/nv (§12), 6/bp (§33), 6/rlt (§15, §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 (§7, §19, §24.6.1, §24.6.2, §24.6.3, §24.6.4, §24.6.5, §24.6.6), 14/lv (§14.3, §14.4, §14.5), 14/cfs (§7), 17/ts (§8), 17/rs (§6.1, §6.2, §7.2), 20/eq (§48), 21/rl (§11.2, §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.1.2, §4.1.3, §4.1.4), 26/ts (§10, §12).
The function Emit::inv_indirect_call appears nowhere else.
@@ -1134,9 +1164,9 @@ insert them into the Inter stream close to the top.
The function Emit::return appears nowhere else.
-The function Emit::rtrue is used in 5/lp (§27, §27.3.4), 6/rlt (§15.2.2, §15.2.3, §15.2.4, §15.2.7, §15.2.9.1, §29.4, §29.5, §29.6), 6/nv (§18.1), 12/cdp (§2.1.6.1.2.2.1), 13/rsfk (§25.6.5), 15/ma (§13), 17/ts (§11.1), 19/rsft (§2), 21/rl (§20.2), 21/fao (§10), 24/ch (§6), 25/cp (§5.4.4), 26/uo (§21.1).
+The function Emit::rtrue is used in 5/lp (§27, §27.3.4), 6/rlt (§15.2.2, §15.2.3, §15.2.4, §15.2.7, §15.2.9.1, §29.4, §29.5, §29.6), 6/nv (§18.1), 12/cdp (§2.1.6.1.2.2.1), 13/rsfk (§24.6.5), 15/ma (§13), 17/ts (§11.1), 19/rsft (§2), 21/rl (§20.2), 21/fao (§10), 24/ch (§6), 25/cp (§5.4.4), 26/uo (§21.1).
-The function Emit::rfalse is used in 4/am (§34.2), 6/bp (§25), 6/rlt (§15.2, §15.2.2, §15.2.3, §15.2.4, §15.2.9.1, §29.4), 6/nv (§18.1), 12/cdp (§2.1.6.1.4), 13/rsfk (§25.6.5, §25.6.6), 15/ma (§13), 20/eq (§43), 21/rb (§23), 21/fao (§10), 24/ch (§6), 26/uo (§21.1), 26/lt (§4.1), 26/ts (§10).
+The function Emit::rfalse is used in 4/am (§34.2), 6/bp (§25), 6/rlt (§15.2, §15.2.2, §15.2.3, §15.2.4, §15.2.9.1, §29.4), 6/nv (§18.1), 12/cdp (§2.1.6.1.4), 13/rsfk (§24.6.5, §24.6.6), 15/ma (§13), 20/eq (§43), 21/rb (§23), 21/fao (§10), 24/ch (§6), 26/uo (§21.1), 26/lt (§4.1), 26/ts (§10).
The function Emit::push is used in 26/rt (§4.1.2).
@@ -1495,19 +1525,19 @@ insert them into the Inter stream close to the top.
The function Emit::at is used in §3.
-The function Emit::down is used in §3, 4/am (§35, §43), 5/lp (§19, §19.1, §19.2, §19.3, §19.3.1, §19.3.1.1, §19.3.2, §19.2.1, §19.2.2, §27, §27.2, §27.3, §27.3.1, §27.3.2, §27.3.3, §27.3.4), 5/ins (§29), 5/nv (§12, §16), 6/bp (§25, §33), 6/rlt (§15, §15.2, §15.2.1, §15.2.4, §15.2.5, §15.2.5.1, §15.2.6, §15.2.7, §15.2.8, §15.2.9, §15.2.10, §15.2.11, §15.2.12, §15.2.9.1, §15.2.10.1, §15.2.12.1, §17, §29.1, §29.2, §29.3, §29.4, §29.5, §29.6, §30), 6/nv (§17, §18.1, §18.2, §18.1.2, §18.1.2.1, §18.1.2.2, §19), 8/ef (§19), 12/ca (§5.2), 12/dtd (§7.1, §7.1.1, §7.1.2, §8, §9, §9.1, §11, §15, §16, §17, §18, §19, §20, §22, §23, §25, §26, §27), 12/cdp (§2.1.6, §2.1.6.1.2.2, §2.1.6.1.2.3.2, §2.1.6.1.2.3.7, §2.1.6.1.2.4, §2.1.6.1.2.5, §2.1.6.1.2.3.3.1, §2.1.6.1.2.2.2, §2.1.6.1.2.2.2.1, §2.1.6.1.7, §2.1.6.1.8, §2.1.6.1.2.2.3, §2.1.6.1.9, §2.1.6.1.10, §2.1.6.1.2.2.4, §2.1.6.1.11, §2.1.6.1.2.2.5, §2.1.6.1.13, §2.1.6.1.14, §2.1.6.1.2.2.6, §2.1.6.1.2.2.6.1, §2.1.6.1.15, §2.1.6.1.17, §2.1.6.1.2.2.7, §2.1.6.1.18), 13/kak (§2), 13/ca (§1, §1.2, §1.3, §1.4, §1.5, §1.6, §1.7, §1.8, §1.9, §1.10, §1.11, §1.12, §1.13), 13/rsfk (§7, §16.3, §19, §25.1, §25.2, §25.3, §25.4.1, §25.4.2, §25.5, §25.5.1, §25.6.1, §25.6.2, §25.6.3, §25.6.4, §25.6.5, §25.6.6, §26), 14/rv (§24.3), 14/lv (§14.3, §14.3.2, §14.4, §14.5), 14/cn (§16.1, §16.2, §16.3), 14/cfs (§7), 15/ma (§13), 15/epv (§4), 17/tl (§14.2), 17/ts (§8, §11.1), 17/rs (§6.1, §6.2, §7.2), 19/tc (§8), 19/rsft (§2), 20/eq (§48), 21/rl (§11, §11.2, §20, §20.1, §20.2, §22.1), 21/rb (§24.1.1, §24.1.2, §24.1.3, §24.1.4, §24.1.5, §24.1.3.1), 21/rl2 (§14.1), 21/fao (§10), 21/sv (§3, §3.1, §3.2), 21/ac (§14), 22/prcd (§10, §10.2, §10.3, §10.4, §10.5, §10.1.1.1), 22/pav (§9.2), 23/abc (§1), 24/lv (§28, §29, §41, §43), 24/pb (§17), 24/ch (§3, §4, §6, §7, §7.1, §7.2, §7.3, §7.4, §7.4.1, §7.5), 25/ci (§3, §3.2.3, §3.2.3.2, §3.2.3.1.1, §3.2.3.3, §3.2.3.6, §3.2.3.3.1.2, §3.2.3.4.1.1, §3.2.3.3.1.2.1, §3.2.3.3.1.3, §4.2), 25/ciac (§2), 25/cii (§1.2.1, §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, §3.5.8.2, §3.5.8.3, §3.5.9), 25/cp (§3.3.1, §5.2.1, §5.3.4, §5.3.5, §5.3.5.1, §5.3.5.2, §5.3.5.3), 26/uo (§21.1, §21.2), 26/lt (§4.1), 26/rt (§4.1.2, §4.1.3, §4.1.4, §4.1.5), 26/iti (§9), 26/ts (§10, §11, §12), 27/is (§31.2, §31.3, §31.4, §31.5, §31.6, §31.7, §31.8, §31.9).
+The function Emit::down is used in §3, 4/am (§35, §43), 5/lp (§19, §19.1, §19.2, §19.3, §19.3.1, §19.3.1.1, §19.3.2, §19.2.1, §19.2.2, §27, §27.2, §27.3, §27.3.1, §27.3.2, §27.3.3, §27.3.4), 5/ins (§29), 5/nv (§12, §16), 6/bp (§25, §33), 6/rlt (§15, §15.2, §15.2.1, §15.2.4, §15.2.5, §15.2.5.1, §15.2.6, §15.2.7, §15.2.8, §15.2.9, §15.2.10, §15.2.11, §15.2.12, §15.2.9.1, §15.2.10.1, §15.2.12.1, §17, §29.1, §29.2, §29.3, §29.4, §29.5, §29.6, §30), 6/nv (§17, §18.1, §18.2, §18.1.2, §18.1.2.1, §18.1.2.2, §19), 8/ef (§19), 12/ca (§5.2), 12/dtd (§7.1, §7.1.1, §7.1.2, §8, §9, §9.1, §11, §15, §16, §17, §18, §19, §20, §22, §23, §25, §26, §27), 12/cdp (§2.1.6, §2.1.6.1.2.2, §2.1.6.1.2.3.2, §2.1.6.1.2.3.7, §2.1.6.1.2.4, §2.1.6.1.2.5, §2.1.6.1.2.3.3.1, §2.1.6.1.2.2.2, §2.1.6.1.2.2.2.1, §2.1.6.1.7, §2.1.6.1.8, §2.1.6.1.2.2.3, §2.1.6.1.9, §2.1.6.1.10, §2.1.6.1.2.2.4, §2.1.6.1.11, §2.1.6.1.2.2.5, §2.1.6.1.13, §2.1.6.1.14, §2.1.6.1.2.2.6, §2.1.6.1.2.2.6.1, §2.1.6.1.15, §2.1.6.1.17, §2.1.6.1.2.2.7, §2.1.6.1.18), 13/kak (§2), 13/ca (§1, §1.2, §1.3, §1.4, §1.5, §1.6, §1.7, §1.8, §1.9, §1.10, §1.11, §1.12, §1.13), 13/rsfk (§7, §16.3, §19, §24.1, §24.2, §24.3, §24.4.1, §24.4.2, §24.5, §24.5.1, §24.6.1, §24.6.2, §24.6.3, §24.6.4, §24.6.5, §24.6.6, §25), 14/rv (§24.3), 14/lv (§14.3, §14.3.2, §14.4, §14.5), 14/cn (§16.1, §16.2, §16.3), 14/cfs (§7), 15/ma (§13), 15/epv (§4), 17/tl (§14.2), 17/ts (§8, §11.1), 17/rs (§6.1, §6.2, §7.2), 19/tc (§8), 19/rsft (§2), 20/eq (§48), 21/rl (§11, §11.2, §20, §20.1, §20.2, §22.1), 21/rb (§24.1.1, §24.1.2, §24.1.3, §24.1.4, §24.1.5, §24.1.3.1), 21/rl2 (§14.1), 21/fao (§10), 21/sv (§3, §3.1, §3.2), 21/ac (§14), 22/prcd (§10, §10.2, §10.3, §10.4, §10.5, §10.1.1.1), 22/pav (§9.2), 23/abc (§1), 24/lv (§28, §29, §41, §43), 24/pb (§17), 24/ch (§3, §4, §6, §7, §7.1, §7.2, §7.3, §7.4, §7.4.1, §7.5), 25/ci (§3, §3.2.3, §3.2.3.2, §3.2.3.1.1, §3.2.3.3, §3.2.3.6, §3.2.3.3.1.2, §3.2.3.4.1.1, §3.2.3.3.1.2.1, §3.2.3.3.1.3, §4.2), 25/ciac (§2), 25/cii (§1.2.1, §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, §3.5.8.2, §3.5.8.3, §3.5.9), 25/cp (§3.3.1, §5.2.1, §5.3.4, §5.3.5, §5.3.5.1, §5.3.5.2, §5.3.5.3), 26/uo (§21.1, §21.2), 26/lt (§4.1), 26/rt (§4.1.2, §4.1.3, §4.1.4, §4.1.5), 26/iti (§9), 26/ts (§10, §11, §12), 27/is (§31.2, §31.3, §31.4, §31.5, §31.6, §31.7, §31.8, §31.9).
-The function Emit::up is used in §3, 4/am (§35, §43), 5/lp (§19, §19.1, §19.2, §19.3, §19.3.1, §19.3.1.1, §19.3.2, §19.2.1, §19.2.2, §27, §27.2, §27.3, §27.3.1, §27.3.2, §27.3.3, §27.3.4), 5/ins (§29), 5/nv (§12, §16), 6/bp (§25, §33), 6/rlt (§15, §15.2, §15.2.1, §15.2.4, §15.2.5, §15.2.5.1, §15.2.6, §15.2.7, §15.2.8, §15.2.9, §15.2.10, §15.2.11, §15.2.12, §15.2.9.1, §15.2.10.1, §15.2.12.1, §17, §29.1, §29.2, §29.3, §29.4, §29.5, §29.6, §30), 6/nv (§17, §18.1, §18.2, §18.1.2, §18.1.2.1, §18.1.2.2, §19), 8/ef (§19), 12/is (§8), 12/ca (§5.2), 12/dtd (§7.1, §7.1.2, §8, §9, §9.1, §11, §15, §16, §17, §18, §19, §20, §22, §23, §25, §26, §27), 12/cdp (§2.1.6, §2.1.6.1, §2.1.6.1.2.2, §2.1.6.1.2.3.3, §2.1.6.1.2.3.7, §2.1.6.1.2.4, §2.1.6.1.2.5, §2.1.6.1.2.6, §2.1.6.1.2.2.2, §2.1.6.1.2.2.2.1, §2.1.6.1.7, §2.1.6.1.8, §2.1.6.1.2.2.3, §2.1.6.1.9, §2.1.6.1.10, §2.1.6.1.2.2.4, §2.1.6.1.11, §2.1.6.1.2.2.5, §2.1.6.1.13, §2.1.6.1.14, §2.1.6.1.2.2.6, §2.1.6.1.2.2.6.1, §2.1.6.1.15, §2.1.6.1.17, §2.1.6.1.2.2.7, §2.1.6.1.18), 13/kak (§2), 13/ca (§1, §1.2, §1.3, §1.4, §1.5, §1.6, §1.7, §1.8, §1.9, §1.10, §1.11, §1.12, §1.13), 13/rsfk (§16.3, §19, §25.1, §25.2, §25.3, §25.4.1, §25.4.2, §25.5, §25.5.1, §25.6.1, §25.6.2, §25.6.3, §25.6.4, §25.6.5, §25.6.6, §26), 14/rv (§24.3), 14/lv (§14.3, §14.3.2, §14.4, §14.5), 14/cn (§16.1, §16.2, §16.3), 14/cfs (§7, §8), 15/ma (§13), 15/epv (§4), 17/tl (§14.2), 17/ts (§8, §11.1), 17/rs (§6.1, §6.2, §7.2, §12.1.1), 19/tc (§8), 19/rsft (§2), 20/eq (§48), 21/rl (§11, §11.2, §20, §20.1, §20.2, §22.1), 21/rb (§24.1.1, §24.1.2, §24.1.3, §24.1.4, §24.1.5, §24.1.3.1), 21/rl2 (§14.1), 21/fao (§10), 21/sv (§3, §3.1, §3.2), 21/ac (§14), 22/prcd (§10, §10.3, §10.4, §10.1.1.1), 22/pav (§9.2), 23/abc (§1), 24/lv (§28, §29, §41, §43), 24/pb (§17), 24/ch (§3, §4, §6, §7, §7.1, §7.2, §7.3, §7.4, §7.4.1, §7.5), 25/ci (§3, §3.2.3, §3.2.3.2, §3.2.3.1.1, §3.2.3.3, §3.2.3.6, §3.2.3.4.1, §3.2.3.3.1.2.1, §3.2.3.3.1.3, §4.2), 25/ciac (§2), 25/cii (§1.2.1, §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, §3.5.8.2, §3.5.8.3, §3.5.9), 25/cp (§3.3.1, §5.2.1, §5.3.4, §5.3.5, §5.3.5.1, §5.3.5.2, §5.3.5.3, §5.4.5), 26/uo (§21.1, §21.2), 26/lt (§4.1), 26/rt (§4.1.2, §4.1.3, §4.1.4, §4.1.5), 26/iti (§9), 26/ts (§10, §11, §12), 27/is (§31.2, §31.3, §31.4, §31.5, §31.6, §31.7, §31.8, §31.9).
+The function Emit::up is used in §3, 4/am (§35, §43), 5/lp (§19, §19.1, §19.2, §19.3, §19.3.1, §19.3.1.1, §19.3.2, §19.2.1, §19.2.2, §27, §27.2, §27.3, §27.3.1, §27.3.2, §27.3.3, §27.3.4), 5/ins (§29), 5/nv (§12, §16), 6/bp (§25, §33), 6/rlt (§15, §15.2, §15.2.1, §15.2.4, §15.2.5, §15.2.5.1, §15.2.6, §15.2.7, §15.2.8, §15.2.9, §15.2.10, §15.2.11, §15.2.12, §15.2.9.1, §15.2.10.1, §15.2.12.1, §17, §29.1, §29.2, §29.3, §29.4, §29.5, §29.6, §30), 6/nv (§17, §18.1, §18.2, §18.1.2, §18.1.2.1, §18.1.2.2, §19), 8/ef (§19), 12/is (§8), 12/ca (§5.2), 12/dtd (§7.1, §7.1.2, §8, §9, §9.1, §11, §15, §16, §17, §18, §19, §20, §22, §23, §25, §26, §27), 12/cdp (§2.1.6, §2.1.6.1, §2.1.6.1.2.2, §2.1.6.1.2.3.3, §2.1.6.1.2.3.7, §2.1.6.1.2.4, §2.1.6.1.2.5, §2.1.6.1.2.6, §2.1.6.1.2.2.2, §2.1.6.1.2.2.2.1, §2.1.6.1.7, §2.1.6.1.8, §2.1.6.1.2.2.3, §2.1.6.1.9, §2.1.6.1.10, §2.1.6.1.2.2.4, §2.1.6.1.11, §2.1.6.1.2.2.5, §2.1.6.1.13, §2.1.6.1.14, §2.1.6.1.2.2.6, §2.1.6.1.2.2.6.1, §2.1.6.1.15, §2.1.6.1.17, §2.1.6.1.2.2.7, §2.1.6.1.18), 13/kak (§2), 13/ca (§1, §1.2, §1.3, §1.4, §1.5, §1.6, §1.7, §1.8, §1.9, §1.10, §1.11, §1.12, §1.13), 13/rsfk (§16.3, §19, §24.1, §24.2, §24.3, §24.4.1, §24.4.2, §24.5, §24.5.1, §24.6.1, §24.6.2, §24.6.3, §24.6.4, §24.6.5, §24.6.6, §25), 14/rv (§24.3), 14/lv (§14.3, §14.3.2, §14.4, §14.5), 14/cn (§16.1, §16.2, §16.3), 14/cfs (§7, §8), 15/ma (§13), 15/epv (§4), 17/tl (§14.2), 17/ts (§8, §11.1), 17/rs (§6.1, §6.2, §7.2, §12.1.1), 19/tc (§8), 19/rsft (§2), 20/eq (§48), 21/rl (§11, §11.2, §20, §20.1, §20.2, §22.1), 21/rb (§24.1.1, §24.1.2, §24.1.3, §24.1.4, §24.1.5, §24.1.3.1), 21/rl2 (§14.1), 21/fao (§10), 21/sv (§3, §3.1, §3.2), 21/ac (§14), 22/prcd (§10, §10.3, §10.4, §10.1.1.1), 22/pav (§9.2), 23/abc (§1), 24/lv (§28, §29, §41, §43), 24/pb (§17), 24/ch (§3, §4, §6, §7, §7.1, §7.2, §7.3, §7.4, §7.4.1, §7.5), 25/ci (§3, §3.2.3, §3.2.3.2, §3.2.3.1.1, §3.2.3.3, §3.2.3.6, §3.2.3.4.1, §3.2.3.3.1.2.1, §3.2.3.3.1.3, §4.2), 25/ciac (§2), 25/cii (§1.2.1, §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, §3.5.8.2, §3.5.8.3, §3.5.9), 25/cp (§3.3.1, §5.2.1, §5.3.4, §5.3.5, §5.3.5.1, §5.3.5.2, §5.3.5.3, §5.4.5), 26/uo (§21.1, §21.2), 26/lt (§4.1), 26/rt (§4.1.2, §4.1.3, §4.1.4, §4.1.5), 26/iti (§9), 26/ts (§10, §11, §12), 27/is (§31.2, §31.3, §31.4, §31.5, §31.6, §31.7, §31.8, §31.9).
The function Emit::pop_code_position is used in 17/ts (§11).
-The function Emit::code is used in 4/am (§35, §43), 5/lp (§19, §19.1, §19.2, §19.3, §19.3.1, §19.3.1.1, §19.3.2, §19.2.1, §19.2.2, §27, §27.2, §27.3.3, §27.3.4), 6/bp (§25), 6/rlt (§15.2, §15.2.4, §15.2.9, §15.2.12, §15.2.9.1, §15.2.10.1, §15.2.12.1, §29.1, §29.2, §29.3, §29.4, §29.5, §29.6), 6/nv (§18.1, §18.2, §18.1.2, §18.1.2.1, §18.1.2.2, §19), 8/ef (§19), 12/dtd (§23, §27), 12/cdp (§2.1.6, §2.1.6.1.2.3.3.1, §2.1.6.1.2.2.3, §2.1.6.1.10, §2.1.6.1.2.2.4, §2.1.6.1.11, §2.1.6.1.14, §2.1.6.1.2.2.6, §2.1.6.1.17), 13/rsfk (§16.3, §25.3, §25.5, §25.6.1, §25.6.2, §25.6.3, §25.6.4, §25.6.5, §25.6.6, §26), 15/ma (§13), 17/ts (§11.1), 17/rs (§6.2, §7.2), 19/tc (§8), 19/rsft (§2), 21/rl (§11, §20, §20.2), 21/rb (§24.1.2, §24.1.3, §24.1.4, §24.1.3.1), 21/rl2 (§14.1), 21/fao (§10), 21/sv (§3), 22/prcd (§10, §10.2, §10.3, §10.4, §10.5, §10.1.1.1), 24/ch (§6, §7, §7.4, §7.5), 25/ci (§3.2.3.3, §3.2.3.6, §3.2.3.3.1.2), 25/cii (§3.5.9), 25/cp (§5.3.4, §5.3.5, §5.3.5.1, §5.3.5.2, §5.3.5.3), 26/uo (§21.1, §21.2), 26/lt (§4.1), 26/ts (§10), 27/is (§31.2).
+The function Emit::code is used in 4/am (§35, §43), 5/lp (§19, §19.1, §19.2, §19.3, §19.3.1, §19.3.1.1, §19.3.2, §19.2.1, §19.2.2, §27, §27.2, §27.3.3, §27.3.4), 6/bp (§25), 6/rlt (§15.2, §15.2.4, §15.2.9, §15.2.12, §15.2.9.1, §15.2.10.1, §15.2.12.1, §29.1, §29.2, §29.3, §29.4, §29.5, §29.6), 6/nv (§18.1, §18.2, §18.1.2, §18.1.2.1, §18.1.2.2, §19), 8/ef (§19), 12/dtd (§23, §27), 12/cdp (§2.1.6, §2.1.6.1.2.3.3.1, §2.1.6.1.2.2.3, §2.1.6.1.10, §2.1.6.1.2.2.4, §2.1.6.1.11, §2.1.6.1.14, §2.1.6.1.2.2.6, §2.1.6.1.17), 13/rsfk (§16.3, §24.3, §24.5, §24.6.1, §24.6.2, §24.6.3, §24.6.4, §24.6.5, §24.6.6, §25), 15/ma (§13), 17/ts (§11.1), 17/rs (§6.2, §7.2), 19/tc (§8), 19/rsft (§2), 21/rl (§11, §20, §20.2), 21/rb (§24.1.2, §24.1.3, §24.1.4, §24.1.3.1), 21/rl2 (§14.1), 21/fao (§10), 21/sv (§3), 22/prcd (§10, §10.2, §10.3, §10.4, §10.5, §10.1.1.1), 24/ch (§6, §7, §7.4, §7.5), 25/ci (§3.2.3.3, §3.2.3.6, §3.2.3.3.1.2), 25/cii (§3.5.9), 25/cp (§5.3.4, §5.3.5, §5.3.5.1, §5.3.5.2, §5.3.5.3), 26/uo (§21.1, §21.2), 26/lt (§4.1), 26/ts (§10), 27/is (§31.2).
The function Emit::evaluation is used in 26/iti (§9), 27/is (§31.9).
The function Emit::reference is used in 13/ca (§1.10), 27/is (§31.6, §31.9).
-The function Emit::val is used in §3, 4/am (§43), 5/lp (§19, §19.2, §19.3, §19.3.1, §19.3.1.1, §19.3.2, §19.2.1, §19.2.2, §27, §27.2, §27.3.3, §27.3.4), 5/nv (§12), 6/rlt (§15, §15.2.1, §15.2.4, §15.2.6, §15.2.7, §15.2.8, §15.2.10, §15.2.11, §15.2.12, §15.2.12.1), 6/nv (§17, §18.1, §18.1.2, §18.1.2.1, §18.1.2.2, §19), 8/ef (§19), 12/is (§7.3), 12/dtd (§7, §8, §9, §9.1, §10, §15, §18, §19, §20, §22, §23, §25, §26, §27), 12/cdp (§2.1.6, §2.1.6.1.2.3.7, §2.1.6.1.2.5, §2.1.6.1.2.2.3, §2.1.6.1.10, §2.1.6.1.11, §2.1.6.1.14, §2.1.6.1.2.2.6, §2.1.6.1.17), 13/rsfk (§9, §16.3, §19, §25.4.1, §25.4.2, §25.5, §25.5.1, §25.6.2, §25.6.3, §25.6.4), 14/vh (§3), 14/lv (§14.5), 14/cn (§16, §16.3), 15/epv (§4), 16/is (§29), 17/rs (§6.2, §7.2), 19/tc (§8), 21/rl (§11.1, §11.2, §20), 21/rb (§24.1.3, §24.1.5), 21/rl2 (§14.1), 21/fao (§10), 21/sv (§3), 21/ac (§14), 22/prcd (§10, §10.5, §10.1.1.1), 22/pav (§9.2), 24/lv (§28, §29, §43), 24/ch (§3, §4, §7.1, §7.2, §7.3, §7.4, §7.5), 25/ci (§3.2.3.1.1, §3.2.3.6, §3.2.3.3.1.3), 25/ciac (§2, §2.1), 25/cii (§3.1, §3.4.2, §3.1.1.4.10, §3.1.1.4.11, §3.6.1), 25/cp (§3.3.1, §5.2.1), 26/uo (§21.1, §21.2), 26/lt (§4.1), 26/rt (§4.1.2, §4.1.4), 26/iti (§9), 26/ts (§10, §12), 27/is (§31.5, §31.9).
+The function Emit::val is used in §3, 4/am (§43), 5/lp (§19, §19.2, §19.3, §19.3.1, §19.3.1.1, §19.3.2, §19.2.1, §19.2.2, §27, §27.2, §27.3.3, §27.3.4), 5/nv (§12), 6/rlt (§15, §15.2.1, §15.2.4, §15.2.6, §15.2.7, §15.2.8, §15.2.10, §15.2.11, §15.2.12, §15.2.12.1), 6/nv (§17, §18.1, §18.1.2, §18.1.2.1, §18.1.2.2, §19), 8/ef (§19), 12/is (§7.3), 12/dtd (§7, §8, §9, §9.1, §10, §15, §18, §19, §20, §22, §23, §25, §26, §27), 12/cdp (§2.1.6, §2.1.6.1.2.3.7, §2.1.6.1.2.5, §2.1.6.1.2.2.3, §2.1.6.1.10, §2.1.6.1.11, §2.1.6.1.14, §2.1.6.1.2.2.6, §2.1.6.1.17), 13/rsfk (§9, §16.3, §19, §24.4.1, §24.4.2, §24.5, §24.5.1, §24.6.2, §24.6.3, §24.6.4), 14/vh (§3), 14/lv (§14.5), 14/cn (§16, §16.3), 15/epv (§4), 16/is (§29), 17/rs (§6.2, §7.2), 19/tc (§8), 21/rl (§11.1, §11.2, §20), 21/rb (§24.1.3, §24.1.5), 21/rl2 (§14.1), 21/fao (§10), 21/sv (§3), 21/ac (§14), 22/prcd (§10, §10.5, §10.1.1.1), 22/pav (§9.2), 24/lv (§28, §29, §43), 24/ch (§3, §4, §7.1, §7.2, §7.3, §7.4, §7.5), 25/ci (§3.2.3.1.1, §3.2.3.6, §3.2.3.3.1.3), 25/ciac (§2, §2.1), 25/cii (§3.1, §3.4.2, §3.1.1.4.10, §3.1.1.4.11, §3.6.1), 25/cp (§3.3.1, §5.2.1), 26/uo (§21.1, §21.2), 26/lt (§4.1), 26/rt (§4.1.2, §4.1.4), 26/iti (§9), 26/ts (§10, §12), 27/is (§31.5, §31.9).
The function Emit::val_nothing is used in 4/am (§43), 6/rlt (§29.1, §29.2, §29.3), 12/cdp (§2.1.6.1.11, §2.1.6.1.18).
@@ -1515,11 +1545,11 @@ insert them into the Inter stream close to the top.
The function Emit::ref appears nowhere else.
-The function Emit::val_iname is used in §3, 4/am (§30, §43), 5/lp (§19, §19.3.1, §19.3.2, §19.2.1), 5/ins (§29), 5/nv (§12, §16), 6/bp (§25, §33), 6/rlt (§15, §15.2, §15.2.1, §15.2.5, §15.2.5.1, §15.2.6, §15.2.7, §15.2.8, §15.2.9, §15.2.12, §15.2.9.1, §15.2.10.1, §15.2.12.1, §17, §29.2, §29.3, §29.4, §29.5, §29.6), 6/nv (§17, §18.1, §18.2), 12/is (§8), 12/dtd (§9, §9.1, §13, §16, §18, §19, §22, §26), 12/cdp (§2.1.6.1.2.5, §2.1.6.1.8, §2.1.6.1.2.2.3, §2.1.6.1.2.2.5, §2.1.6.1.14, §2.1.6.1.2.2.6, §2.1.6.1.2.2.6.1), 13/kak (§2), 13/rsfk (§9, §12, §16.3, §25.3, §25.5, §25.5.1, §25.6.3, §25.6.6, §26), 14/lv (§14.3, §14.4, §14.5), 15/epv (§4), 17/ts (§8, §11.1), 17/rs (§5, §6.1, §6.2, §7.2), 19/tc (§8), 19/rsft (§2), 20/eq (§48), 21/rl (§20, §20.1, §20.2), 21/rb (§24.1.1, §24.1.2, §24.1.3, §24.1.3.1), 21/rl2 (§14.1), 21/fao (§10), 21/sv (§3.1, §3.2), 21/ac (§14), 22/prcd (§10, §10.3, §10.4, §10.1.1.1), 24/lv (§28, §29), 24/ch (§3, §7.1, §7.2, §7.3), 25/ci (§3, §3.2.3), 25/cii (§3.2.3, §3.2.4, §3.2.5, §3.2.6, §3.4.3, §3.1.1.4.7.1, §3.1.1.4.10, §3.5.8.3, §3.6.2, §3.6.3), 26/lt (§4.1), 26/iti (§9), 26/ts (§10, §11), 27/is (§31.8.1).
+The function Emit::val_iname is used in §3, 4/am (§30, §43), 5/lp (§19, §19.3.1, §19.3.2, §19.2.1), 5/ins (§29), 5/nv (§12, §16), 6/bp (§25, §33), 6/rlt (§15, §15.2, §15.2.1, §15.2.5, §15.2.5.1, §15.2.6, §15.2.7, §15.2.8, §15.2.9, §15.2.12, §15.2.9.1, §15.2.10.1, §15.2.12.1, §17, §29.2, §29.3, §29.4, §29.5, §29.6), 6/nv (§17, §18.1, §18.2), 12/is (§8), 12/dtd (§9, §9.1, §13, §16, §18, §19, §22, §26), 12/cdp (§2.1.6.1.2.5, §2.1.6.1.8, §2.1.6.1.2.2.3, §2.1.6.1.2.2.5, §2.1.6.1.14, §2.1.6.1.2.2.6, §2.1.6.1.2.2.6.1), 13/kak (§2), 13/rsfk (§9, §12, §16.3, §24.3, §24.5, §24.5.1, §24.6.3, §24.6.6, §25), 14/lv (§14.3, §14.4, §14.5), 15/epv (§4), 17/ts (§8, §11.1), 17/rs (§5, §6.1, §6.2, §7.2), 19/tc (§8), 19/rsft (§2), 20/eq (§48), 21/rl (§20, §20.1, §20.2), 21/rb (§24.1.1, §24.1.2, §24.1.3, §24.1.3.1), 21/rl2 (§14.1), 21/fao (§10), 21/sv (§3.1, §3.2), 21/ac (§14), 22/prcd (§10, §10.3, §10.4, §10.1.1.1), 24/lv (§28, §29), 24/ch (§3, §7.1, §7.2, §7.3), 25/ci (§3, §3.2.3), 25/cii (§3.2.3, §3.2.4, §3.2.5, §3.2.6, §3.4.3, §3.1.1.4.7.1, §3.1.1.4.10, §3.5.8.3, §3.6.2, §3.6.3), 26/lt (§4.1), 26/iti (§9), 26/ts (§10, §11), 27/is (§31.8.1).
-The function Emit::val_symbol is used in 4/am (§43), 5/lp (§19, §19.1, §19.2, §19.3, §19.3.1, §19.3.1.1, §19.3.2, §19.2.1, §19.2.2, §27, §27.2, §27.3.3, §27.3.4), 5/ins (§29), 6/bp (§25), 6/rlt (§15.2, §15.2.1, §15.2.4, §15.2.5, §15.2.5.1, §15.2.6, §15.2.7, §15.2.8, §15.2.9, §15.2.10, §15.2.11, §15.2.12, §15.2.9.1, §15.2.10.1, §15.2.12.1, §17, §29.1, §29.2, §29.3, §29.4, §29.5, §29.6), 6/nv (§18.1, §18.2, §18.1.2.1, §18.1.2.2, §19), 8/ef (§19), 11/tr (§10), 12/dtd (§23, §25, §26, §27), 12/cad (§7), 12/cdp (§2.1.6, §2.1.6.1.7, §2.1.6.1.8, §2.1.6.1.2.2.3, §2.1.6.1.9, §2.1.6.1.2.2.4, §2.1.6.1.11, §2.1.6.1.2.2.5, §2.1.6.1.13, §2.1.6.1.2.2.6, §2.1.6.1.2.2.6.1, §2.1.6.1.15, §2.1.6.1.17, §2.1.6.1.2.2.7), 13/kak (§2), 13/rsfk (§16.3, §25.1, §25.2, §25.3, §25.4.1, §25.4.2, §25.5, §25.5.1, §25.6.1, §25.6.2, §25.6.3, §25.6.4, §25.6.5, §25.6.6, §26), 14/lv (§14.1, §14.5), 14/cn (§16.3), 15/epv (§4), 17/rs (§6.2, §7.2), 19/tc (§8), 19/rsft (§2), 20/eq (§48), 21/rl (§20, §20.1, §20.2), 21/rb (§24.1.3, §24.1.3.1), 21/rl2 (§14.1), 21/fao (§10), 21/sv (§3, §3.1, §3.2), 24/lv (§28, §41, §45), 24/ch (§7, §7.1, §7.2, §7.3, §7.4, §7.5), 25/cii (§3.5.1, §3.5.3, §3.6.2), 26/uo (§21.1, §21.2), 26/rt (§4.1.3, §4.1.5), 27/is (§31.9).
+The function Emit::val_symbol is used in 4/am (§43), 5/lp (§19, §19.1, §19.2, §19.3, §19.3.1, §19.3.1.1, §19.3.2, §19.2.1, §19.2.2, §27, §27.2, §27.3.3, §27.3.4), 5/ins (§29), 6/bp (§25), 6/rlt (§15.2, §15.2.1, §15.2.4, §15.2.5, §15.2.5.1, §15.2.6, §15.2.7, §15.2.8, §15.2.9, §15.2.10, §15.2.11, §15.2.12, §15.2.9.1, §15.2.10.1, §15.2.12.1, §17, §29.1, §29.2, §29.3, §29.4, §29.5, §29.6), 6/nv (§18.1, §18.2, §18.1.2.1, §18.1.2.2, §19), 8/ef (§19), 11/tr (§10), 12/dtd (§23, §25, §26, §27), 12/cad (§7), 12/cdp (§2.1.6, §2.1.6.1.7, §2.1.6.1.8, §2.1.6.1.2.2.3, §2.1.6.1.9, §2.1.6.1.2.2.4, §2.1.6.1.11, §2.1.6.1.2.2.5, §2.1.6.1.13, §2.1.6.1.2.2.6, §2.1.6.1.2.2.6.1, §2.1.6.1.15, §2.1.6.1.17, §2.1.6.1.2.2.7), 13/kak (§2), 13/rsfk (§16.3, §24.1, §24.2, §24.3, §24.4.1, §24.4.2, §24.5, §24.5.1, §24.6.1, §24.6.2, §24.6.3, §24.6.4, §24.6.5, §24.6.6, §25), 14/lv (§14.1, §14.5), 14/cn (§16.3), 15/epv (§4), 17/rs (§6.2, §7.2), 19/tc (§8), 19/rsft (§2), 20/eq (§48), 21/rl (§20, §20.1, §20.2), 21/rb (§24.1.3, §24.1.3.1), 21/rl2 (§14.1), 21/fao (§10), 21/sv (§3, §3.1, §3.2), 24/lv (§28, §41, §45), 24/ch (§7, §7.1, §7.2, §7.3, §7.4, §7.5), 25/cii (§3.5.1, §3.5.3, §3.6.2), 26/uo (§21.1, §21.2), 26/rt (§4.1.3, §4.1.5), 27/is (§31.9).
-The function Emit::val_text is used in 4/am (§43), 5/lp (§19, §27.3, §27.3.1, §27.3.2, §27.3.3), 6/rlt (§15), 6/nv (§18.2, §19), 8/ef (§19), 13/rsfk (§25.3, §26), 17/tl (§14.2), 17/ts (§11.1), 17/rs (§7.2), 19/rsft (§2), 21/rl (§20.1, §20.2), 21/fao (§10), 24/ch (§7.4), 25/ci (§4.2), 25/cii (§3.5.8.1), 26/uo (§21.2), 26/ts (§10, §11, §12), 27/is (§31.9).
+The function Emit::val_text is used in 4/am (§43), 5/lp (§19, §27.3, §27.3.1, §27.3.2, §27.3.3), 6/rlt (§15), 6/nv (§18.2, §19), 8/ef (§19), 13/rsfk (§24.3, §25), 17/tl (§14.2), 17/ts (§11.1), 17/rs (§7.2), 19/rsft (§2), 21/rl (§20.1, §20.2), 21/fao (§10), 24/ch (§7.4), 25/ci (§4.2), 25/cii (§3.5.8.1), 26/uo (§21.2), 26/ts (§10, §11, §12), 27/is (§31.9).
The function Emit::val_char is used in 27/is (§31.9).
@@ -1531,9 +1561,9 @@ insert them into the Inter stream close to the top.
The function Emit::ref_iname is used in §3, 4/am (§43), 5/lp (§19, §19.1, §19.3.1, §19.3.2, §19.2.2), 6/nv (§17), 12/dtd (§19, §22), 14/lv (§14.3.2), 17/rs (§6.2), 21/rb (§24.1.3), 22/prcd (§10.3), 25/ci (§3, §3.2.3.1.1, §3.2.3.3.1.3), 25/cii (§3.1.1.4.10, §3.5.8.2, §3.5.8.3), 25/cp (§5.2.1), 26/lt (§4.1).
-The function Emit::ref_symbol is used in 4/am (§43), 5/lp (§19, §19.2, §19.3, §19.3.1, §19.3.1.1, §19.3.2, §19.2.1, §19.2.2, §27.3.3), 6/nv (§18.2), 12/dtd (§9, §23, §27), 12/cdp (§2.1.6, §2.1.6.1.2.2, §2.1.6.1.2.3.7, §2.1.6.1.2.4, §2.1.6.1.2.2.2, §2.1.6.1.8, §2.1.6.1.2.2.3, §2.1.6.1.10, §2.1.6.1.2.2.4, §2.1.6.1.11, §2.1.6.1.2.2.5, §2.1.6.1.14, §2.1.6.1.2.2.6, §2.1.6.1.17), 13/rsfk (§25.6.1, §25.6.2, §25.6.3, §25.6.4, §25.6.5, §25.6.6), 17/rs (§6.2), 21/rb (§24.1.1, §24.1.3), 21/sv (§3.1, §3.2), 24/lv (§29, §43), 24/ch (§7.1, §7.2, §7.4, §7.4.1), 25/cii (§1.2.1, §3.5.1, §3.5.3), 25/cp (§5.3.5), 26/rt (§4.1.3).
+The function Emit::ref_symbol is used in 4/am (§43), 5/lp (§19, §19.2, §19.3, §19.3.1, §19.3.1.1, §19.3.2, §19.2.1, §19.2.2, §27.3.3), 6/nv (§18.2), 12/dtd (§9, §23, §27), 12/cdp (§2.1.6, §2.1.6.1.2.2, §2.1.6.1.2.3.7, §2.1.6.1.2.4, §2.1.6.1.2.2.2, §2.1.6.1.8, §2.1.6.1.2.2.3, §2.1.6.1.10, §2.1.6.1.2.2.4, §2.1.6.1.11, §2.1.6.1.2.2.5, §2.1.6.1.14, §2.1.6.1.2.2.6, §2.1.6.1.17), 13/rsfk (§24.6.1, §24.6.2, §24.6.3, §24.6.4, §24.6.5, §24.6.6), 17/rs (§6.2), 21/rb (§24.1.1, §24.1.3), 21/sv (§3.1, §3.2), 24/lv (§29, §43), 24/ch (§7.1, §7.2, §7.4, §7.4.1), 25/cii (§1.2.1, §3.5.1, §3.5.3), 25/cp (§5.3.5), 26/rt (§4.1.3).
-The function Emit::cast is used in 13/rsfk (§25.4.1, §25.4.2).
+The function Emit::cast is used in 13/rsfk (§24.4.1, §24.4.2).
The function Emit::end_block is used in 26/rt (§4, §4.1).
@@ -1659,17 +1689,54 @@ insert them into the Inter stream close to the top.
*val1 = LITERAL_IVAL; *val2 = 0;
}
+ void Emit::to_ival_in_context(inter_name *context, inter_t *val1, inter_t *val2, inter_name *iname) {
+ package_request *PR = InterNames::location(context);
+ inter_package *pack = Packaging::incarnate(PR);
+ inter_symbol *S = InterNames::to_symbol(iname);
+ if (S) { Inter::Symbols::to_data(pack->stored_in, pack, S, val1, val2); return; }
+ *val1 = LITERAL_IVAL; *val2 = 0;
+ }
+
int Emit::defined(inter_name *iname) {
if (iname == NULL) return FALSE;
inter_symbol *S = InterNames::to_symbol(iname);
if (Inter::Symbols::is_defined(S)) return TRUE;
return FALSE;
}
+
+ typedef struct ival_emission {
+ value_holster emission_VH;
+ packaging_state saved_PS;
+ } ival_emission;
+
+ ival_emission Emit::begin_ival_emission(inter_name *iname) {
+ ival_emission IE;
+ IE.emission_VH = Holsters::new(INTER_DATA_VHMODE);
+ IE.saved_PS = Packaging::enter_home_of(iname);
+ return IE;
+ }
+
+ value_holster *Emit::ival_holster(ival_emission *IE) {
+ return &(IE->emission_VH);
+ }
+
+ void Emit::end_ival_emission(ival_emission *IE, inter_t *v1, inter_t *v2) {
+ Holsters::unholster_pair(&(IE->emission_VH), v1, v2);
+ Packaging::exit(IE->saved_PS);
+ }
+
+ package_request *Emit::current_enclosure(void) {
+ return Packaging::current_enclosure();
+ }
+
+ packaging_state Emit::unused_packaging_state(void) {
+ return Packaging::stateless();
+ }
-The function Emit::change_translation is used in 5/un (§1), 13/rsfk (§25), 15/pr (§21), 27/hl (§1, §1.1), 27/pc (§6).
+The function Emit::change_translation is used in 5/un (§1), 13/rsfk (§24), 15/pr (§21), 27/hl (§1, §1.1), 27/pc (§6).
The function Emit::get_translation is used in 15/pr (§22.1).
@@ -1683,7 +1750,7 @@ insert them into the Inter stream close to the top.
The function Emit::clear_flag is used in 5/un (§1).
-The function Emit::annotate_i is used in 13/rsfk (§25), 15/pr (§27), 15/epv (§1, §1.1.1), 17/tl (§7).
+The function Emit::annotate_i is used in 13/rsfk (§24), 15/pr (§27), 15/epv (§1, §1.1.1), 17/tl (§7).
The function Emit::annotate_t appears nowhere else.
@@ -1693,9 +1760,23 @@ insert them into the Inter stream close to the top.
The function Emit::holster is used in 13/rsfk (§4), 14/rv (§24.2, §24.3, §24.3.1), 17/tl (§10, §10.2.1, §16), 17/ts (§8, §8.1), 17/rs (§12).
-The function Emit::to_ival is used in 13/rsfk (§5), 17/tl (§13).
+The function Emit::to_ival is used in 13/rsfk (§5).
-The function Emit::defined is used in 13/rsfk (§25).
+The function Emit::to_ival_in_context is used in 17/tl (§13).
+
+The function Emit::defined is used in 13/rsfk (§24).
+
+The function Emit::begin_ival_emission is used in 5/nv (§25).
+
+The function Emit::ival_holster is used in 5/nv (§25).
+
+The function Emit::end_ival_emission is used in 5/nv (§25).
+
+The function Emit::current_enclosure is used in 17/ts (§8, §8.1), 18/lc (§5), 26/iti (§9).
+
+The function Emit::unused_packaging_state is used in 21/rb (§24.1), 26/rt (§3).
+
+The structure ival_emission is private to this section.
diff --git a/docs/core-module/27-hr.html b/docs/core-module/27-hr.html
index dd7a3a1ab..ab9b8be0d 100644
--- a/docs/core-module/27-hr.html
+++ b/docs/core-module/27-hr.html
@@ -1966,13 +1966,13 @@
-The function Hierarchy::find is used in 4/am (§43), 5/lp (§19, §19.1, §19.3.1, §19.3.1.1, §19.3.2, §19.2.1, §19.2.2), 5/nv (§12, §16, §20), 6/bp (§33, §42), 6/rlt (§14, §15, §15.1.2, §15.2, §15.2.1, §15.2.5.1, §15.2.6, §15.2.9, §15.2.10, §15.2.11, §15.2.12, §15.2.9.1, §15.2.10.1, §15.2.12.1, §16, §17, §29.1, §29.5, §29.6), 6/nv (§17, §18, §18.1, §18.2), 8/ef (§19), 12/is (§8), 12/dtd (§9, §9.1, §17, §19, §22, §27), 12/cdp (§2.1.6.1.2.5, §2.1.6.1.8, §2.1.6.1.2.2.3, §2.1.6.1.9, §2.1.6.1.2.2.5, §2.1.6.1.14, §2.1.6.1.2.2.6, §2.1.6.1.2.2.6.1), 13/kak (§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 (§4, §16.3, §18.1, §19, §25, §25.5, §25.5.1, §25.6.1, §25.6.2, §25.6.3, §25.6.4, §25.6.5, §25.6.6, §26), 14/rv (§24.3), 14/lv (§14.3, §14.3.2, §14.4, §14.5), 14/cfs (§7), 17/tl (§10, §14.1, §16), 17/ts (§8, §8.1, §11, §11.1), 17/rs (§6.1, §6.2, §7.3, §7.3.1.1), 19/tc (§8), 19/rsft (§1.1.1.1.1.5, §1.2, §1.3, §2), 20/eq (§48), 21/rl (§20, §20.1), 21/rb (§23, §24, §24.1.1, §24.1.2, §24.1.3, §24.1.3.1), 21/rl2 (§14, §14.1, §20), 21/fao (§10), 21/sv (§3, §3.1, §3.2), 21/ac (§8, §14), 22/cs (§8), 22/prcd (§10, §10.3, §10.4, §10.1.1.1), 22/pav (§9.2), 22/tp2 (§4), 24/lv (§28, §29, §41), 24/ch (§3, §4, §6, §7, §7.1, §7.2, §7.3, §8), 25/ci (§3, §3.2.3, §3.2.3.6, §3.2.3.3.1.3), 25/cii (§3.2.6, §3.1.1.4.7.1, §3.1.1.4.9, §3.1.1.4.10, §3.5.3, §3.5.8.2, §3.5.8.3, §3.6.2), 25/cp (§5.2.1, §6), 26/vm (§8), 26/uo (§21, §21.1), 26/lt (§4.1), 26/rt (§4.1.2, §4.1.3, §4.1.4), 26/iti (§10), 26/pl (§8), 26/ts (§10, §11, §12), 27/ei (§2, §3).
+The function Hierarchy::find is used in 4/am (§43), 5/lp (§19, §19.1, §19.3.1, §19.3.1.1, §19.3.2, §19.2.1, §19.2.2), 5/nv (§12, §16, §20), 6/bp (§33, §42), 6/rlt (§14, §15, §15.1.2, §15.2, §15.2.1, §15.2.5.1, §15.2.6, §15.2.9, §15.2.10, §15.2.11, §15.2.12, §15.2.9.1, §15.2.10.1, §15.2.12.1, §16, §17, §29.1, §29.5, §29.6), 6/nv (§17, §18, §18.1, §18.2), 8/ef (§19), 12/is (§8), 12/dtd (§9, §9.1, §17, §19, §22, §27), 12/cdp (§2.1.6.1.2.5, §2.1.6.1.8, §2.1.6.1.2.2.3, §2.1.6.1.9, §2.1.6.1.2.2.5, §2.1.6.1.14, §2.1.6.1.2.2.6, §2.1.6.1.2.2.6.1), 13/kak (§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 (§4, §16.3, §18.1, §19, §24, §24.5, §24.5.1, §24.6.1, §24.6.2, §24.6.3, §24.6.4, §24.6.5, §24.6.6, §25), 14/rv (§24.3), 14/lv (§14.3, §14.3.2, §14.4, §14.5), 14/cfs (§7), 17/tl (§10, §14.1, §16), 17/ts (§8, §8.1, §11, §11.1), 17/rs (§6.1, §6.2, §7.3, §7.3.1.1), 19/tc (§8), 19/rsft (§1.1.1.1.1.5, §1.2, §1.3, §2), 20/eq (§48), 21/rl (§20, §20.1), 21/rb (§23, §24, §24.1.1, §24.1.2, §24.1.3, §24.1.3.1), 21/rl2 (§14, §14.1, §20), 21/fao (§10), 21/sv (§3, §3.1, §3.2), 21/ac (§8, §14), 22/cs (§8), 22/prcd (§10, §10.3, §10.4, §10.1.1.1), 22/pav (§9.2), 22/tp2 (§4), 24/lv (§28, §29, §41), 24/ch (§3, §4, §6, §7, §7.1, §7.2, §7.3, §8), 25/ci (§3, §3.2.3, §3.2.3.6, §3.2.3.3.1.3), 25/cii (§3.2.6, §3.1.1.4.7.1, §3.1.1.4.9, §3.1.1.4.10, §3.5.3, §3.5.8.2, §3.5.8.3, §3.6.2), 25/cp (§5.2.1, §6), 26/vm (§8), 26/uo (§21, §21.1), 26/lt (§4.1), 26/rt (§4.1.2, §4.1.3, §4.1.4), 26/iti (§10), 26/pl (§8), 26/ts (§10, §11, §12), 27/ei (§2, §3).
The function Hierarchy::make_available appears nowhere else.
The function Hierarchy::find_by_name is used in 5/nv (§10), 13/rsfk (§7), 21/rl (§9), 22/tp (§8), 27/is (§32).
-The function Hierarchy::main is used in 26/rt (§3), 27/ei (§2).
+The function Hierarchy::main is used in 27/pc (§4), 27/ei (§2, §3).
The function Hierarchy::resources is used in 27/pc (§5), 27/ei (§2).
@@ -1990,7 +1990,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), 12/cdp (§5), 13/rsfk (§4, §13.1.1, §15), 15/ma (§11.3), 16/ic (§10), 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_with_specific_name is used in 13/rsfk (§25).
+The function Hierarchy::make_iname_with_specific_name is used in 13/rsfk (§24).
The function Hierarchy::derive_iname_in is used in 16/ic (§10), 21/rl (§9).
@@ -1998,11 +1998,11 @@
The function Hierarchy::make_block_iname is used in 27/ei (§3).
-The function Hierarchy::make_kernel_iname is used in 26/rt (§4).
+The function Hierarchy::make_kernel_iname is used in 27/ei (§3).
The function Hierarchy::make_iname_with_memo is used in 5/un (§1), 5/nv (§16), 13/rsfk (§13.1.1), 15/pr (§27), 15/ep (§4), 15/vp (§3), 21/fao (§10), 21/ac (§6).
-The function Hierarchy::make_iname_with_memo_and_value is used in 13/rsfk (§24).
+The function Hierarchy::make_iname_with_memo_and_value is used in 13/rsfk (§23).
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 b3879c99a..d0c7e20d5 100644
--- a/docs/core-module/27-in.html
+++ b/docs/core-module/27-in.html
@@ -215,7 +215,9 @@ a memo to attach):
inter_name *InterNames::explicitly_named_in_template(text_stream *name) {
inter_name *iname = InterNames::explicitly_named(name, Hierarchy::template());
+ packaging_state save = Packaging::enter_home_of(iname);
iname->symbol = Emit::extern(name, K_value);
+ Packaging::exit(save);
return iname;
}
@@ -275,7 +277,7 @@ a memo to attach):
-The function InterNames::location is used in 27/pc (§2, §3, §4, §6).
+The function InterNames::location is used in 27/pc (§2, §3, §4, §6), 27/ei (§5).
§8. Conversion of inames to symbols. The purpose of inames is not quite to represent identifier names occurring in
given packages inside the Inter hierarchy: it would be more accurate to say
@@ -306,7 +308,7 @@ automatically here:
-The function InterNames::to_symbol is used in 13/rsfk (§5), 15/epv (§4), 21/rl (§9, §11.2, §22), 26/iti (§9), 27/is (§32), 27/ei (§2, §3, §4, §5).
+The function InterNames::to_symbol is used in 13/rsfk (§5), 15/epv (§4), 21/rl (§11.2, §22), 26/iti (§9), 27/is (§32), 27/ei (§2, §3, §4, §5).
diff --git a/docs/core-module/27-pc.html b/docs/core-module/27-pc.html
index 6375889e2..caac0e6c6 100644
--- a/docs/core-module/27-pc.html
+++ b/docs/core-module/27-pc.html
@@ -102,10 +102,6 @@
return Packaging::enter(Packaging::home_of(N));
}
- packaging_state Packaging::enter_current_enclosure(void) {
- return Packaging::enter(current_enclosure);
- }
-
package_request *Packaging::current_enclosure(void) {
return current_enclosure;
}
@@ -113,15 +109,13 @@
-The function Packaging::stateless is used in 21/rb (§24.1).
+The function Packaging::stateless is used in 27/ei (§5).
-The function Packaging::home_of is used in 5/ins (§34), 12/cdp (§5), 13/rsfk (§22), 26/rt (§3, §4), 27/hr (§3), 27/hl (§1), 27/ei (§3).
+The function Packaging::home_of is used in 27/hr (§3), 27/hl (§1), 27/ei (§3).
-The function Packaging::enter_home_of is used in 5/nv (§16, §25), 13/rsfk (§16.2), 17/tl (§13), 21/rl2 (§20), 22/ph (§12), 26/rt (§1), 27/ei (§2, §3).
+The function Packaging::enter_home_of is used in 27/in (§5), 27/ei (§2, §3, §5).
-The function Packaging::enter_current_enclosure appears nowhere else.
-
-The function Packaging::current_enclosure is used in 17/ts (§8, §8.1), 18/lc (§5), 26/iti (§9), 27/hr (§5).
+The function Packaging::current_enclosure is used in 27/hr (§5), 27/ei (§5).
The structure packaging_state is private to this section.
@@ -137,6 +131,7 @@
inter_reading_state packaging_entry_stack[MAX_PACKAGING_ENTRY_DEPTH];
packaging_state Packaging::enter(package_request *R) {
+ if (R == NULL) R = Hierarchy::main();
LOGIF(PACKAGING, "Entering $X\n", R);
inter_reading_state *IRS = Emit::IRS();
@@ -201,11 +196,11 @@
-The function Packaging::enter is used in §3, 27/ei (§2, §3).
+The function Packaging::enter is used in §3, 27/ei (§3).
-The function Packaging::exit is used in 5/nv (§16, §25), 13/rsfk (§16.2), 17/tl (§13), 21/rl2 (§20), 22/ph (§12), 26/rt (§4), 27/ei (§2, §3).
+The function Packaging::exit is used in 27/in (§5), 27/ei (§2, §3, §5).
-The function Packaging::incarnate is used in 21/rl (§9), 27/ei (§2).
+The function Packaging::incarnate is used in 27/ei (§2, §3, §5).
The function Packaging::scope is used in 27/in (§8).
@@ -448,7 +443,7 @@
The function Packaging::datum_text is used in 27/hl (§1).
-The function Packaging::housed_in_function is used in 26/rt (§4), 27/ei (§3).
+The function Packaging::housed_in_function is used in 27/ei (§3).
diff --git a/docs/core-module/5-ins.html b/docs/core-module/5-ins.html
index 229b6c096..d0c9c37fe 100644
--- a/docs/core-module/5-ins.html
+++ b/docs/core-module/5-ins.html
@@ -47,6 +47,8 @@ evidence turns up to suggest otherwise).
typedef struct instance {
struct noun *tag;
+ struct package_request *instance_package;
+ struct inter_name *instance_iname;
int instance_emitted;
struct parse_node *creating_sentence; sentence creating the instance
struct parse_node *instance_of_set_at; and identifying its kind
@@ -172,6 +174,8 @@ later on.)
+ I->instance_package = NULL;
+ I->instance_iname = NULL;
I->instance_emitted = FALSE;
I->creating_sentence = current_sentence;
I->instance_of_set_at = current_sentence;
@@ -450,9 +454,12 @@ turns up subsequently, e.g., in response to
inter_name *Instances::iname(instance *I) {
if (I == NULL) return NULL;
- package_request *R = Hierarchy::local_package(INSTANCES_HAP);
- UseNouns::noun_compose_identifier(R, I->tag, I->allocation_id);
- return UseNouns::iname(I->tag);
+ if (I->instance_iname == NULL) {
+ I->instance_package = Hierarchy::local_package(INSTANCES_HAP);
+ UseNouns::noun_compose_identifier(I->instance_package, I->tag, I->allocation_id);
+ I->instance_iname = UseNouns::iname(I->tag);
+ }
+ return I->instance_iname;
}
@@ -460,7 +467,7 @@ turns up subsequently, e.g., in response to
The function Instances::get_name is used in §15.1, §15.2, §27, §37, §38.2, 2/sq (§2), 5/ipw (§2.2.1), 8/ed2 (§3.2.1.7.2, §3.2.1.7.4), 9/rpt (§9.5.1), 9/tc (§5.4.1), 14/rv (§3).
-The function Instances::get_name_in_play is used in §25, 13/rsfk (§25.3).
+The function Instances::get_name_in_play is used in §25, 13/rsfk (§24.3).
The function Instances::full_name_includes appears nowhere else.
@@ -468,7 +475,7 @@ turns up subsequently, e.g., in response to
The function Instances::identifier appears nowhere else.
-The function Instances::iname is used in §6, §15, §29, §34, 13/rsfk (§4, §25.3), 26/iti (§9), 26/ts (§10).
+The function Instances::iname is used in §6, §15, §29, §34, 13/rsfk (§4, §24.3), 26/iti (§9), 26/ts (§10).
@@ -750,7 +757,7 @@ are allowed to refine it. Such revisions are allowed to specialise the kind
-The function Instances::count is used in §37, 5/ipw (§3.3), 13/rsfk (§25), 13/ki (§4), 19/tb (§26.3).
+The function Instances::count is used in §37, 5/ipw (§3.3), 13/rsfk (§24), 13/ki (§4), 19/tb (§26.3).
§23. Connections. Some of Inform's plugins give special meanings to particular kinds, in such
a way that they need to be given additional structure. For example, the
@@ -1067,8 +1074,8 @@ declarations) and finally return TRU
}
package_request *Instances::package(instance *I) {
- inter_name *iname = Instances::iname(I);
- return Packaging::home_of(iname);
+ Instances::iname(I); Thus forcing this to exist...
+ return I->instance_package;
}
diff --git a/docs/core-module/5-lp.html b/docs/core-module/5-lp.html
index 016e01a9e..5860274d7 100644
--- a/docs/core-module/5-lp.html
+++ b/docs/core-module/5-lp.html
@@ -2530,7 +2530,7 @@ note that the following uses the raw text of the word.
-The function LiteralPatterns::printing_routine is used in 13/rsfk (§25.2).
+The function LiteralPatterns::printing_routine is used in 13/rsfk (§24.2).
§27.1. This was at one time a more complicated criterion, which masked bugs in
the sorting measure.
@@ -4188,7 +4188,7 @@ set.
- The function LiteralPatterns::list_of_literal_forms is used in §2, §34, 13/rsfk (§25.2), 13/ki (§1.8, §5.1.1).
+ The function LiteralPatterns::list_of_literal_forms is used in §2, §34, 13/rsfk (§24.2), 13/ki (§1.8, §5.1.1).
- (This section begins Chapter 5: Nouns.)
- Continue with 'Times of Day'
diff --git a/docs/core-module/5-nv.html b/docs/core-module/5-nv.html
index 81ebea446..3ecafe300 100644
--- a/docs/core-module/5-nv.html
+++ b/docs/core-module/5-nv.html
@@ -594,17 +594,15 @@ there's very little to say.
if ((nlv->constant_at_run_time == FALSE) ||
(nlv->housed_in_variables_array)) {
- inter_name *iname = NonlocalVariables::iname(nlv);
- packaging_state save = Packaging::enter_home_of(iname);
-
- value_holster VH = Holsters::new(INTER_DATA_VHMODE);
-
BEGIN_COMPILATION_MODE;
COMPILATION_MODE_EXIT(DEREFERENCE_POINTERS_CMODE);
- NonlocalVariables::compile_initial_value_vh(&VH, nlv);
- END_COMPILATION_MODE;
+
+ inter_name *iname = NonlocalVariables::iname(nlv);
inter_t v1 = 0, v2 = 0;
- Holsters::unholster_pair(&VH, &v1, &v2);
+
+ NonlocalVariables::seek_initial_value(iname, &v1, &v2, nlv);
+
+ END_COMPILATION_MODE;
text_stream *rvalue = NULL;
if (nlv->housed_in_variables_array == FALSE)
@@ -619,7 +617,6 @@ there's very little to say.
Routines::end(save);
}
- Packaging::exit(save);
}
return TRUE;
}
@@ -992,11 +989,9 @@ which makes its kind safe. Hence the error messages.
}
void NonlocalVariables::seek_initial_value(inter_name *iname, inter_t *v1, inter_t *v2, nonlocal_variable *nlv) {
- packaging_state save = Packaging::enter_home_of(iname);
- value_holster VH = Holsters::new(INTER_DATA_VHMODE);
- NonlocalVariables::compile_initial_value_vh(&VH, nlv);
- Holsters::unholster_pair(&VH, v1, v2);
- Packaging::exit(save);
+ ival_emission IE = Emit::begin_ival_emission(iname);
+ NonlocalVariables::compile_initial_value_vh(Emit::ival_holster(&IE), nlv);
+ Emit::end_ival_emission(&IE, v1, v2);
}
void NonlocalVariables::compile_initial_value_vh(value_holster *VH, nonlocal_variable *nlv) {
@@ -1022,9 +1017,9 @@ which makes its kind safe. Hence the error messages.
The function NonlocalVariables::emit_initial_value_as_val is used in 21/sv (§3.1).
-The function NonlocalVariables::seek_initial_value appears nowhere else.
+The function NonlocalVariables::seek_initial_value is used in §16.
-The function NonlocalVariables::compile_initial_value_vh is used in §16.
+The function NonlocalVariables::compile_initial_value_vh appears nowhere else.
§25.1.
<Initialise with the default value of its kind 25.1> =
diff --git a/docs/core-module/5-un.html b/docs/core-module/5-un.html
index c2a53e470..3787850a0 100644
--- a/docs/core-module/5-un.html
+++ b/docs/core-module/5-un.html
@@ -65,13 +65,13 @@ it's convenient to associate them with nametags.
The function UseNouns::identifier is used in 5/ins (§14), 5/ipw (§3.1, §3.5).
-The function UseNouns::iname is used in 5/ins (§14), 13/rsfk (§24).
+The function UseNouns::iname is used in 5/ins (§14), 13/rsfk (§23).
-The function UseNouns::iname_set is used in 13/rsfk (§24).
+The function UseNouns::iname_set is used in 13/rsfk (§23).
The function UseNouns::noun_compose_identifier is used in 5/ins (§14).
-The function UseNouns::noun_impose_identifier is used in 13/rsfk (§24).
+The function UseNouns::noun_impose_identifier is used in 13/rsfk (§23).
The function UseNouns::noun_set_I6_representation is used in §2.1.
diff --git a/docs/core-module/index.html b/docs/core-module/index.html
index dfae1c2e3..26cd8a810 100644
--- a/docs/core-module/index.html
+++ b/docs/core-module/index.html
@@ -771,7 +771,7 @@
-
- To compile the bones of routines, and their local variable declarations.
+ To compile the bones of functions, and their local variable declarations.
Translate to Identifiers -
diff --git a/docs/core-test/1-pc.html b/docs/core-test/1-pc.html
index aa2cfdf78..6d4c9ab99 100644
--- a/docs/core-test/1-pc.html
+++ b/docs/core-test/1-pc.html
@@ -36,7 +36,7 @@ but on others it's compiled into the body of an application. So:
-The function main is used in 2/pt (§52), 2/pl2 (§3.1), 2/pck (§2), 3/rst (§6), 4/am (§26.1), 8/ef (§26), 8/ed2 (§3.2), 10/varc (§14), 19/tb (§27, §27.1, §27.1.3, §29), 21/rl2 (§23), 26/uo (§11.1), 27/hr (§5), 2/lnk (§1), 2/res (§1), 3/cg (§1), 2/hf (§6).
+The function main is used in 2/pt (§52), 2/pl2 (§3.1), 2/pck (§2), 3/rst (§6), 4/am (§26.1), 8/ef (§26), 8/ed2 (§3.2), 10/varc (§14), 19/tb (§27, §27.1, §27.1.3, §29), 21/rl2 (§23), 26/uo (§11.1), 27/hr (§5), 27/ei (§2), 2/lnk (§1), 2/res (§1), 3/cg (§1), 2/hf (§6).
§3. As a matter of policy, no module is allowed to start or stop the foundation
module, not even the mighty core; so we take care of that with one more
diff --git a/docs/if-module/3-tnt.html b/docs/if-module/3-tnt.html
index 02105c009..a39f8efb0 100644
--- a/docs/if-module/3-tnt.html
+++ b/docs/if-module/3-tnt.html
@@ -408,7 +408,7 @@ actually means it's rarely needed.)
if (P_cap_short_name == NULL) {
inter_name *property_iname = Hierarchy::find(CAPSHORTNAME_HL);
P_cap_short_name = Properties::Valued::new_nameless_using(
- K_text, property_iname);
+ K_text, Kinds::Behaviour::package(K_object), property_iname);
inter_name *iname = Hierarchy::find(CAP_SHORT_NAME_EXISTS_HL);
Emit::named_numeric_constant(iname, 1);
}
diff --git a/docs/if-module/5-gpr.html b/docs/if-module/5-gpr.html
index 48aa9dc3c..5b04c1ea2 100644
--- a/docs/if-module/5-gpr.html
+++ b/docs/if-module/5-gpr.html
@@ -147,13 +147,12 @@ will simply compile a parse_nameparse_name_notice *notice;
LOOP_OVER(notice, parse_name_notice) {
gpr_kit gprk = PL::Parsing::Tokens::Values::new_kit();
- packaging_state save = Packaging::enter_home_of(notice->pnn_iname);
- if (PL::Parsing::Tokens::General::compile_parse_name_head(&gprk,
+ packaging_state save = Emit::unused_packaging_state();
+ if (PL::Parsing::Tokens::General::compile_parse_name_head(&save, &gprk,
notice->parse_subject, NULL, notice->pnn_iname)) {
PL::Parsing::Tokens::General::compile_parse_name_tail(&gprk);
- Routines::end_in_current_package();
+ Routines::end(save);
}
- Packaging::exit(save);
}
}
@@ -218,8 +217,10 @@ will be the correct decision.
- int PL::Parsing::Tokens::General::compile_parse_name_head(gpr_kit *gprk, inference_subject *subj,
+ int PL::Parsing::Tokens::General::compile_parse_name_head(packaging_state *save,
+ gpr_kit *gprk, inference_subject *subj,
grammar_verb *gv, inter_name *rname) {
+ STREAM_FLUSH(DL);
int test_distinguishability = FALSE, sometimes_has_visible_properties = FALSE;
inter_name *N = NULL;
@@ -236,9 +237,15 @@ will be the correct decision.
if (InferenceSubjects::domain(subj)) test_distinguishability = TRUE;
- if (rname) Routines::begin_in_current_package(rname);
- else if (N) Routines::begin_in_current_package(N);
- else internal_error("no parse name routine name given");
+ inter_name *compile_to = rname;
+ if (compile_to == NULL) compile_to = N;
+ if (compile_to == NULL) internal_error("no parse name routine name given");
+
+ LOG("\n\nAND %n\n", compile_to);
+ STREAM_FLUSH(DL);
+
+ *save = Routines::begin(compile_to);
+
PL::Parsing::Tokens::Values::add_parse_name_vars(gprk);
PL::Parsing::Tokens::General::top_of_head(gprk, N, subj,
diff --git a/docs/if-module/5-gv.html b/docs/if-module/5-gv.html
index 159e285a6..b42b65fe8 100644
--- a/docs/if-module/5-gv.html
+++ b/docs/if-module/5-gv.html
@@ -670,8 +670,7 @@ following routine finds or creates this for a given property.
gv = PL::Parsing::Verbs::gv_new(GV_IS_PROPERTY_NAME);
Properties::EitherOr::set_parsing_grammar(prn, gv);
gv->prn_understood = prn;
- inter_name *iname = Properties::iname(prn);
- gv->gv_prn_iname = Hierarchy::make_iname_in(EITHER_OR_GPR_FN_HL, Packaging::home_of(iname));
+ gv->gv_prn_iname = Hierarchy::make_iname_in(EITHER_OR_GPR_FN_HL, Properties::package(prn));
return gv;
}
@@ -1026,13 +1025,13 @@ next priority, and so on up the hierarchy.
}
case GV_IS_OBJECT: {
gpr_kit gprk = PL::Parsing::Tokens::Values::new_kit();
- packaging_state save = Packaging::enter_home_of(PL::Parsing::Tokens::General::get_gv_parse_name(gv));
- if (PL::Parsing::Tokens::General::compile_parse_name_head(&gprk, gv->subj_understood, gv, NULL)) {
+ packaging_state save = Emit::unused_packaging_state();
+ LOG("\n\nSo %n\n", PL::Parsing::Tokens::General::get_gv_parse_name(gv));
+ if (PL::Parsing::Tokens::General::compile_parse_name_head(&save, &gprk, gv->subj_understood, gv, NULL)) {
PL::Parsing::Verbs::gv_compile_parse_name_lines(&gprk, gv);
PL::Parsing::Tokens::General::compile_parse_name_tail(&gprk);
- Routines::end_in_current_package();
+ Routines::end(save);
}
- Packaging::exit(save);
break;
}
case GV_IS_VALUE:
diff --git a/docs/inform7/1-mn.html b/docs/inform7/1-mn.html
index 98b896fa6..efcf2b9a2 100644
--- a/docs/inform7/1-mn.html
+++ b/docs/inform7/1-mn.html
@@ -43,7 +43,7 @@ when they want I7 to run.
-The function main is used in 2/pt (§52), 2/pl2 (§3.1), 2/pck (§2), 3/rst (§6), 4/am (§26.1), 8/ef (§26), 8/ed2 (§3.2), 10/varc (§14), 19/tb (§27, §27.1, §27.1.3, §29), 21/rl2 (§23), 26/uo (§11.1), 27/hr (§5), 2/lnk (§1), 2/res (§1), 3/cg (§1), 3/sm (§36, §36.1, §38), 3/em2 (§24), 4/ap (§2), 2/hf (§6).
+The function main is used in 2/pt (§52), 2/pl2 (§3.1), 2/pck (§2), 3/rst (§6), 4/am (§26.1), 8/ef (§26), 8/ed2 (§3.2), 10/varc (§14), 19/tb (§27, §27.1, §27.1.3, §29), 21/rl2 (§23), 26/uo (§11.1), 27/hr (§5), 27/ei (§2), 2/lnk (§1), 2/res (§1), 3/cg (§1), 3/sm (§36, §36.1, §38), 3/em2 (§24), 4/ap (§2), 2/hf (§6).
§3. Either way, that brings us here. All our modules have to be started up and
shut down, so we take care of that with one more intermediary. These modules
diff --git a/docs/kinds-module/2-uk.html b/docs/kinds-module/2-uk.html
index 1b9965862..d7b6b3f06 100644
--- a/docs/kinds-module/2-uk.html
+++ b/docs/kinds-module/2-uk.html
@@ -760,21 +760,21 @@ in some human-readable format.
inter_name *Kinds::Behaviour::get_inc_iname(kind *K) {
if (K == NULL) internal_error("null kind has no inc routine");
if (K->construct->inc_iname) return K->construct->inc_iname;
- package_request *R = Kinds::RunTime::package(K);
+ package_request *R = Kinds::Behaviour::package(K);
K->construct->inc_iname = Hierarchy::make_iname_in(DECREMENT_FN_HL, R);
return K->construct->inc_iname;
}
inter_name *Kinds::Behaviour::get_dec_iname(kind *K) {
if (K == NULL) internal_error("null kind has no dec routine");
if (K->construct->dec_iname) return K->construct->dec_iname;
- package_request *R = Kinds::RunTime::package(K);
+ package_request *R = Kinds::Behaviour::package(K);
K->construct->dec_iname = Hierarchy::make_iname_in(INCREMENT_FN_HL, R);
return K->construct->dec_iname;
}
inter_name *Kinds::Behaviour::get_ranger_iname(kind *K) {
if (K == NULL) internal_error("null kind has no inc routine");
if (K->construct->ranger_iname) return K->construct->ranger_iname;
- package_request *R = Kinds::RunTime::package(K);
+ package_request *R = Kinds::Behaviour::package(K);
K->construct->ranger_iname = Hierarchy::make_iname_in(RANGER_FN_HL, R);
return K->construct->ranger_iname;
}
diff --git a/inform7/core-module/Chapter 12/Compile Deferred Propositions.w b/inform7/core-module/Chapter 12/Compile Deferred Propositions.w
index 707c5fd2c..96680b500 100644
--- a/inform7/core-module/Chapter 12/Compile Deferred Propositions.w
+++ b/inform7/core-module/Chapter 12/Compile Deferred Propositions.w
@@ -1592,8 +1592,7 @@ pcalc_prop *Calculus::Propositions::Deferred::compile_loop_header(int var, local
if ((K) && (parent_optimised == FALSE)) { /* parent optimisation is stronger, so we prefer that */
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 = Hierarchy::make_iname_in(RTP_HL, P);
+ pdef->rtp_iname = Hierarchy::make_iname_in(RTP_HL, pdef->ppd_package);
}
Calculus::Schemas::modify(&loop_schema, "if (RunTimeProblem(RTP_CANTITERATE, %n))",
pdef->rtp_iname);
diff --git a/inform7/core-module/Chapter 12/Deciding to Defer.w b/inform7/core-module/Chapter 12/Deciding to Defer.w
index 7ed6bf636..923668002 100644
--- a/inform7/core-module/Chapter 12/Deciding to Defer.w
+++ b/inform7/core-module/Chapter 12/Deciding to Defer.w
@@ -31,6 +31,7 @@ typedef struct pcalc_prop_deferral {
struct parse_node *deferred_from; /* remember where it came from, for Problem reports */
struct general_pointer defn_ref; /* sometimes we must remember other things too */
struct kind *cinder_kinds[16]; /* the kinds of value being cindered (see below) */
+ struct package_request *ppd_package; /* where to put both of the following: */
struct inter_name *ppd_iname; /* routine to implement this */
struct inter_name *rtp_iname; /* compile a string of the origin text for run-time problems? */
MEMORY_MANAGEMENT
@@ -56,8 +57,8 @@ pcalc_prop_deferral *Calculus::Deferrals::new_deferred_proposition(pcalc_prop *p
pdef->reason = reason;
pdef->deferred_from = current_sentence;
pdef->rtp_iname = NULL;
- package_request *PR = Hierarchy::package_in_enclosure(PROPOSITIONS_HAP);
- pdef->ppd_iname = Hierarchy::make_iname_in(PROPOSITION_HL, PR);
+ pdef->ppd_package = Hierarchy::package_in_enclosure(PROPOSITIONS_HAP);
+ pdef->ppd_iname = Hierarchy::make_iname_in(PROPOSITION_HL, pdef->ppd_package);
if (no_further_deferrals) internal_error("Too late now to defer propositions");
return pdef;
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 8d3d0b5e2..882b5e953 100644
--- a/inform7/core-module/Chapter 13/Runtime Support for Kinds.w
+++ b/inform7/core-module/Chapter 13/Runtime Support for Kinds.w
@@ -612,7 +612,7 @@ inter_name *Kinds::RunTime::get_kind_GPR_iname(kind *K) {
if (K == NULL) return NULL;
kind_constructor *con = Kinds::get_construct(K);
if (con->kind_GPR_iname == NULL) {
- package_request *R = Kinds::RunTime::package(K);
+ package_request *R = Kinds::Behaviour::package(K);
con->kind_GPR_iname = Hierarchy::make_iname_in(GPR_FN_HL, R);
}
return con->kind_GPR_iname;
@@ -622,7 +622,7 @@ inter_name *Kinds::RunTime::get_instance_GPR_iname(kind *K) {
if (K == NULL) return NULL;
kind_constructor *con = Kinds::get_construct(K);
if (con->instance_GPR_iname == NULL) {
- package_request *R = Kinds::RunTime::package(K);
+ package_request *R = Kinds::Behaviour::package(K);
con->instance_GPR_iname = Hierarchy::make_iname_in(INSTANCE_GPR_FN_HL, R);
}
return con->instance_GPR_iname;
@@ -706,7 +706,6 @@ void Kinds::RunTime::compile_structures(void) {
@ =
inter_name *identifier = rks->rks_dv_iname;
current_sentence = rks->default_requested_here;
- packaging_state save = Packaging::enter_home_of(identifier);
if (Kinds::get_construct(K) == CON_phrase) {
Phrases::Constants::compile_default_closure(identifier, K);
} else if (Kinds::get_construct(K) == CON_relation) {
@@ -722,7 +721,6 @@ void Kinds::RunTime::compile_structures(void) {
"for the kind '%2', but there's no obvious way to make one.");
Problems::issue_problem_end();
}
- Packaging::exit(save);
@ =
packaging_state save = Routines::begin(Hierarchy::find(DEFAULTVALUEFINDER_HL));
@@ -893,12 +891,6 @@ typedef struct kind_interaction {
MEMORY_MANAGEMENT
} kind_interaction;
-@ =
-package_request *Kinds::RunTime::package(kind *K) {
- inter_name *iname = Kinds::RunTime::iname(K);
- return Packaging::home_of(iname);
-}
-
@
@d MAX_KIND_ARITY 32
diff --git a/inform7/core-module/Chapter 15/Either-Or Properties.w b/inform7/core-module/Chapter 15/Either-Or Properties.w
index 55e192808..496a98508 100644
--- a/inform7/core-module/Chapter 15/Either-Or Properties.w
+++ b/inform7/core-module/Chapter 15/Either-Or Properties.w
@@ -87,7 +87,7 @@ relies on adjectival meanings.
property *Properties::EitherOr::new_nameless(wchar_t *I6_form) {
wording W = Feeds::feed_text(I6_form);
inter_name *iname = Hierarchy::make_iname_with_memo(PROPERTY_HL, Hierarchy::template(), W);
- property *prn = Properties::create(EMPTY_WORDING, iname);
+ property *prn = Properties::create(EMPTY_WORDING, Hierarchy::template(), iname);
prn->either_or = TRUE;
Properties::exclude_from_index(prn);
Properties::set_translation(prn, I6_form);
diff --git a/inform7/core-module/Chapter 15/Emit Property Values.w b/inform7/core-module/Chapter 15/Emit Property Values.w
index b51abd5a7..1ca2d93d7 100644
--- a/inform7/core-module/Chapter 15/Emit Property Values.w
+++ b/inform7/core-module/Chapter 15/Emit Property Values.w
@@ -115,7 +115,7 @@ int Properties::Emit::emit_propertyvalue(inference_subject *know, property *prn)
instance *I = InferenceSubjects::as_instance(know);
if (I) R = Instances::package(I);
kind *K = InferenceSubjects::as_kind(know);
- if (K) R = Kinds::RunTime::package(K);
+ if (K) R = Kinds::Behaviour::package(K);
int storage_cost = 0;
if ((Properties::visited_in_traverse(prn) == FALSE) &&
(Properties::can_be_compiled(prn))) {
diff --git a/inform7/core-module/Chapter 15/Properties.w b/inform7/core-module/Chapter 15/Properties.w
index ef98cbe1c..d66041348 100644
--- a/inform7/core-module/Chapter 15/Properties.w
+++ b/inform7/core-module/Chapter 15/Properties.w
@@ -36,6 +36,7 @@ typedef struct property {
/* runtime implementation */
int metadata_table_offset; /* position in the |property_metadata| word array at run-time */
+ struct package_request *prop_package; /* where to find: */
struct inter_name *prop_iname; /* the identifier we would like to use at run-time for this property */
int translated; /* has this been given an explicit translation? */
int prn_emitted; /* has this been emitted to Inter yet? */
@@ -91,7 +92,7 @@ property *Properties::obtain(wording W, int valued) {
parse_node *p = ExParser::parse_excerpt(PROPERTY_MC, W);
property *prn;
if (p == NULL) {
- prn = Properties::create(W, NULL);
+ prn = Properties::create(W, NULL, NULL);
if (valued) {
Properties::Valued::make_setting_relation(prn, W);
prn->either_or = FALSE;
@@ -111,7 +112,7 @@ property *Properties::obtain(wording W, int valued) {
@ And: (2) To create a new structure outright.
=
-property *Properties::create(wording W, inter_name *using_iname) {
+property *Properties::create(wording W, package_request *using_package, inter_name *using_iname) {
W = Articles::remove_article(W);
@;
@;
@@ -196,6 +197,7 @@ something.
prn->ambiguous_name = (W);
prn->applicable_to = NULL;
prn->either_or = FALSE;
+ prn->prop_package = using_package;
prn->prop_iname = using_iname;
prn->prn_emitted = FALSE;
prn->translated = FALSE;
@@ -681,12 +683,20 @@ inter_name *Properties::iname(property *prn) {
if ((Properties::is_either_or(prn)) && (prn->stored_in_negation))
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 = Hierarchy::make_iname_with_memo(PROPERTY_HL, R, prn->name);
+ prn->prop_package = Hierarchy::package(prn->owning_module, PROPERTIES_HAP);
+ prn->prop_iname = Hierarchy::make_iname_with_memo(PROPERTY_HL, prn->prop_package, prn->name);
}
return prn->prop_iname;
}
+package_request *Properties::package(property *prn) {
+ if (prn == NULL) internal_error("tried to find package for null property");
+ if ((Properties::is_either_or(prn)) && (prn->stored_in_negation))
+ return Properties::package(Properties::EitherOr::get_negation(prn));
+ Properties::iname(prn);
+ return prn->prop_package;
+}
+
void Properties::emit_single(property *prn) {
if (prn == NULL) internal_error("tried to find emit single for null property");
if ((Properties::is_either_or(prn)) && (prn->stored_in_negation)) {
diff --git a/inform7/core-module/Chapter 15/Valued Properties.w b/inform7/core-module/Chapter 15/Valued Properties.w
index 94206cebb..fe2ed107c 100644
--- a/inform7/core-module/Chapter 15/Valued Properties.w
+++ b/inform7/core-module/Chapter 15/Valued Properties.w
@@ -63,7 +63,7 @@ property *Properties::Valued::new_nameless(text_stream *I6_form, kind *K) {
if (K == NULL) internal_error("new nameless property without kind");
package_request *R = Hierarchy::package(Modules::find(current_sentence), PROPERTIES_HAP);
inter_name *using_iname = Hierarchy::make_iname_with_memo(PROPERTY_HL, R, W);
- property *prn = Properties::create(EMPTY_WORDING, using_iname);
+ property *prn = Properties::create(EMPTY_WORDING, R, using_iname);
Properties::exclude_from_index(prn);
prn->either_or = FALSE;
Properties::set_translation_S(prn, I6_form);
@@ -74,9 +74,9 @@ property *Properties::Valued::new_nameless(text_stream *I6_form, kind *K) {
return prn;
}
-property *Properties::Valued::new_nameless_using(kind *K, inter_name *using) {
+property *Properties::Valued::new_nameless_using(kind *K, package_request *R, inter_name *using) {
if (K == NULL) internal_error("new nameless property without kind");
- property *prn = Properties::create(EMPTY_WORDING, using);
+ property *prn = Properties::create(EMPTY_WORDING, R, using);
Properties::exclude_from_index(prn);
prn->either_or = FALSE;
prn->property_value_kind = K;
diff --git a/inform7/core-module/Chapter 16/Instance Counting.w b/inform7/core-module/Chapter 16/Instance Counting.w
index 5d7ce1ce8..6510fb26f 100644
--- a/inform7/core-module/Chapter 16/Instance Counting.w
+++ b/inform7/core-module/Chapter 16/Instance Counting.w
@@ -269,11 +269,11 @@ for the relation-route-finding code at run time.
inter_name *count_iname = PL::Counting::instance_count_iname(K);
PF_S(counting, subj)->instance_count_prop =
- Properties::Valued::new_nameless_using(K_number, count_iname);
+ Properties::Valued::new_nameless_using(K_number, Kinds::Behaviour::package(K), count_iname);
inter_name *next_iname = PL::Counting::next_instance(K);
PF_S(counting, subj)->instance_link_prop =
- Properties::Valued::new_nameless_using(K_object, next_iname);
+ Properties::Valued::new_nameless_using(K_object, Kinds::Behaviour::package(K), next_iname);
}
P_KD_Count = Properties::Valued::new_nameless(I"KD_Count", K_number);
diff --git a/inform7/core-module/Chapter 17/Text Literals.w b/inform7/core-module/Chapter 17/Text Literals.w
index a7e8d5fd9..6dcfcb4b8 100644
--- a/inform7/core-module/Chapter 17/Text Literals.w
+++ b/inform7/core-module/Chapter 17/Text Literals.w
@@ -250,12 +250,9 @@ int Strings::TextLiterals::CCOUNT_QUOTATIONS(void) {
@ A version from fixed text:
=
-void Strings::TextLiterals::compile_literal_from_text(inter_name *iname, inter_t *v1, inter_t *v2, wchar_t *p) {
+void Strings::TextLiterals::compile_literal_from_text(inter_name *context, inter_t *v1, inter_t *v2, wchar_t *p) {
literal_text *lt = Strings::TextLiterals::compile_literal(NULL, TRUE, Feeds::feed_text(p));
- packaging_state save = Packaging::enter_home_of(iname);
- inter_reading_state *IRS = Emit::IRS();
- Emit::to_ival(IRS->read_into, IRS->current_package, v1, v2, lt->lt_sba_iname);
- Packaging::exit(save);
+ Emit::to_ival_in_context(context, v1, v2, lt->lt_sba_iname);
}
@ The above gradually piled up the need for |TX_L_*| constants/routines,
diff --git a/inform7/core-module/Chapter 17/Text Substitutions.w b/inform7/core-module/Chapter 17/Text Substitutions.w
index 1d79314ee..32b7917ea 100644
--- a/inform7/core-module/Chapter 17/Text Substitutions.w
+++ b/inform7/core-module/Chapter 17/Text Substitutions.w
@@ -141,7 +141,7 @@ void Strings::TextSubstitutions::text_substitution_cue(value_holster *VH, wordin
Frames::emit_allocation(K_text);
}
text_substitution *ts = Strings::TextSubstitutions::new_text_substitution(W, phsf,
- adopted_rule_for_compilation, adopted_marker_for_compilation, Packaging::current_enclosure());
+ adopted_rule_for_compilation, adopted_marker_for_compilation, Emit::current_enclosure());
inter_name *tin = Strings::TextSubstitutions::text_substitution_iname(ts);
if (VH->vhmode_wanted == INTER_DATA_VHMODE)
Emit::holster(VH, tin);
@@ -157,7 +157,7 @@ void Strings::TextSubstitutions::text_substitution_cue(value_holster *VH, wordin
@ =
text_substitution *ts = Strings::TextSubstitutions::new_text_substitution(W, phsf,
- adopted_rule_for_compilation, adopted_marker_for_compilation, Packaging::current_enclosure());
+ adopted_rule_for_compilation, adopted_marker_for_compilation, Emit::current_enclosure());
if (TEST_COMPILATION_MODE(CONSTANT_CMODE)) {
package_request *PR = Hierarchy::package_in_enclosure(BLOCK_CONSTANTS_HAP);
inter_name *N = Hierarchy::make_iname_in(BLOCK_CONSTANT_HL, PR);
diff --git a/inform7/core-module/Chapter 18/List Constants.w b/inform7/core-module/Chapter 18/List Constants.w
index b0c892a36..528a3562d 100644
--- a/inform7/core-module/Chapter 18/List Constants.w
+++ b/inform7/core-module/Chapter 18/List Constants.w
@@ -79,7 +79,7 @@ literal_list *Lists::empty_literal_list(wording W) {
ll->ll_iname = NULL;
ll->first_llist_entry = NULL;
ll->list_text = NULL;
- ll->ll_package = Packaging::current_enclosure();
+ ll->ll_package = Emit::current_enclosure();
Kinds::RunTime::ensure_basic_heap_present();
return ll;
}
diff --git a/inform7/core-module/Chapter 21/Rule Bookings.w b/inform7/core-module/Chapter 21/Rule Bookings.w
index c7512552b..67b80de70 100644
--- a/inform7/core-module/Chapter 21/Rule Bookings.w
+++ b/inform7/core-module/Chapter 21/Rule Bookings.w
@@ -769,7 +769,7 @@ than once for each rule.
if (action_based == FALSE) grouping = FALSE;
inter_symbol *forbid_breaks_s = NULL, *rv_s = NULL, *original_deadflag_s = NULL, *p_s = NULL;
- packaging_state save_array = Packaging::stateless();
+ packaging_state save_array = Emit::unused_packaging_state();
@;
int group_size = 0, group_started = FALSE, entry_count = 0, action_group_open = FALSE;
diff --git a/inform7/core-module/Chapter 21/Rulebooks.w b/inform7/core-module/Chapter 21/Rulebooks.w
index 5d06cbfb5..1024f9fa6 100644
--- a/inform7/core-module/Chapter 21/Rulebooks.w
+++ b/inform7/core-module/Chapter 21/Rulebooks.w
@@ -876,9 +876,7 @@ void Rulebooks::compile_rulebooks(void) {
if (Rulebooks::focus(rb) == PARAMETER_FOCUS) par = TRUE;
LOGIF(RULEBOOK_COMPILATION, "Compiling rulebook: %W = %n\n",
rb->primary_name, rb->rb_iname);
- packaging_state save = Packaging::enter_home_of(rb->rb_iname);
Rules::Bookings::list_compile(rb->rule_list, rb->rb_iname, act, par);
- Packaging::exit(save);
}
Rules::check_placement_safety();
}
diff --git a/inform7/core-module/Chapter 21/Rules.w b/inform7/core-module/Chapter 21/Rules.w
index 120930e1f..b6ac43938 100644
--- a/inform7/core-module/Chapter 21/Rules.w
+++ b/inform7/core-module/Chapter 21/Rules.w
@@ -208,9 +208,8 @@ void Rules::set_I6_definition(rule *R, wchar_t *identifier) {
R->rule_extern_iname = Hierarchy::make_iname_in(EXTERIOR_RULE_HL, R->rule_package);
inter_name *xiname = Hierarchy::find_by_name(XT);
- inter_t v1 = 0, v2 = 0;
- 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);
+ Emit::named_generic_constant_xiname(R->rule_package, R->rule_extern_iname, xiname);
+
R->xiname = xiname;
R->rule_extern_iname_as_text = Str::duplicate(XT);
DISCARD_TEXT(XT);
diff --git a/inform7/core-module/Chapter 22/Phrases as Values.w b/inform7/core-module/Chapter 22/Phrases as Values.w
index 8d94a588a..06f446c16 100644
--- a/inform7/core-module/Chapter 22/Phrases as Values.w
+++ b/inform7/core-module/Chapter 22/Phrases as Values.w
@@ -164,7 +164,7 @@ compilation.
=
void Phrases::Constants::compile_default_closure(inter_name *closure_identifier, kind *K) {
- package_request *P = Kinds::RunTime::package(K);
+ package_request *P = Kinds::Behaviour::package(K);
inter_name *rname = Hierarchy::make_iname_in(DEFAULT_CLOSURE_FN_HL, P);
@;
diff --git a/inform7/core-module/Chapter 22/Phrases.w b/inform7/core-module/Chapter 22/Phrases.w
index ada5c1f99..122fbc7fe 100644
--- a/inform7/core-module/Chapter 22/Phrases.w
+++ b/inform7/core-module/Chapter 22/Phrases.w
@@ -377,15 +377,11 @@ void Phrases::compile(phrase *ph, int *i, int max_i,
int effect = Phrases::Usage::get_effect(&(ph->usage_data));
if (effect == RULE_NOT_IN_RULEBOOK_EFF) effect = RULE_IN_RULEBOOK_EFF;
if (effect == TO_PHRASE_EFF) {
- packaging_state save = Packaging::enter_home_of(req->req_iname);
Routines::Compile::routine(ph, legible, req, acl);
- Packaging::exit(save);
@;
} else {
if (ph->at_least_one_compiled_form_needed) {
- packaging_state save = Packaging::enter_home_of(Phrases::iname(ph));
Routines::Compile::routine(ph, legible, NULL, acl);
- Packaging::exit(save);
@;
}
}
diff --git a/inform7/core-module/Chapter 25/Compile Phrases.w b/inform7/core-module/Chapter 25/Compile Phrases.w
index 8a49c83e5..4d03161ba 100644
--- a/inform7/core-module/Chapter 25/Compile Phrases.w
+++ b/inform7/core-module/Chapter 25/Compile Phrases.w
@@ -41,11 +41,11 @@ void Routines::Compile::routine(phrase *ph,
@;
- Routines::begin_framed(Routines::Compile::iname(ph, req), &(ph->stack_frame));
+ packaging_state save = Routines::begin_framed(Routines::Compile::iname(ph, req), &(ph->stack_frame));
@;
- Routines::end_in_current_package();
+ Routines::end(save);
phrase_being_compiled = NULL;
current_sentence = NULL;
diff --git a/inform7/core-module/Chapter 26/I6 Template Interpreter.w b/inform7/core-module/Chapter 26/I6 Template Interpreter.w
index 46ef4d9c1..70cfbfc7b 100644
--- a/inform7/core-module/Chapter 26/I6 Template Interpreter.w
+++ b/inform7/core-module/Chapter 26/I6 Template Interpreter.w
@@ -582,7 +582,7 @@ void TemplateFiles::compile_I7_from_I6_inner(value_holster *VH, text_stream *OUT
Holsters::unholster_pair(&VH2, &v1, &v2);
if (v1 == ALIAS_IVAL) {
PUT(URL_SYMBOL_CHAR);
- inter_symbols_table *T = Inter::Packages::scope(Packaging::current_enclosure()->actual_package);
+ inter_symbols_table *T = Inter::Packages::scope(Emit::current_enclosure()->actual_package);
inter_symbol *S = Inter::SymbolsTables::symbol_from_id(T, v2);
Inter::SymbolsTables::symbol_to_url_name(OUT, S);
PUT(URL_SYMBOL_CHAR);
diff --git a/inform7/core-module/Chapter 26/Routines.w b/inform7/core-module/Chapter 26/Routines.w
index 257b66a4c..dbfc905c5 100644
--- a/inform7/core-module/Chapter 26/Routines.w
+++ b/inform7/core-module/Chapter 26/Routines.w
@@ -1,24 +1,16 @@
[Routines::] Routines.
-To compile the bones of routines, and their local variable
-declarations.
+To compile the bones of functions, and their local variable declarations.
@ The code following is used throughout Inform, whenever we want to compile
-an I6 routine. Sometimes that's in order to define a phrase, but often not.
+a function. Sometimes that's in order to define a phrase, but often not.
-We then compile the body code of our routine, and conclude with:
-
- |Routines::end_in_current_package();|
+There are two ways to begin a function: specifying a stack frame which has
+already been set up, or not. Here's not:
=
packaging_state Routines::begin(inter_name *name) {
- packaging_state save = Packaging::enter_home_of(name);
- Routines::begin_framed(name, NULL);
- return save;
-}
-
-void Routines::begin_in_current_package(inter_name *name) {
- Routines::begin_framed(name, NULL);
+ return Routines::begin_framed(name, NULL);
}
@ During the time when we're compiling the body of the routine,
@@ -30,25 +22,22 @@ int currently_compiling_nnp = FALSE; /* is this a nonphrasal stack frame we made
inter_symbol *currently_compiling_inter_block = NULL; /* where Inter is being emitted to */
inter_name *currently_compiling_iname = NULL; /* routine we end up with */
-@ So here is the flip:
+@ So here is the general version, in which |phsf| may or may not be a
+pre-existing stack frame:
=
-void Routines::begin_framed(inter_name *iname, ph_stack_frame *phsf) {
+packaging_state Routines::begin_framed(inter_name *iname, ph_stack_frame *phsf) {
if (iname == NULL) internal_error("no iname for routine");
- package_request *R = Packaging::home_of(iname);
- if ((R == NULL) || (R == Hierarchy::main())) {
- LOG("Routine outside of package: ................................................ %n\n", iname);
- WRITE_TO(STDERR, "Routine outside of package: %n\n", iname);
- internal_error("routine outside of package");
- }
currently_compiling_iname = iname;
@;
Frames::Blocks::begin_code_blocks();
- currently_compiling_inter_block = Emit::block(iname);
+ packaging_state save = Emit::unused_packaging_state();
+ currently_compiling_inter_block = Emit::block(&save, iname);
LocalVariables::declare(phsf, FALSE);
+ return save;
}
inter_symbol *Routines::self(void) {
@@ -68,24 +57,20 @@ create a new nonphrasal stack frame.
currently_compiling_in_frame = phsf;
Frames::make_current(phsf);
-@ And here is the flop:
+@ As can be seen, very much more work is involved in finishing a function
+than in starting it. This is because we need to split into two cases: one
+where the code we've just compiled required allocation of heap memory
+(e.g. for dynamic strings or lists), and another simpler case where it
+did not.
=
void Routines::end(packaging_state save) {
- Routines::end_in_current_package();
- Packaging::exit(save);
-}
-
-void Routines::end_in_current_package(void) {
kind *R_kind = LocalVariables::deduced_function_kind(currently_compiling_in_frame);
inter_name *kernel_name = NULL, *public_name = currently_compiling_iname;
if ((currently_compiling_in_frame->allocated_pointers) ||
- (currently_compiling_in_frame->no_formal_parameters_needed > 0)) {
- if (Packaging::housed_in_function(public_name))
- kernel_name = Hierarchy::make_kernel_iname(Packaging::home_of(public_name));
- else internal_error("routine not housed in function");
- }
+ (currently_compiling_in_frame->no_formal_parameters_needed > 0))
+ kernel_name = Emit::kernel(public_name);
int needed = LocalVariables::count(currently_compiling_in_frame);
if (kernel_name) needed++;
@@ -103,13 +88,14 @@ void Routines::end_in_current_package(void) {
Frames::Blocks::end_code_blocks();
if (currently_compiling_nnp) Frames::remove_nonphrase_stack_frame();
Frames::remove_current();
+ Emit::end_main_block(save);
}
@ =
int returns_block_value =
Kinds::Behaviour::uses_pointer_values(currently_compiling_in_frame->kind_returned);
- inter_symbol *rsymb = Emit::block(public_name);
+ inter_symbol *rsymb = Emit::block(NULL, public_name);
inter_symbol *I7RBLK_symbol = NULL;
@;
int NBV = 0;
diff --git a/inform7/core-module/Chapter 27/Emit.w b/inform7/core-module/Chapter 27/Emit.w
index f218501bb..608f13ce9 100644
--- a/inform7/core-module/Chapter 27/Emit.w
+++ b/inform7/core-module/Chapter 27/Emit.w
@@ -74,7 +74,7 @@ void Emit::begin(void) {
Emit::comment(I"Primitives:");
Primitives::emit();
- Packaging::enter(Hierarchy::main()); // We never exit this
+ Packaging::enter_home_of(NULL); // Enters main, which we never exit
inter_name *KU = Hierarchy::find(K_UNCHECKED_HL);
packaging_state save = Packaging::enter_home_of(KU);
@@ -137,12 +137,10 @@ inter_symbol *Emit::extern(text_stream *name, kind *K) {
if (extern_symbols == NULL) extern_symbols = Dictionaries::new(1024, FALSE);
if (Dictionaries::find(extern_symbols, name))
return Dictionaries::read_value(extern_symbols, name);
- packaging_state save = Packaging::enter(Hierarchy::template());
inter_symbol *symb = Emit::new_symbol(Emit::main_scope(), name);
Inter::Symbols::extern(symb);
Dictionaries::create(extern_symbols, name);
Dictionaries::write_value(extern_symbols, name, symb);
- Packaging::exit(save);
return symb;
}
@@ -331,7 +329,7 @@ void Emit::property(inter_name *name, kind *K) {
}
void Emit::permission(property *prn, kind *K, inter_name *name) {
- packaging_state save = Packaging::enter(Kinds::RunTime::package(K));
+ packaging_state save = Packaging::enter(Kinds::Behaviour::package(K));
inter_name *prop_name = Properties::iname(prn);
inter_symbol *owner_kind = Emit::kind_to_symbol(K);
inter_symbol *store = (name)?InterNames::to_symbol(name):NULL;
@@ -381,7 +379,7 @@ void Emit::ensure_defaultvalue(kind *K) {
}
void Emit::defaultvalue(kind *K, inter_t v1, inter_t v2) {
- packaging_state save = Packaging::enter(Kinds::RunTime::package(K));
+ packaging_state save = Packaging::enter(Kinds::Behaviour::package(K));
inter_symbol *owner_kind = Emit::kind_to_symbol(K);
Emit::guard(Inter::DefaultValue::new(default_bookmark,
Inter::SymbolsTables::id_from_IRS_and_symbol(default_bookmark, owner_kind), v1, v2, Emit::baseline(default_bookmark), NULL));
@@ -424,6 +422,12 @@ void Emit::instance(inter_name *name, kind *K, int v) {
Packaging::exit(save);
}
+void Emit::named_generic_constant_xiname(package_request *PR, inter_name *name, inter_name *xiname) {
+ inter_t v1 = 0, v2 = 0;
+ Inter::Symbols::to_data(Emit::repository(), Packaging::incarnate(PR), InterNames::to_symbol(xiname), &v1, &v2);
+ Emit::named_generic_constant(name, v1, v2);
+}
+
void Emit::named_generic_constant(inter_name *name, inter_t val1, inter_t val2) {
packaging_state save = Packaging::enter_home_of(name);
inter_symbol *con_name = Emit::define_symbol(name);
@@ -786,9 +790,19 @@ inter_symbol *Emit::package(inter_name *iname, inter_symbol *ptype, inter_packag
return rsymb;
}
-inter_symbol *Emit::block(inter_name *iname) {
+inter_symbol *Emit::block(packaging_state *save, inter_name *iname) {
if (current_inter_routine) internal_error("nested routines");
if (Emit::IRS() == NULL) internal_error("no inter repository");
+
+ if (save) {
+ *save = Packaging::enter_home_of(iname);
+ package_request *R = Packaging::home_of(iname);
+ if ((R == NULL) || (R == Hierarchy::main())) {
+ LOG("Routine outside of package: %n\n", iname);
+ internal_error("routine outside of package");
+ }
+ }
+
inter_name *block_iname = NULL;
if (Packaging::housed_in_function(iname))
block_iname = Hierarchy::make_block_iname(Packaging::home_of(iname));
@@ -808,6 +822,16 @@ inter_symbol *Emit::block(inter_name *iname) {
return rsymb;
}
+inter_name *Emit::kernel(inter_name *public_name) {
+ if (Packaging::housed_in_function(public_name) == FALSE)
+ internal_error("routine not housed in function");
+ return Hierarchy::make_kernel_iname(Packaging::home_of(public_name));
+}
+
+void Emit::end_main_block(packaging_state save) {
+ Packaging::exit(save);
+}
+
void Emit::routine(inter_name *rname, kind *rkind, inter_symbol *block_name) {
if (Emit::IRS() == NULL) internal_error("no inter repository");
inter_symbol *AB_symbol = Emit::kind_to_symbol(rkind);
@@ -1349,9 +1373,46 @@ void Emit::to_ival(inter_repository *I, inter_package *pack, inter_t *val1, inte
*val1 = LITERAL_IVAL; *val2 = 0;
}
+void Emit::to_ival_in_context(inter_name *context, inter_t *val1, inter_t *val2, inter_name *iname) {
+ package_request *PR = InterNames::location(context);
+ inter_package *pack = Packaging::incarnate(PR);
+ inter_symbol *S = InterNames::to_symbol(iname);
+ if (S) { Inter::Symbols::to_data(pack->stored_in, pack, S, val1, val2); return; }
+ *val1 = LITERAL_IVAL; *val2 = 0;
+}
+
int Emit::defined(inter_name *iname) {
if (iname == NULL) return FALSE;
inter_symbol *S = InterNames::to_symbol(iname);
if (Inter::Symbols::is_defined(S)) return TRUE;
return FALSE;
}
+
+typedef struct ival_emission {
+ value_holster emission_VH;
+ packaging_state saved_PS;
+} ival_emission;
+
+ival_emission Emit::begin_ival_emission(inter_name *iname) {
+ ival_emission IE;
+ IE.emission_VH = Holsters::new(INTER_DATA_VHMODE);
+ IE.saved_PS = Packaging::enter_home_of(iname);
+ return IE;
+}
+
+value_holster *Emit::ival_holster(ival_emission *IE) {
+ return &(IE->emission_VH);
+}
+
+void Emit::end_ival_emission(ival_emission *IE, inter_t *v1, inter_t *v2) {
+ Holsters::unholster_pair(&(IE->emission_VH), v1, v2);
+ Packaging::exit(IE->saved_PS);
+}
+
+package_request *Emit::current_enclosure(void) {
+ return Packaging::current_enclosure();
+}
+
+packaging_state Emit::unused_packaging_state(void) {
+ return Packaging::stateless();
+}
diff --git a/inform7/core-module/Chapter 27/Inter Namespace.w b/inform7/core-module/Chapter 27/Inter Namespace.w
index 671c2b4fe..8ec231623 100644
--- a/inform7/core-module/Chapter 27/Inter Namespace.w
+++ b/inform7/core-module/Chapter 27/Inter Namespace.w
@@ -150,7 +150,9 @@ inter_name *InterNames::explicitly_named(text_stream *name, package_request *R)
inter_name *InterNames::explicitly_named_in_template(text_stream *name) {
inter_name *iname = InterNames::explicitly_named(name, Hierarchy::template());
+ packaging_state save = Packaging::enter_home_of(iname);
iname->symbol = Emit::extern(name, K_value);
+ Packaging::exit(save);
return iname;
}
diff --git a/inform7/core-module/Chapter 27/Packaging.w b/inform7/core-module/Chapter 27/Packaging.w
index ca4067f18..fa31d5bf1 100644
--- a/inform7/core-module/Chapter 27/Packaging.w
+++ b/inform7/core-module/Chapter 27/Packaging.w
@@ -69,10 +69,6 @@ packaging_state Packaging::enter_home_of(inter_name *N) {
return Packaging::enter(Packaging::home_of(N));
}
-packaging_state Packaging::enter_current_enclosure(void) {
- return Packaging::enter(current_enclosure);
-}
-
package_request *Packaging::current_enclosure(void) {
return current_enclosure;
}
@@ -86,6 +82,7 @@ int packaging_entry_sp = 0;
inter_reading_state packaging_entry_stack[MAX_PACKAGING_ENTRY_DEPTH];
packaging_state Packaging::enter(package_request *R) {
+ if (R == NULL) R = Hierarchy::main();
LOGIF(PACKAGING, "Entering $X\n", R);
inter_reading_state *IRS = Emit::IRS();
diff --git a/inform7/core-module/Chapter 5/Instances.w b/inform7/core-module/Chapter 5/Instances.w
index 2df2fa2b6..787231256 100644
--- a/inform7/core-module/Chapter 5/Instances.w
+++ b/inform7/core-module/Chapter 5/Instances.w
@@ -27,6 +27,8 @@ evidence turns up to suggest otherwise).
=
typedef struct instance {
struct noun *tag;
+ struct package_request *instance_package;
+ struct inter_name *instance_iname;
int instance_emitted;
struct parse_node *creating_sentence; /* sentence creating the instance */
struct parse_node *instance_of_set_at; /* and identifying its kind */
@@ -105,6 +107,8 @@ later on.)
K = Kinds::weaken(K);
@ =
+ I->instance_package = NULL;
+ I->instance_iname = NULL;
I->instance_emitted = FALSE;
I->creating_sentence = current_sentence;
I->instance_of_set_at = current_sentence;
@@ -287,9 +291,12 @@ text_stream *Instances::identifier(instance *I) {
inter_name *Instances::iname(instance *I) {
if (I == NULL) return NULL;
- package_request *R = Hierarchy::local_package(INSTANCES_HAP);
- UseNouns::noun_compose_identifier(R, I->tag, I->allocation_id);
- return UseNouns::iname(I->tag);
+ if (I->instance_iname == NULL) {
+ I->instance_package = Hierarchy::local_package(INSTANCES_HAP);
+ UseNouns::noun_compose_identifier(I->instance_package, I->tag, I->allocation_id);
+ I->instance_iname = UseNouns::iname(I->tag);
+ }
+ return I->instance_iname;
}
@h Writer.
@@ -717,8 +724,8 @@ inter_name *Instances::emitted_iname(instance *I) {
}
package_request *Instances::package(instance *I) {
- inter_name *iname = Instances::iname(I);
- return Packaging::home_of(iname);
+ Instances::iname(I); // Thus forcing this to exist...
+ return I->instance_package;
}
@h Adjectival uses of instances.
diff --git a/inform7/core-module/Chapter 5/Nonlocal Variables.w b/inform7/core-module/Chapter 5/Nonlocal Variables.w
index 14e4a6334..c158e461f 100644
--- a/inform7/core-module/Chapter 5/Nonlocal Variables.w
+++ b/inform7/core-module/Chapter 5/Nonlocal Variables.w
@@ -414,17 +414,15 @@ int NonlocalVariables::SUBJ_compile_all(void) {
if ((nlv->constant_at_run_time == FALSE) ||
(nlv->housed_in_variables_array)) {
- inter_name *iname = NonlocalVariables::iname(nlv);
- packaging_state save = Packaging::enter_home_of(iname);
-
- value_holster VH = Holsters::new(INTER_DATA_VHMODE);
-
BEGIN_COMPILATION_MODE;
COMPILATION_MODE_EXIT(DEREFERENCE_POINTERS_CMODE);
- NonlocalVariables::compile_initial_value_vh(&VH, nlv);
- END_COMPILATION_MODE;
+
+ inter_name *iname = NonlocalVariables::iname(nlv);
inter_t v1 = 0, v2 = 0;
- Holsters::unholster_pair(&VH, &v1, &v2);
+
+ NonlocalVariables::seek_initial_value(iname, &v1, &v2, nlv);
+
+ END_COMPILATION_MODE;
text_stream *rvalue = NULL;
if (nlv->housed_in_variables_array == FALSE)
@@ -439,7 +437,6 @@ int NonlocalVariables::SUBJ_compile_all(void) {
Routines::end(save);
}
- Packaging::exit(save);
}
return TRUE;
}
@@ -699,11 +696,9 @@ void NonlocalVariables::emit_initial_value_as_val(nonlocal_variable *nlv) {
}
void NonlocalVariables::seek_initial_value(inter_name *iname, inter_t *v1, inter_t *v2, nonlocal_variable *nlv) {
- packaging_state save = Packaging::enter_home_of(iname);
- value_holster VH = Holsters::new(INTER_DATA_VHMODE);
- NonlocalVariables::compile_initial_value_vh(&VH, nlv);
- Holsters::unholster_pair(&VH, v1, v2);
- Packaging::exit(save);
+ ival_emission IE = Emit::begin_ival_emission(iname);
+ NonlocalVariables::compile_initial_value_vh(Emit::ival_holster(&IE), nlv);
+ Emit::end_ival_emission(&IE, v1, v2);
}
void NonlocalVariables::compile_initial_value_vh(value_holster *VH, nonlocal_variable *nlv) {
diff --git a/inform7/if-module/Chapter 3/The Naming Thicket.w b/inform7/if-module/Chapter 3/The Naming Thicket.w
index 48f47c4d7..a644644d2 100644
--- a/inform7/if-module/Chapter 3/The Naming Thicket.w
+++ b/inform7/if-module/Chapter 3/The Naming Thicket.w
@@ -278,7 +278,7 @@ actually means it's rarely needed.)
if (P_cap_short_name == NULL) {
inter_name *property_iname = Hierarchy::find(CAPSHORTNAME_HL);
P_cap_short_name = Properties::Valued::new_nameless_using(
- K_text, property_iname);
+ K_text, Kinds::Behaviour::package(K_object), property_iname);
inter_name *iname = Hierarchy::find(CAP_SHORT_NAME_EXISTS_HL);
Emit::named_numeric_constant(iname, 1);
}
diff --git a/inform7/if-module/Chapter 5/General Parsing Routines.w b/inform7/if-module/Chapter 5/General Parsing Routines.w
index 145bbf55d..c6bcac618 100644
--- a/inform7/if-module/Chapter 5/General Parsing Routines.w
+++ b/inform7/if-module/Chapter 5/General Parsing Routines.w
@@ -113,13 +113,12 @@ void PL::Parsing::Tokens::General::write_parse_name_routines(void) {
parse_name_notice *notice;
LOOP_OVER(notice, parse_name_notice) {
gpr_kit gprk = PL::Parsing::Tokens::Values::new_kit();
- packaging_state save = Packaging::enter_home_of(notice->pnn_iname);
- if (PL::Parsing::Tokens::General::compile_parse_name_head(&gprk,
+ packaging_state save = Emit::unused_packaging_state();
+ if (PL::Parsing::Tokens::General::compile_parse_name_head(&save, &gprk,
notice->parse_subject, NULL, notice->pnn_iname)) {
PL::Parsing::Tokens::General::compile_parse_name_tail(&gprk);
- Routines::end_in_current_package();
+ Routines::end(save);
}
- Packaging::exit(save);
}
}
@@ -168,8 +167,10 @@ the absence of either I7-level grammar lines or visible properties, that
will be the correct decision.
=
-int PL::Parsing::Tokens::General::compile_parse_name_head(gpr_kit *gprk, inference_subject *subj,
+int PL::Parsing::Tokens::General::compile_parse_name_head(packaging_state *save,
+ gpr_kit *gprk, inference_subject *subj,
grammar_verb *gv, inter_name *rname) {
+STREAM_FLUSH(DL);
int test_distinguishability = FALSE, sometimes_has_visible_properties = FALSE;
inter_name *N = NULL;
@@ -186,9 +187,15 @@ int PL::Parsing::Tokens::General::compile_parse_name_head(gpr_kit *gprk, inferen
if (InferenceSubjects::domain(subj)) test_distinguishability = TRUE;
- if (rname) Routines::begin_in_current_package(rname);
- else if (N) Routines::begin_in_current_package(N);
- else internal_error("no parse name routine name given");
+ inter_name *compile_to = rname;
+ if (compile_to == NULL) compile_to = N;
+ if (compile_to == NULL) internal_error("no parse name routine name given");
+
+LOG("\n\nAND %n\n", compile_to);
+STREAM_FLUSH(DL);
+
+ *save = Routines::begin(compile_to);
+
PL::Parsing::Tokens::Values::add_parse_name_vars(gprk);
PL::Parsing::Tokens::General::top_of_head(gprk, N, subj,
diff --git a/inform7/if-module/Chapter 5/Grammar Verbs.w b/inform7/if-module/Chapter 5/Grammar Verbs.w
index d15598cb7..ae4fedf8d 100644
--- a/inform7/if-module/Chapter 5/Grammar Verbs.w
+++ b/inform7/if-module/Chapter 5/Grammar Verbs.w
@@ -525,8 +525,7 @@ grammar_verb *PL::Parsing::Verbs::for_prn(property *prn) {
gv = PL::Parsing::Verbs::gv_new(GV_IS_PROPERTY_NAME);
Properties::EitherOr::set_parsing_grammar(prn, gv);
gv->prn_understood = prn;
- inter_name *iname = Properties::iname(prn);
- gv->gv_prn_iname = Hierarchy::make_iname_in(EITHER_OR_GPR_FN_HL, Packaging::home_of(iname));
+ gv->gv_prn_iname = Hierarchy::make_iname_in(EITHER_OR_GPR_FN_HL, Properties::package(prn));
return gv;
}
@@ -821,13 +820,13 @@ void PL::Parsing::Verbs::compile(grammar_verb *gv) {
}
case GV_IS_OBJECT: {
gpr_kit gprk = PL::Parsing::Tokens::Values::new_kit();
- packaging_state save = Packaging::enter_home_of(PL::Parsing::Tokens::General::get_gv_parse_name(gv));
- if (PL::Parsing::Tokens::General::compile_parse_name_head(&gprk, gv->subj_understood, gv, NULL)) {
+ packaging_state save = Emit::unused_packaging_state();
+ LOG("\n\nSo %n\n", PL::Parsing::Tokens::General::get_gv_parse_name(gv));
+ if (PL::Parsing::Tokens::General::compile_parse_name_head(&save, &gprk, gv->subj_understood, gv, NULL)) {
PL::Parsing::Verbs::gv_compile_parse_name_lines(&gprk, gv);
PL::Parsing::Tokens::General::compile_parse_name_tail(&gprk);
- Routines::end_in_current_package();
+ Routines::end(save);
}
- Packaging::exit(save);
break;
}
case GV_IS_VALUE:
diff --git a/inform7/kinds-module/Chapter 2/Using Kinds.w b/inform7/kinds-module/Chapter 2/Using Kinds.w
index 3fccd5de0..9cc7dc4b7 100644
--- a/inform7/kinds-module/Chapter 2/Using Kinds.w
+++ b/inform7/kinds-module/Chapter 2/Using Kinds.w
@@ -516,21 +516,21 @@ package_request *Kinds::Behaviour::package(kind *K) {
inter_name *Kinds::Behaviour::get_inc_iname(kind *K) {
if (K == NULL) internal_error("null kind has no inc routine");
if (K->construct->inc_iname) return K->construct->inc_iname;
- package_request *R = Kinds::RunTime::package(K);
+ package_request *R = Kinds::Behaviour::package(K);
K->construct->inc_iname = Hierarchy::make_iname_in(DECREMENT_FN_HL, R);
return K->construct->inc_iname;
}
inter_name *Kinds::Behaviour::get_dec_iname(kind *K) {
if (K == NULL) internal_error("null kind has no dec routine");
if (K->construct->dec_iname) return K->construct->dec_iname;
- package_request *R = Kinds::RunTime::package(K);
+ package_request *R = Kinds::Behaviour::package(K);
K->construct->dec_iname = Hierarchy::make_iname_in(INCREMENT_FN_HL, R);
return K->construct->dec_iname;
}
inter_name *Kinds::Behaviour::get_ranger_iname(kind *K) {
if (K == NULL) internal_error("null kind has no inc routine");
if (K->construct->ranger_iname) return K->construct->ranger_iname;
- package_request *R = Kinds::RunTime::package(K);
+ package_request *R = Kinds::Behaviour::package(K);
K->construct->ranger_iname = Hierarchy::make_iname_in(RANGER_FN_HL, R);
return K->construct->ranger_iname;
}