diff --git a/docs/runtime-module/3-cm.html b/docs/runtime-module/3-cm.html
index d76aef3ac..d744357dd 100644
--- a/docs/runtime-module/3-cm.html
+++ b/docs/runtime-module/3-cm.html
@@ -78,11 +78,14 @@ function togglePopup(material_id) {
void CompletionModule::compile(void) {
Version number constant1.1;
Semantic version number constant1.2;
-
Memory economy metadata1.3;
-
Frame size1.4;
-
RNG seed1.5;
-
Max indexed thumbnails1.6;
-
Headings1.8;
+
Virtual machine metadata1.3;
+
Plugin usage1.4;
+
Memory economy metadata1.5;
+
Frame size1.6;
+
RNG seed1.7;
+
Max indexed thumbnails1.8;
+
Headings1.11;
+
Debugging log aspects1.9;
}
-
+
+
+ target_vm *VM = Supervisor::current_vm();
+ if (VM == NULL) internal_error("target VM not set yet");
+ TEMPORARY_TEXT(vm)
+ TEMPORARY_TEXT(icon)
+ ExtensionIndex::plot_icon(icon, VM);
+ TargetVMs::write(vm, VM);
+ inter_name *iname = Hierarchy::find(VM_MD_HL);
+ Emit::text_constant(iname, vm);
+ if (Str::len(VM->VM_image) > 0) {
+ inter_name *iname = Hierarchy::find(VM_ICON_MD_HL);
+ Emit::text_constant(iname, VM->VM_image);
+ }
+ DISCARD_TEXT(vm)
+ DISCARD_TEXT(icon)
+
+
+
+
+
+ TEMPORARY_TEXT(inc)
+ TEMPORARY_TEXT(exc)
+ PluginManager::list_plugins(inc, TRUE);
+ PluginManager::list_plugins(exc, FALSE);
+ inter_name *iname = Hierarchy::find(LANGUAGE_ELEMENTS_USED_MD_HL);
+ Emit::text_constant(iname, inc);
+ if (Str::len(exc) > 0) {
+ inter_name *iname = Hierarchy::find(LANGUAGE_ELEMENTS_NOT_USED_MD_HL);
+ Emit::text_constant(iname, exc);
+ }
+ DISCARD_TEXT(inc)
+ DISCARD_TEXT(exc)
+
+
+
@@ -123,7 +164,7 @@ function togglePopup(material_id) {
Emit::numeric_constant(iname, 0);
-
@@ -132,7 +173,7 @@ function togglePopup(material_id) {
Hierarchy::make_available(iname);
-
@@ -141,7 +182,7 @@ function togglePopup(material_id) {
Hierarchy::make_available(iname);
-
@@ -150,7 +191,23 @@ function togglePopup(material_id) {
(inter_ti) global_compilation_settings.index_figure_thumbnails);
-
+
+
+
+ for (int i=0; i<NO_DEFINED_DA_VALUES; i++) {
+ debugging_aspect *da = &(the_debugging_aspects[i]);
+ if (Str::len(da->unhyphenated_name) > 0) {
+ package_request *pack = Hierarchy::completion_package(DEBUGGING_ASPECTS_HAP);
+ Hierarchy::apply_metadata(pack, DEBUGGING_ASPECT_NAME_MD_HL,
+ da->unhyphenated_name);
+ Hierarchy::apply_metadata_from_number(pack, DEBUGGING_ASPECT_USED_MD_HL,
+ (inter_ti) Log::aspect_switched_on(i));
+ }
+ }
+
+
+
typedef struct heading_compilation_data {
@@ -184,7 +241,7 @@ function togglePopup(material_id) {
} contents_entry;
- The structure heading_compilation_data is private to this section.
- The structure contents_entry is accessed in 2/cu, 4/ts, 5/act, 5/si, 5/tbl, 5/rls, 5/rlb, 5/lp and here.
-
@@ -200,7 +257,7 @@ function togglePopup(material_id) {
LOOP_OVER(ce, contents_entry) {
heading *h = ce->heading_entered;
package_request *pack = Hierarchy::completion_package(HEADINGS_HAP);
- Write the details1.8.1;
+ Write the details1.11.1;
Hierarchy::apply_metadata_from_number(pack, HEADING_INDEXABLE_MD_HL, 1);
contents_entry *next_ce = NEXT_OBJECT(ce, contents_entry);
if (h->level != 0)
@@ -216,7 +273,7 @@ function togglePopup(material_id) {
Hierarchy::apply_metadata_from_number(pack, HEADING_WORD_COUNT_MD_HL,
(inter_ti) N);
TEMPORARY_TEXT(OUT)
- Summarise all the objects and kinds created under the given heading1.8.2;
+ Summarise all the objects and kinds created under the given heading1.11.2;
if (Str::len(OUT) > 0)
Hierarchy::apply_metadata(pack, HEADING_SUMMARY_MD_HL, OUT);
DISCARD_TEXT(OUT)
@@ -225,13 +282,13 @@ function togglePopup(material_id) {
LOOP_OVER(h, heading) {
if (h->compilation_data.heading_package == NULL) {
package_request *pack = Hierarchy::completion_package(HEADINGS_HAP);
- Write the details1.8.1;
+ Write the details1.11.1;
Hierarchy::apply_metadata_from_number(pack, HEADING_INDEXABLE_MD_HL, 0);
}
}
-
@@ -280,8 +337,8 @@ function togglePopup(material_id) {
Hierarchy::apply_metadata_from_number(pack, HEADING_INDENTATION_MD_HL,
(inter_ti) h->indentation);
-
- This code is used in §1.8 (twice).
-
- This code is used in §1.11 (twice).
+
@@ -295,14 +352,14 @@ function togglePopup(material_id) {
}
}
-
- This code is used in §1.8.
+
- This code is used in §1.11.
-void CompletionModule::index_heading_recursively(heading *h) {
+void CompletionModule::index_heading_recursively(heading *h) {
if (h == NULL) return;
int show_heading = TRUE;
heading *next = h->child_heading;
diff --git a/docs/runtime-module/3-uo.html b/docs/runtime-module/3-uo.html
index 181721e13..dc3bfd7a0 100644
--- a/docs/runtime-module/3-uo.html
+++ b/docs/runtime-module/3-uo.html
@@ -94,12 +94,31 @@ work at runtime:
inter_name *set_iname = Hierarchy::make_iname_in(USE_OPTION_ON_MD_HL, R);
Emit::numeric_constant(set_iname, set);
Emit::numeric_constant(uo->compilation_data.uo_value, (inter_ti) 0);
+ Hierarchy::apply_metadata_from_raw_wording(R, USE_OPTION_MD_HL, uo->name);
TEMPORARY_TEXT(N)
WRITE_TO(N, "%W option", uo->name);
if (uo->minimum_setting_value > 0)
WRITE_TO(N, " [%d]", uo->minimum_setting_value);
Hierarchy::apply_metadata(R, USE_OPTION_PNAME_MD_HL, N);
DISCARD_TEXT(N)
+ Hierarchy::apply_metadata_from_number(R, SOURCE_FILE_SCOPED_MD_HL,
+ (inter_ti) uo->source_file_scoped);
+ if (uo->where_used)
+ Hierarchy::apply_metadata_from_number(R, USE_OPTION_USED_AT_MD_HL,
+ (inter_ti) Wordings::first_wn(Node::get_text(uo->where_used)));
+ source_file *sf = (uo->where_used)?
+ (Lexer::file_of_origin(Wordings::first_wn(Node::get_text(uo->where_used)))):NULL;
+ inform_extension *efo = (sf)?(Extensions::corresponding_to(sf)):NULL;
+ if ((sf) && (efo == NULL))
+ Hierarchy::apply_metadata_from_number(R, USED_IN_SOURCE_TEXT_MD_HL, 1);
+ else if (sf == NULL)
+ Hierarchy::apply_metadata_from_number(R, USED_IN_OPTIONS_MD_HL, 1);
+ else if (efo)
+ Hierarchy::apply_metadata_from_iname(R, USED_IN_EXTENSION_MD_HL,
+ CompilationUnits::extension_id(efo));
+ if (uo->minimum_setting_value >= 0)
+ Hierarchy::apply_metadata_from_number(R, USE_OPTION_MINIMUM_MD_HL,
+ (inter_ti) uo->minimum_setting_value);
}
Compile pragmas from use options which set these1.1;
diff --git a/docs/runtime-module/4-ts.html b/docs/runtime-module/4-ts.html
index 106daf6ab..af49b38dc 100644
--- a/docs/runtime-module/4-ts.html
+++ b/docs/runtime-module/4-ts.html
@@ -401,7 +401,7 @@ a request for a new text substitution to be compiled later...
parse_node *ts_code_block = Node::new(IMPERATIVE_NT);
- CompilationUnits::assign_to_same_unit(ts_code_block, ts->owning_point);
+ CompilationUnits::assign_to_same_unit(ts_code_block, ts->owning_point);
ts_code_block->next = Node::new(UNKNOWN_NT);
Node::set_text(ts_code_block->next, ts->unsubstituted_text);
Annotations::write_int(ts_code_block->next, from_text_substitution_ANNOT, TRUE);
diff --git a/docs/runtime-module/5-vrb.html b/docs/runtime-module/5-vrb.html
index 1f9b69326..b1f5c1a1d 100644
--- a/docs/runtime-module/5-vrb.html
+++ b/docs/runtime-module/5-vrb.html
@@ -404,7 +404,7 @@ compiled code, of course.
Hierarchy::apply_metadata_from_number(pack, VARIABLE_AT_MD_HL,
(inter_ti) Wordings::first_wn(nlv->name));
heading *h = Headings::of_wording(nlv->name);
- if (CompletionModule::has_heading_id(h))
+ if (CompletionModule::has_heading_id(h))
Hierarchy::apply_metadata_from_heading(pack, VARIABLE_HEADING_MD_HL, h);
Hierarchy::apply_metadata_from_number(pack, VARIABLE_INDEXABLE_MD_HL,
((h) && (h->index_definitions_made_under_this))?1:0);
diff --git a/docs/supervisor-module/5-ps2.html b/docs/supervisor-module/5-ps2.html
index c3a55794f..a9936ffdf 100644
--- a/docs/supervisor-module/5-ps2.html
+++ b/docs/supervisor-module/5-ps2.html
@@ -550,8 +550,10 @@ reads them in for every kit which is included in the project.
kit_dependency *kd;
LOOP_OVER_LINKED_LIST(kd, kit_dependency, project->kits_to_include)
Kits::activate_elements(kd->kit);
- PluginManager::list_plugins(DL, "Included", TRUE);
- PluginManager::list_plugins(DL, "Excluded", FALSE);
+ LOG("Included: "); PluginManager::list_plugins(DL, TRUE);
+ LOG("\n");
+ LOG("Excluded: "); PluginManager::list_plugins(DL, FALSE);
+ LOG("\n");
}
#endif
diff --git a/inbuild/supervisor-module/Chapter 5/Project Services.w b/inbuild/supervisor-module/Chapter 5/Project Services.w
index d2c88c03e..aed2d71cc 100644
--- a/inbuild/supervisor-module/Chapter 5/Project Services.w
+++ b/inbuild/supervisor-module/Chapter 5/Project Services.w
@@ -425,8 +425,10 @@ void Projects::activate_elements(inform_project *project) {
kit_dependency *kd;
LOOP_OVER_LINKED_LIST(kd, kit_dependency, project->kits_to_include)
Kits::activate_elements(kd->kit);
- PluginManager::list_plugins(DL, "Included", TRUE);
- PluginManager::list_plugins(DL, "Excluded", FALSE);
+ LOG("Included: "); PluginManager::list_plugins(DL, TRUE);
+ LOG("\n");
+ LOG("Excluded: "); PluginManager::list_plugins(DL, FALSE);
+ LOG("\n");
}
#endif
diff --git a/inform7/Figures/memory-diagnostics.txt b/inform7/Figures/memory-diagnostics.txt
index 2f609dc4c..45f73108e 100644
--- a/inform7/Figures/memory-diagnostics.txt
+++ b/inform7/Figures/memory-diagnostics.txt
@@ -1,12 +1,12 @@
-Total memory consumption was 320600K = 313 MB
+Total memory consumption was 320799K = 313 MB
-63.6% was used for 1630752 objects, in 325990 frames in 255 x 800K = 204000K = 199 MB:
+63.5% was used for 1633792 objects, in 326324 frames in 255 x 800K = 204000K = 199 MB:
9.8% inter_tree_node_array 45 x 8192 = 368640 objects, 32441760 bytes
- 6.7% text_stream_array 3912 x 100 = 391200 objects, 22032384 bytes
+ 6.7% text_stream_array 3928 x 100 = 392800 objects, 22122496 bytes
5.0% linked_list 29550 objects, 16548000 bytes
3.1% parse_node 129396 objects, 10351680 bytes
- 3.0% inter_symbol_array 101 x 1024 = 103424 objects, 9931936 bytes
+ 3.0% inter_symbol_array 102 x 1024 = 104448 objects, 10030272 bytes
2.2% verb_conjugation 160 objects, 7425280 bytes
1.6% parse_node_annotation_array 345 x 500 = 172500 objects, 5531040 bytes
1.0% pcalc_prop_array 25 x 1000 = 25000 objects, 3400800 bytes
@@ -18,14 +18,14 @@ Total memory consumption was 320600K = 313 MB
0.4% match_trie_array 11 x 1000 = 11000 objects, 1496352 bytes
0.4% inter_name_generator_array 36 x 1000 = 36000 objects, 1441152 bytes
0.4% i6_schema_array 23 x 100 = 2300 objects, 1380736 bytes
- 0.3% inter_package 16237 objects, 1169064 bytes
+ 0.3% inter_package 16311 objects, 1174392 bytes
0.3% id_body 940 objects, 1075360 bytes
- 0.3% dictionary 22164 objects, 1063872 bytes
- 0.3% inter_symbols_table 16237 objects, 1039168 bytes
- 0.3% dict_entry_array 310 x 100 = 31000 objects, 1001920 bytes
+ 0.3% dictionary 22239 objects, 1067472 bytes
+ 0.3% inter_symbols_table 16311 objects, 1043904 bytes
+ 0.3% dict_entry_array 311 x 100 = 31100 objects, 1005152 bytes
0.3% adjective_meaning 202 objects, 1000304 bytes
0.2% excerpt_meaning 3098 objects, 966576 bytes
- 0.2% package_request 10813 objects, 951544 bytes
+ 0.2% package_request 10887 objects, 958056 bytes
0.2% production 3871 objects, 898072 bytes
0.2% ptoken 8379 objects, 871416 bytes
0.2% grammatical_usage 3610 objects, 866400 bytes
@@ -44,7 +44,7 @@ Total memory consumption was 320600K = 313 MB
---- binary_predicate 321 objects, 169488 bytes
---- linguistic_stock_item 3315 objects, 159120 bytes
---- rule_family_data 400 objects, 147200 bytes
- ---- hierarchy_location 951 objects, 144552 bytes
+ ---- hierarchy_location 963 objects, 146376 bytes
---- index_lexicon_entry 395 objects, 142200 bytes
---- nonterminal 759 objects, 139656 bytes
---- nascent_array 1948 objects, 124672 bytes
@@ -53,7 +53,7 @@ Total memory consumption was 320600K = 313 MB
---- imperative_defn 1376 objects, 99072 bytes
---- anl_entry_array 2 x 1000 = 2000 objects, 96064 bytes
---- noun_usage 2401 objects, 96040 bytes
- ---- inter_tree 6 objects, 89808 bytes
+ ---- inter_tree 6 objects, 90432 bytes
---- preposition 273 objects, 87360 bytes
---- lexical_cluster 2516 objects, 80512 bytes
---- pcalc_term_array 2 x 1000 = 2000 objects, 80064 bytes
@@ -110,7 +110,7 @@ Total memory consumption was 320600K = 313 MB
---- booking_list 407 objects, 13024 bytes
---- adjective_iname_holder 320 objects, 12800 bytes
---- pathname 292 objects, 11680 bytes
- ---- uniqueness_count 369 objects, 8856 bytes
+ ---- uniqueness_count 375 objects, 9000 bytes
---- stopwatch_timer 109 objects, 8720 bytes
---- filename 208 objects, 8320 bytes
---- equation_node 68 objects, 7616 bytes
@@ -118,7 +118,7 @@ Total memory consumption was 320600K = 313 MB
---- shared_variable_array 1 x 100 objects, 7232 bytes
---- determiner 22 objects, 7216 bytes
---- verb 108 objects, 6048 bytes
- ---- hierarchy_attachment_point 62 objects, 5952 bytes
+ ---- hierarchy_attachment_point 63 objects, 6048 bytes
---- text_literal_holder 144 objects, 5760 bytes
---- heading_tree 20 objects, 5440 bytes
---- inbuild_work 78 objects, 4992 bytes
@@ -237,18 +237,18 @@ Total memory consumption was 320600K = 313 MB
---- by_function_bp_data 1 object, 40 bytes
---- kind_template_definition 1 object, 40 bytes
-36.3% was used for memory not allocated for objects:
+36.4% was used for memory not allocated for objects:
- 17.7% text stream storage 58431656 bytes in 404644 claims
- 3.7% dictionary storage 12241408 bytes in 22164 claims
+ 17.8% text stream storage 58579968 bytes in 406210 claims
+ 3.7% dictionary storage 12287488 bytes in 22239 claims
---- sorting 720 bytes in 3 claims
2.1% source text 7200000 bytes in 3 claims
3.2% source text details 10800000 bytes in 2 claims
---- linguistic stock array 81920 bytes in 2 claims
---- small word set array 105600 bytes in 22 claims
- 0.8% inter symbols storage 2795552 bytes in 17251 claims
+ 0.8% inter symbols storage 2805024 bytes in 17325 claims
5.1% inter bytecode storage 16802796 bytes in 14 claims
- 2.7% inter links storage 8866944 bytes in 265 claims
+ 2.6% inter links storage 8866944 bytes in 265 claims
---- inter tree location list storage 174848 bytes in 28 claims
0.5% instance-of-kind counting 1695204 bytes in 1 claim
---- compilation workspace for objects 21856 bytes in 25 claims
@@ -256,5 +256,5 @@ Total memory consumption was 320600K = 313 MB
---- code generation workspace for objects 9648 bytes in 9 claims
---- emitter array storage 154432 bytes in 2037 claims
-19.8% was overhead - 65081600 bytes = 63556K = 62 MB
+19.7% was overhead - 64867056 bytes = 63346K = 61 MB
diff --git a/inform7/Figures/timings-diagnostics.txt b/inform7/Figures/timings-diagnostics.txt
index 42be1c761..2b5f6470b 100644
--- a/inform7/Figures/timings-diagnostics.txt
+++ b/inform7/Figures/timings-diagnostics.txt
@@ -1,35 +1,35 @@
100.0% in inform7 run
- 53.6% in compilation to Inter
- 39.4% in //Sequence::undertake_queued_tasks//
- 4.1% in //MajorNodes::pre_pass//
+ 53.8% in compilation to Inter
+ 39.6% in //Sequence::undertake_queued_tasks//
+ 3.9% in //MajorNodes::pre_pass//
2.9% in //MajorNodes::pass_1//
1.5% in //ImperativeDefinitions::assess_all//
- 0.5% in //MajorNodes::pass_2//
- 0.5% in //RTKindConstructors::compile//
- 0.5% in //Sequence::undertake_queued_tasks//
- 0.5% in //World::stage_V//
- 0.3% in //ImperativeDefinitions::compile_first_block//
- 0.1% in //CompletionModule::compile//
+ 0.4% in //ImperativeDefinitions::compile_first_block//
+ 0.4% in //MajorNodes::pass_2//
+ 0.4% in //RTKindConstructors::compile//
+ 0.4% in //Sequence::undertake_queued_tasks//
+ 0.4% in //World::stage_V//
+ 0.3% in //CompletionModule::compile//
0.1% in //InferenceSubjects::emit_all//
0.1% in //RTKindConstructors::compile_permissions//
0.1% in //Sequence::undertake_queued_tasks//
0.1% in //Task::make_built_in_kind_constructors//
0.1% in //World::stages_II_and_III//
- 2.1% not specifically accounted for
- 44.1% in running Inter pipeline
- 11.2% in inter step 7/14: consolidate-text
- 10.8% in step preparation
+ 2.2% not specifically accounted for
+ 43.9% in running Inter pipeline
+ 11.8% in step preparation
+ 11.0% in inter step 7/14: consolidate-text
9.1% in inter step 2/14: link
- 7.2% in inter step 14/14: generate inform6 -> auto.inf
- 1.0% in inter step 10/14: make-identifiers-unique
+ 7.4% in inter step 14/14: generate inform6 -> auto.inf
+ 1.1% in inter step 10/14: make-identifiers-unique
0.3% in inter step 11/14: reconcile-verbs
0.3% in inter step 13/14: eliminate-redundant-operations
0.3% in inter step 6/14: assimilate
+ 0.3% in inter step 8/14: resolve-external-symbols
0.1% in inter step 12/14: eliminate-redundant-labels
0.1% in inter step 4/14: parse-linked-matter
0.1% in inter step 5/14: resolve-conditional-compilation
- 0.1% in inter step 8/14: resolve-external-symbols
0.1% in inter step 9/14: inspect-plugs
- 2.6% not specifically accounted for
- 1.9% in supervisor
+ 1.6% not specifically accounted for
+ 1.8% in supervisor
0.4% not specifically accounted for
diff --git a/inform7/assertions-module/Chapter 3/New Use Option Requests.w b/inform7/assertions-module/Chapter 3/New Use Option Requests.w
index 8e00ad4df..1e49b1085 100644
--- a/inform7/assertions-module/Chapter 3/New Use Option Requests.w
+++ b/inform7/assertions-module/Chapter 3/New Use Option Requests.w
@@ -133,22 +133,6 @@ void NewUseOptions::set(use_option *uo, int min_setting, source_file *from) {
uo->minimum_setting_value, from);
}
-@ And this is what the rest of Inform calls to find out whether a particular
-pragma is set:
-
-=
-int NewUseOptions::uo_set_from(use_option *uo, int category, inform_extension *E) {
- source_file *sf = (uo->where_used)?
- (Lexer::file_of_origin(Wordings::first_wn(Node::get_text(uo->where_used)))):NULL;
- inform_extension *efo = (sf)?(Extensions::corresponding_to(sf)):NULL;
- switch (category) {
- case 1: if ((sf) && (efo == NULL)) return TRUE; break;
- case 2: if (sf == NULL) return TRUE; break;
- case 3: if ((sf) && (efo == E)) return TRUE; break;
- }
- return FALSE;
-}
-
@ We can also meddle with the I6 memory settings which will be used to finish
compiling the story file. We need this because we have no practical way to
predict when our code will break I6's limits: the only reasonable way it can
diff --git a/inform7/core-module/Chapter 3/Plugin Manager.w b/inform7/core-module/Chapter 3/Plugin Manager.w
index 75ec1c0b1..5756cd4c0 100644
--- a/inform7/core-module/Chapter 3/Plugin Manager.w
+++ b/inform7/core-module/Chapter 3/Plugin Manager.w
@@ -46,17 +46,14 @@ int PluginManager::active(plugin *P) {
return P->active;
}
-void PluginManager::list_plugins(OUTPUT_STREAM, char *label, int state) {
+void PluginManager::list_plugins(OUTPUT_STREAM, int state) {
plugin *P;
int c = 0;
- WRITE("%s: ", label);
LOOP_OVER(P, plugin) if (P->active == state) {
if (c > 0) WRITE(", ");
WRITE("%S", P->textual_name);
c++;
}
- if (c == 0) WRITE("none");
- WRITE(".\n");
}
@ In the code above, plugins are set up as inactive by default -- even "core",
diff --git a/inform7/index-module/Chapter 2/Innards Element.w b/inform7/index-module/Chapter 2/Innards Element.w
deleted file mode 100644
index e2041b428..000000000
--- a/inform7/index-module/Chapter 2/Innards Element.w
+++ /dev/null
@@ -1,159 +0,0 @@
-[IXInnards::] Innards Element.
-
-To index tables.
-
-@h Describing the current VM.
-
-=
-void IXInnards::render(OUTPUT_STREAM, target_vm *VM) {
- IXInnards::index_VM(OUT, VM);
- IXInnards::index_use_options(OUT);
- HTML_OPEN("p");
- Index::extra_link(OUT, 3);
- WRITE("See some technicalities for Inform maintainers only");
- HTML_CLOSE("p");
- Index::extra_div_open(OUT, 3, 2, "e0e0e0");
- IXInnards::show_configuration(OUT);
- @;
- Index::extra_div_close(OUT, "e0e0e0");
-}
-
-@ The index provides some hidden paste icons for these:
-
-@ =
- HTML_OPEN("p");
- WRITE("Debugging log:");
- HTML_CLOSE("p");
- HTML_OPEN("p");
- for (int i=0; iunhyphenated_name) > 0) {
- TEMPORARY_TEXT(is)
- WRITE_TO(is, "Include %S in the debugging log.", da->unhyphenated_name);
- PasteButtons::paste_text(OUT, is);
- WRITE(" %S", is);
- DISCARD_TEXT(is)
- HTML_TAG("br");
- }
- }
- HTML_CLOSE("p");
-
-@ =
-void IXInnards::index_VM(OUTPUT_STREAM, target_vm *VM) {
- if (VM == NULL) internal_error("target VM not set yet");
- Index::anchor(OUT, I"STORYFILE");
- HTML_OPEN("p"); WRITE("Story file format: ");
- ExtensionIndex::plot_icon(OUT, VM);
- TargetVMs::write(OUT, VM);
- HTML_CLOSE("p");
-}
-
-@ =
-void IXInnards::show_configuration(OUTPUT_STREAM) {
- HTML_OPEN("p");
- Index::anchor(OUT, I"CONFIG");
- WRITE("Inform language definition:\n");
- PluginManager::list_plugins(OUT, "Included", TRUE);
- PluginManager::list_plugins(OUT, "Excluded", FALSE);
- HTML_CLOSE("p");
-}
-
-@ Now for indexing, where there's nothing much to see.
-
-@d MAIN_TEXT_UO_ORIGIN 1
-@d OPTIONS_FILE_UO_ORIGIN 2
-@d EXTENSION_UO_ORIGIN 3
-
-=
-void IXInnards::index_use_options(OUTPUT_STREAM) {
- HTML_OPEN("p"); WRITE("The following use options are in force:"); HTML_CLOSE("p");
- IXInnards::index_options_in_force_from(OUT, MAIN_TEXT_UO_ORIGIN, NULL);
- IXInnards::index_options_in_force_from(OUT, OPTIONS_FILE_UO_ORIGIN, NULL);
- inform_extension *E;
- LOOP_OVER(E, inform_extension)
- IXInnards::index_options_in_force_from(OUT, EXTENSION_UO_ORIGIN, E);
- int nt = 0;
- use_option *uo;
- LOOP_OVER(uo, use_option) {
- if (uo->source_file_scoped) continue;
- if ((uo->option_used == FALSE) && (uo->minimum_setting_value < 0)) nt++;
- }
- if (nt > 0) {
- HTML_OPEN("p"); WRITE("Whereas these are not in force:"); HTML_CLOSE("p");
- HTML::open_indented_p(OUT, 2, "tight");
- LOOP_OVER(uo, use_option) {
- if (uo->source_file_scoped) continue;
- if ((uo->option_used == FALSE) && (uo->minimum_setting_value < 0)) {
- @;
- if (--nt > 0) WRITE(", ");
- }
- }
- HTML_CLOSE("p");
- }
-}
-
-@ =
- HTML_OPEN_WITH("span", "style=\"white-space:nowrap\";");
- TEMPORARY_TEXT(TEMP)
- WRITE_TO(TEMP, "Use %+W.", uo->name);
- PasteButtons::paste_text(OUT, TEMP);
- DISCARD_TEXT(TEMP)
- WRITE(" %+W", uo->name);
- HTML_CLOSE("span");
-
-@ =
-void IXInnards::index_options_in_force_from(OUTPUT_STREAM, int category, inform_extension *E) {
- int N = 0;
- use_option *uo;
- LOOP_OVER(uo, use_option) {
- if (uo->source_file_scoped) continue;
- if ((uo->option_used) && (uo->minimum_setting_value < 0) &&
- (NewUseOptions::uo_set_from(uo, category, E))) {
- if (N++ == 0) @;
- @;
- }
- }
- LOOP_OVER(uo, use_option) {
- if (uo->source_file_scoped) continue;
- if (((uo->option_used) && (uo->minimum_setting_value >= 0)) &&
- (NewUseOptions::uo_set_from(uo, category, E))) {
- if (N++ == 0) @;
- @;
- }
- }
-}
-
-@ =
- HTML::open_indented_p(OUT, 2, "tight");
- HTML::begin_colour(OUT, I"808080");
- WRITE("Set from ");
- switch (category) {
- case MAIN_TEXT_UO_ORIGIN:
- WRITE("the source text"); break;
- case OPTIONS_FILE_UO_ORIGIN:
- WRITE("the Options.txt configuration file");
- Index::DocReferences::link(OUT, I"OPTIONSFILE"); break;
- case EXTENSION_UO_ORIGIN:
- if (Extensions::is_standard(E)) WRITE("the ");
- else WRITE("the extension ");
- WRITE("%S", E->as_copy->edition->work->title);
- break;
- }
- WRITE(":");
- HTML::end_colour(OUT);
- HTML_CLOSE("p");
-
-@ =
- HTML::open_indented_p(OUT, 3, "tight");
- WRITE("Use %+W", uo->name);
- if (uo->minimum_setting_value >= 0) WRITE(" of at least %d", uo->minimum_setting_value);
- if (uo->where_used) Index::link(OUT, Wordings::first_wn(Node::get_text(uo->where_used)));
- if (uo->minimum_setting_value >= 0) {
- WRITE(" ");
- TEMPORARY_TEXT(TEMP)
- WRITE_TO(TEMP, "Use %+W of at least %d.", uo->name, 2*(uo->minimum_setting_value));
- PasteButtons::paste_text(OUT, TEMP);
- DISCARD_TEXT(TEMP)
- WRITE(" Double this");
- }
- HTML_CLOSE("p");
diff --git a/inform7/index-module/Contents.w b/inform7/index-module/Contents.w
index 550916df3..3935bd99d 100644
--- a/inform7/index-module/Contents.w
+++ b/inform7/index-module/Contents.w
@@ -20,7 +20,6 @@ Chapter 2: Indexing
Rules
Activities
Phrasebook Index
- Innards Element
Arithmetic Element
Chapter 3: Indexing for Plugins
diff --git a/inform7/runtime-module/Chapter 2/Compilation Units.w b/inform7/runtime-module/Chapter 2/Compilation Units.w
index 03738933d..58911aaa6 100644
--- a/inform7/runtime-module/Chapter 2/Compilation Units.w
+++ b/inform7/runtime-module/Chapter 2/Compilation Units.w
@@ -152,11 +152,10 @@ void CompilationUnits::complete_metadata(void) {
else owner = Extensions::corresponding_to(
Lexer::file_of_origin(Wordings::first_wn(Node::get_text(inc))));
if (owner) {
- compilation_unit *owner_C;
- LOOP_OVER(owner_C, compilation_unit)
- if (owner_C->extension == owner)
- Hierarchy::apply_metadata_from_iname(pack,
- EXT_INCLUDED_BY_MD_HL, owner_C->extension_id);
+ inter_name *owner_id = CompilationUnits::extension_id(owner);
+ if (owner_id)
+ Hierarchy::apply_metadata_from_iname(pack,
+ EXT_INCLUDED_BY_MD_HL, owner_id);
} else {
if (Lexer::word_location(Wordings::first_wn(Node::get_text(inc))).file_of_origin == NULL)
Hierarchy::apply_metadata_from_number(pack, EXT_AUTO_INCLUDED_MD_HL, 1);
@@ -168,6 +167,17 @@ void CompilationUnits::complete_metadata(void) {
}
}
+@ This is in principle slow, and in practice fast, and anyway little used.
+
+=
+inter_name *CompilationUnits::extension_id(inform_extension *owner) {
+ compilation_unit *owner_C;
+ LOOP_OVER(owner_C, compilation_unit)
+ if (owner_C->extension == owner)
+ return owner_C->extension_id;
+ return NULL;
+}
+
@h What unit a node belongs to.
We are going to need to determine, for any node |p|, which compilation unit it
belongs to. If there were a fast way to go up in the syntax tree, that would be
diff --git a/inform7/runtime-module/Chapter 2/Hierarchy.w b/inform7/runtime-module/Chapter 2/Hierarchy.w
index 65ae5afda..7ac8a91be 100644
--- a/inform7/runtime-module/Chapter 2/Hierarchy.w
+++ b/inform7/runtime-module/Chapter 2/Hierarchy.w
@@ -214,6 +214,10 @@ void Hierarchy::establish(void) {
@e MIN_NEGATIVE_NUMBER_HL
@e I7_VERSION_NUMBER_HL
@e I7_FULL_VERSION_NUMBER_HL
+@e VM_MD_HL
+@e VM_ICON_MD_HL
+@e LANGUAGE_ELEMENTS_USED_MD_HL
+@e LANGUAGE_ELEMENTS_NOT_USED_MD_HL
@e MEMORY_ECONOMY_MD_HL
@e MAX_INDEXED_FIGURES_HL
@e NO_TEST_SCENARIOS_HL
@@ -243,6 +247,9 @@ void Hierarchy::establish(void) {
@e HEADING_WORD_COUNT_MD_HL
@e HEADING_SUMMARY_MD_HL
@e HEADING_ID_HL
+@e DEBUGGING_ASPECTS_HAP
+@e DEBUGGING_ASPECT_NAME_MD_HL
+@e DEBUGGING_ASPECT_USED_MD_HL
@ =
submodule_identity *basics = Packaging::register_submodule(I"basics");
@@ -266,6 +273,10 @@ void Hierarchy::establish(void) {
H_BEGIN(HierarchyLocations::completion_submodule(I, basics))
H_C_T(I7_VERSION_NUMBER_HL, I"I7_VERSION_NUMBER")
H_C_T(I7_FULL_VERSION_NUMBER_HL, I"I7_FULL_VERSION_NUMBER")
+ H_C_T(VM_MD_HL, I"^virtual_machine")
+ H_C_T(VM_ICON_MD_HL, I"^virtual_machine_icon")
+ H_C_T(LANGUAGE_ELEMENTS_USED_MD_HL, I"^language_elements_used")
+ H_C_T(LANGUAGE_ELEMENTS_NOT_USED_MD_HL, I"^language_elements_not_used")
H_C_T(MEMORY_ECONOMY_MD_HL, I"^memory_economy")
H_C_T(MEMORY_HEAP_SIZE_HL, I"MEMORY_HEAP_SIZE")
H_C_T(KIT_CONFIGURATION_BITMAP_HL, I"KIT_CONFIGURATION_BITMAP")
@@ -289,6 +300,10 @@ void Hierarchy::establish(void) {
H_C_U(HEADING_SUMMARY_MD_HL, I"^summary")
H_C_U(HEADING_ID_HL, I"id")
H_END
+ H_BEGIN_AP(DEBUGGING_ASPECTS_HAP, I"debugging_aspect", I"_debugging_aspect")
+ H_C_U(DEBUGGING_ASPECT_NAME_MD_HL, I"^name")
+ H_C_U(DEBUGGING_ASPECT_USED_MD_HL, I"^used")
+ H_END
H_END
@h Modules.
@@ -1409,6 +1424,12 @@ void Hierarchy::establish(void) {
@e USE_OPTION_MD_HL
@e USE_OPTION_PNAME_MD_HL
@e USE_OPTION_ON_MD_HL
+@e USE_OPTION_USED_AT_MD_HL
+@e SOURCE_FILE_SCOPED_MD_HL
+@e USED_IN_SOURCE_TEXT_MD_HL
+@e USED_IN_OPTIONS_MD_HL
+@e USED_IN_EXTENSION_MD_HL
+@e USE_OPTION_MINIMUM_MD_HL
@e USE_OPTION_ID_HL
@ =
@@ -1416,9 +1437,15 @@ void Hierarchy::establish(void) {
H_BEGIN(HierarchyLocations::local_submodule(use_options))
H_BEGIN_AP(USE_OPTIONS_HAP, I"use_option", I"_use_option")
- H_C_U(USE_OPTION_MD_HL, I"^name")
- H_C_U(USE_OPTION_PNAME_MD_HL, I"^printed_name")
- H_C_U(USE_OPTION_ON_MD_HL, I"^active")
+ H_C_U(USE_OPTION_MD_HL, I"^name")
+ H_C_U(USE_OPTION_USED_AT_MD_HL, I"^at")
+ H_C_U(USE_OPTION_PNAME_MD_HL, I"^printed_name")
+ H_C_U(USE_OPTION_ON_MD_HL, I"^active")
+ H_C_U(SOURCE_FILE_SCOPED_MD_HL, I"^source_file_scoped")
+ H_C_U(USED_IN_SOURCE_TEXT_MD_HL, I"^used_in_source_text")
+ H_C_U(USED_IN_OPTIONS_MD_HL, I"^used_in_options")
+ H_C_U(USED_IN_EXTENSION_MD_HL, I"^used_in_extension")
+ H_C_U(USE_OPTION_MINIMUM_MD_HL, I"^minimum")
H_C_U(USE_OPTION_ID_HL, I"use_option_id")
H_END
H_END
diff --git a/inform7/runtime-module/Chapter 3/Completion Module.w b/inform7/runtime-module/Chapter 3/Completion Module.w
index 3e33eb477..c44cb7add 100644
--- a/inform7/runtime-module/Chapter 3/Completion Module.w
+++ b/inform7/runtime-module/Chapter 3/Completion Module.w
@@ -7,11 +7,14 @@ into a playable work.
void CompletionModule::compile(void) {
@;
@;
+ @;
+ @;
@;
@;
@;
@;
@;
+ @;
}
@ So, for example, these might be |10.1.0| and |10.1.0-alpha.1+6R84| respectively.
@@ -32,6 +35,36 @@ void CompletionModule::compile(void) {
Hierarchy::make_available(iname);
DISCARD_TEXT(svn)
+@ =
+ target_vm *VM = Supervisor::current_vm();
+ if (VM == NULL) internal_error("target VM not set yet");
+ TEMPORARY_TEXT(vm)
+ TEMPORARY_TEXT(icon)
+ ExtensionIndex::plot_icon(icon, VM);
+ TargetVMs::write(vm, VM);
+ inter_name *iname = Hierarchy::find(VM_MD_HL);
+ Emit::text_constant(iname, vm);
+ if (Str::len(VM->VM_image) > 0) {
+ inter_name *iname = Hierarchy::find(VM_ICON_MD_HL);
+ Emit::text_constant(iname, VM->VM_image);
+ }
+ DISCARD_TEXT(vm)
+ DISCARD_TEXT(icon)
+
+@ =
+ TEMPORARY_TEXT(inc)
+ TEMPORARY_TEXT(exc)
+ PluginManager::list_plugins(inc, TRUE);
+ PluginManager::list_plugins(exc, FALSE);
+ inter_name *iname = Hierarchy::find(LANGUAGE_ELEMENTS_USED_MD_HL);
+ Emit::text_constant(iname, inc);
+ if (Str::len(exc) > 0) {
+ inter_name *iname = Hierarchy::find(LANGUAGE_ELEMENTS_NOT_USED_MD_HL);
+ Emit::text_constant(iname, exc);
+ }
+ DISCARD_TEXT(inc)
+ DISCARD_TEXT(exc)
+
@ =
inter_name *iname = Hierarchy::find(MEMORY_ECONOMY_MD_HL);
if (global_compilation_settings.memory_economy_in_force)
@@ -54,6 +87,18 @@ void CompletionModule::compile(void) {
Emit::numeric_constant(iname,
(inter_ti) global_compilation_settings.index_figure_thumbnails);
+@ =
+ for (int i=0; iunhyphenated_name) > 0) {
+ package_request *pack = Hierarchy::completion_package(DEBUGGING_ASPECTS_HAP);
+ Hierarchy::apply_metadata(pack, DEBUGGING_ASPECT_NAME_MD_HL,
+ da->unhyphenated_name);
+ Hierarchy::apply_metadata_from_number(pack, DEBUGGING_ASPECT_USED_MD_HL,
+ (inter_ti) Log::aspect_switched_on(i));
+ }
+ }
+
@ =
typedef struct heading_compilation_data {
struct package_request *heading_package;
diff --git a/inform7/runtime-module/Chapter 3/Use Options.w b/inform7/runtime-module/Chapter 3/Use Options.w
index f97bb06b9..8cca36e7b 100644
--- a/inform7/runtime-module/Chapter 3/Use Options.w
+++ b/inform7/runtime-module/Chapter 3/Use Options.w
@@ -31,12 +31,31 @@ void RTUseOptions::compile(void) {
inter_name *set_iname = Hierarchy::make_iname_in(USE_OPTION_ON_MD_HL, R);
Emit::numeric_constant(set_iname, set);
Emit::numeric_constant(uo->compilation_data.uo_value, (inter_ti) 0);
+ Hierarchy::apply_metadata_from_raw_wording(R, USE_OPTION_MD_HL, uo->name);
TEMPORARY_TEXT(N)
WRITE_TO(N, "%W option", uo->name);
if (uo->minimum_setting_value > 0)
WRITE_TO(N, " [%d]", uo->minimum_setting_value);
Hierarchy::apply_metadata(R, USE_OPTION_PNAME_MD_HL, N);
DISCARD_TEXT(N)
+ Hierarchy::apply_metadata_from_number(R, SOURCE_FILE_SCOPED_MD_HL,
+ (inter_ti) uo->source_file_scoped);
+ if (uo->where_used)
+ Hierarchy::apply_metadata_from_number(R, USE_OPTION_USED_AT_MD_HL,
+ (inter_ti) Wordings::first_wn(Node::get_text(uo->where_used)));
+ source_file *sf = (uo->where_used)?
+ (Lexer::file_of_origin(Wordings::first_wn(Node::get_text(uo->where_used)))):NULL;
+ inform_extension *efo = (sf)?(Extensions::corresponding_to(sf)):NULL;
+ if ((sf) && (efo == NULL))
+ Hierarchy::apply_metadata_from_number(R, USED_IN_SOURCE_TEXT_MD_HL, 1);
+ else if (sf == NULL)
+ Hierarchy::apply_metadata_from_number(R, USED_IN_OPTIONS_MD_HL, 1);
+ else if (efo)
+ Hierarchy::apply_metadata_from_iname(R, USED_IN_EXTENSION_MD_HL,
+ CompilationUnits::extension_id(efo));
+ if (uo->minimum_setting_value >= 0)
+ Hierarchy::apply_metadata_from_number(R, USE_OPTION_MINIMUM_MD_HL,
+ (inter_ti) uo->minimum_setting_value);
}
@;
diff --git a/inter/codegen-module/Chapter 6/Index File Services.w b/inter/codegen-module/Chapter 6/Index File Services.w
index 2bf62f16a..834daa161 100644
--- a/inter/codegen-module/Chapter 6/Index File Services.w
+++ b/inter/codegen-module/Chapter 6/Index File Services.w
@@ -684,12 +684,16 @@ void Index::index_actual_element(OUTPUT_STREAM, text_stream *elt) {
StandardsElement::render(OUT);
return;
}
-
- #ifdef CORE_MODULE
- if (Str::eq_wide_string(elt, L"In")) {
- IXInnards::render(OUT, Supervisor::current_vm());
+ if (Str::eq_wide_string(elt, L"C")) {
+ ContentsElement::render(OUT);
return;
}
+ if (Str::eq_wide_string(elt, L"In")) {
+ InnardsElement::render(OUT);
+ return;
+ }
+
+ #ifdef CORE_MODULE
if (Str::eq_wide_string(elt, L"Pl")) {
IXScenes::render(OUT);
return;
@@ -702,11 +706,6 @@ void Index::index_actual_element(OUTPUT_STREAM, text_stream *elt) {
IXPhysicalWorld::render(OUT);
return;
}
- if (Str::eq_wide_string(elt, L"C")) {
- ContentsElement::render(OUT);
- return;
- }
-
if (Str::eq_wide_string(elt, L"Ph")) {
Phrases::Index::index_page_Phrasebook(OUT);
diff --git a/inter/codegen-module/Chapter 6/Innards Element.w b/inter/codegen-module/Chapter 6/Innards Element.w
new file mode 100644
index 000000000..e46f464a7
--- /dev/null
+++ b/inter/codegen-module/Chapter 6/Innards Element.w
@@ -0,0 +1,187 @@
+[InnardsElement::] Innards Element.
+
+To write the Innards element (In) in the index.
+
+@ Describing the current VM.
+
+=
+void InnardsElement::render(OUTPUT_STREAM) {
+ inter_tree *I = Index::get_tree();
+ tree_inventory *inv = Synoptic::inv(I);
+ TreeLists::sort(inv->use_option_nodes, Synoptic::module_order);
+
+ @;
+ @;
+
+ HTML_OPEN("p");
+ Index::extra_link(OUT, 3);
+ WRITE("See some technicalities for Inform maintainers only");
+ HTML_CLOSE("p");
+ Index::extra_div_open(OUT, 3, 2, "e0e0e0");
+ HTML_OPEN("p");
+ Index::anchor(OUT, I"CONFIG");
+ @;
+ @;
+ Index::extra_div_close(OUT, "e0e0e0");
+}
+
+@ =
+ Index::anchor(OUT, I"STORYFILE");
+ HTML_OPEN("p"); WRITE("Story file format: ");
+ inter_package *pack = Inter::Packages::by_url(I, I"/main/completion/basics");
+ text_stream *VM = Metadata::read_optional_textual(pack, I"^virtual_machine");
+ text_stream *VM_icon = Metadata::read_optional_textual(pack, I"^virtual_machine_icon");
+ if (Str::len(VM_icon) > 0) {
+ HTML_TAG_WITH("img", "border=0 src=inform:/doc_images/%S", VM_icon);
+ WRITE(" ");
+ }
+ if (Str::len(VM) > 0) WRITE("%S", VM);
+ HTML_CLOSE("p");
+
+@ =
+ HTML_OPEN("p"); WRITE("The following use options are in force:"); HTML_CLOSE("p");
+ InnardsElement::index_options_in_force_from(OUT, inv, MAIN_TEXT_UO_ORIGIN, NULL);
+ InnardsElement::index_options_in_force_from(OUT, inv, OPTIONS_FILE_UO_ORIGIN, NULL);
+ for (int i=0; imodule_nodes); i++) {
+ inter_package *E = Inter::Package::defined_by_frame(inv->module_nodes->list[i].node);
+ InnardsElement::index_options_in_force_from(OUT, inv, EXTENSION_UO_ORIGIN, E);
+ }
+ int c = 0;
+ HTML_OPEN("p"); WRITE("Whereas these are not in force:"); HTML_CLOSE("p");
+ HTML::open_indented_p(OUT, 2, "tight");
+ for (int i=0; iuse_option_nodes); i++) {
+ inter_package *pack = Inter::Package::defined_by_frame(inv->use_option_nodes->list[i].node);
+ inter_ti set = Metadata::read_numeric(pack, I"^active");
+ inter_ti sfs = Metadata::read_numeric(pack, I"^source_file_scoped");
+ if ((set == FALSE) && (sfs == FALSE)) {
+ @;
+ if (c++ > 0) WRITE(", ");
+ }
+ }
+ if (c == 0) WRITE("None."); /* in practice, this will never happen */
+ HTML_CLOSE("p");
+
+@ =
+ HTML_OPEN_WITH("span", "style=\"white-space:nowrap\";");
+ TEMPORARY_TEXT(TEMP)
+ WRITE_TO(TEMP, "Use %S.", Metadata::read_textual(pack, I"^name"));
+ PasteButtons::paste_text(OUT, TEMP);
+ DISCARD_TEXT(TEMP)
+ WRITE(" %S", Metadata::read_textual(pack, I"^name"));
+ HTML_CLOSE("span");
+
+@ =
+ WRITE("Inform language definition:\n");
+ inter_package *pack = Inter::Packages::by_url(I, I"/main/completion/basics");
+ text_stream *used = Metadata::read_optional_textual(pack, I"^language_elements_used");
+ text_stream *not_used = Metadata::read_optional_textual(pack, I"^language_elements_not_used");
+ if (Str::len(used) > 0) WRITE("Included: %S", used);
+ if (Str::len(not_used) > 0) WRITE("
Excluded: %S", not_used);
+ HTML_CLOSE("p");
+
+@ =
+ HTML_OPEN("p");
+ WRITE("Debugging log:");
+ HTML_CLOSE("p");
+ HTML_OPEN("p");
+ inter_symbol *wanted = PackageTypes::get(I, I"_debugging_aspect");
+ inter_package *pack = Inter::Packages::by_url(I, I"/main/completion/basics");
+ inter_tree_node *D = Inter::Packages::definition(pack);
+ LOOP_THROUGH_INTER_CHILDREN(C, D) {
+ if (C->W.data[ID_IFLD] == PACKAGE_IST) {
+ inter_package *entry = Inter::Package::defined_by_frame(C);
+ if (Inter::Packages::type(entry) == wanted) {
+ TEMPORARY_TEXT(is)
+ WRITE_TO(is, "Include %S in the debugging log.",
+ Metadata::read_textual(entry, I"^name"));
+ PasteButtons::paste_text(OUT, is);
+ WRITE(" %S ", is);
+ DISCARD_TEXT(is)
+ if (Metadata::read_optional_numeric(entry, I"^used")) {
+ HTML_TAG_WITH("img", "border=0 src=inform:/doc_images/tick.png");
+ } else {
+ HTML_TAG_WITH("img", "border=0 src=inform:/doc_images/cross.png");
+ }
+ HTML_TAG("br");
+ }
+ }
+ }
+ HTML_CLOSE("p");
+
+@ Now for indexing, where there's nothing much to see.
+
+@d MAIN_TEXT_UO_ORIGIN 1
+@d OPTIONS_FILE_UO_ORIGIN 2
+@d EXTENSION_UO_ORIGIN 3
+
+=
+void InnardsElement::index_options_in_force_from(OUTPUT_STREAM, tree_inventory *inv, int category, inter_package *E) {
+ int N = 0;
+ for (int i=0; iuse_option_nodes); i++) {
+ inter_package *pack = Inter::Package::defined_by_frame(inv->use_option_nodes->list[i].node);
+ inter_ti set = Metadata::read_numeric(pack, I"^active");
+ inter_ti sfs = Metadata::read_numeric(pack, I"^source_file_scoped");
+ if ((set) && (sfs == FALSE)) {
+ if (InnardsElement::uo_set_from(pack, category, E)) {
+ if (N++ == 0) @;
+ @;
+ }
+ }
+ }
+}
+
+@ And this is what the rest of Inform calls to find out whether a particular
+pragma is set:
+
+=
+int InnardsElement::uo_set_from(inter_package *pack, int category, inter_package *E) {
+ switch (category) {
+ case MAIN_TEXT_UO_ORIGIN: if (Metadata::read_optional_numeric(pack, I"^used_in_source_text")) return TRUE; break;
+ case OPTIONS_FILE_UO_ORIGIN: if (Metadata::read_optional_numeric(pack, I"^used_in_options")) return TRUE; break;
+ case EXTENSION_UO_ORIGIN: {
+ inter_symbol *id = Metadata::read_optional_symbol(pack, I"^used_in_extension");
+ if (id) {
+ inter_package *used_in_E = Inter::Packages::container(id->definition);
+ if ((used_in_E) && (used_in_E == E)) return TRUE;
+ }
+ break;
+ }
+ }
+ return FALSE;
+}
+
+@ =
+ HTML::open_indented_p(OUT, 2, "tight");
+ HTML::begin_colour(OUT, I"808080");
+ WRITE("Set from ");
+ switch (category) {
+ case MAIN_TEXT_UO_ORIGIN:
+ WRITE("the source text"); break;
+ case OPTIONS_FILE_UO_ORIGIN:
+ WRITE("the Options.txt configuration file, or automatically");
+ Index::DocReferences::link(OUT, I"OPTIONSFILE"); break;
+ case EXTENSION_UO_ORIGIN:
+ WRITE("%S", Metadata::read_optional_textual(E, I"^credit"));
+ break;
+ }
+ WRITE(":");
+ HTML::end_colour(OUT);
+ HTML_CLOSE("p");
+
+@ =
+ HTML::open_indented_p(OUT, 3, "tight");
+ WRITE("Use %S", Metadata::read_optional_textual(pack, I"^name"));
+ int msv = (int) Metadata::read_optional_numeric(pack, I"^minimum");
+ if (msv > 0) WRITE(" of at least %d", msv);
+ int at = (int) Metadata::read_optional_numeric(pack, I"^used_at");
+ if (at > 0) Index::link(OUT, at);
+ if (msv > 0) {
+ WRITE(" ");
+ TEMPORARY_TEXT(TEMP)
+ WRITE_TO(TEMP, "Use %S of at least %d.",
+ Metadata::read_optional_textual(pack, I"^name"), 2*msv);
+ PasteButtons::paste_text(OUT, TEMP);
+ DISCARD_TEXT(TEMP)
+ WRITE(" Double this");
+ }
+ HTML_CLOSE("p");
diff --git a/inter/codegen-module/Contents.w b/inter/codegen-module/Contents.w
index 024817a01..54e97ccd0 100644
--- a/inter/codegen-module/Contents.w
+++ b/inter/codegen-module/Contents.w
@@ -75,3 +75,4 @@ Chapter 6: Index
Rules for Scenes Element
Extras Element
Standards Element
+ Innards Element