From 0bc8db46e223348a76cee5adb165a1c73ba506e2 Mon Sep 17 00:00:00 2001
From: Graham Nelson
Date: Sat, 24 Jul 2021 18:16:56 +0100
Subject: [PATCH] Further index tidying
---
docs/index-module/2-fi.html | 84 ++--
docs/index-module/2-ir.html | 246 ++++------
docs/index-module/2-iu.html | 72 ++-
docs/index-module/2-lcl.html | 9 +-
docs/index-module/2-lxc.html | 9 +-
docs/index-module/3-ae.html | 6 +-
docs/index-module/3-ae2.html | 3 +-
docs/index-module/3-be.html | 6 +-
docs/index-module/3-ce.html | 2 +-
docs/index-module/3-ce2.html | 448 ++++++++----------
docs/index-module/3-ce3.html | 298 ++++++------
docs/index-module/3-ce4.html | 6 +-
docs/index-module/3-ee.html | 6 +-
docs/index-module/3-fe.html | 9 +-
docs/index-module/3-ge2.html | 93 ++--
docs/index-module/3-ie.html | 42 +-
docs/index-module/3-le.html | 2 +-
docs/index-module/3-me.html | 10 +-
docs/index-module/3-pe.html | 67 +--
docs/index-module/3-pe2.html | 58 +--
docs/index-module/3-re.html | 3 +-
docs/index-module/3-rfse.html | 2 +-
docs/index-module/3-te.html | 9 +-
docs/index-module/3-te2.html | 56 +--
docs/index-module/3-ve.html | 10 +-
docs/index-module/3-ve2.html | 5 +-
docs/index-module/4-rhm.html | 2 +-
inform7/Figures/memory-diagnostics.txt | 4 +-
inform7/Figures/timings-diagnostics.txt | 14 +-
inform7/Internal/Languages/English/Index.txt | 55 +++
.../_Results_Ideal/Index-Chart.txt | 47 +-
inter/bytecode-module/Chapter 2/Inter Trees.w | 20 +
inter/index-module/Chapter 2/Faux Instances.w | 84 ++--
inter/index-module/Chapter 2/Index Rules.w | 228 +++------
.../index-module/Chapter 2/Index Utilities.w | 27 ++
inter/index-module/Chapter 2/Lexicon.w | 7 +-
inter/index-module/Chapter 2/Localisation.w | 5 +-
.../Chapter 3/Alphabetic Element.w | 4 +-
.../Chapter 3/Arithmetic Element.w | 3 +-
.../Chapter 3/Behaviour Element.w | 6 +-
inter/index-module/Chapter 3/Chart Element.w | 290 +++++-------
.../index-module/Chapter 3/Commands Element.w | 279 ++++++-----
.../index-module/Chapter 3/Contents Element.w | 6 +-
inter/index-module/Chapter 3/Events Element.w | 6 +-
.../index-module/Chapter 3/Figures Element.w | 9 +-
.../index-module/Chapter 3/Grouped Element.w | 87 ++--
.../index-module/Chapter 3/Innards Element.w | 32 +-
.../Chapter 3/Phrasebook Element.w | 67 +--
inter/index-module/Chapter 3/Plot Element.w | 52 +-
.../Chapter 3/Relations Element.w | 3 +-
inter/index-module/Chapter 3/Tables Element.w | 3 +-
inter/index-module/Chapter 3/Tokens Element.w | 54 +--
inter/index-module/Chapter 3/Values Element.w | 6 +-
inter/index-module/Chapter 3/Verbs Element.w | 3 +-
54 files changed, 1328 insertions(+), 1636 deletions(-)
diff --git a/docs/index-module/2-fi.html b/docs/index-module/2-fi.html
index 6586777dd..3ffb4f2f3 100644
--- a/docs/index-module/2-fi.html
+++ b/docs/index-module/2-fi.html
@@ -405,52 +405,46 @@ and only if needed.
void FauxInstances::decode_hints ( faux_instance_set * faux_set , inter_tree * I , int pass ) {
inter_package * pack = Inter::Packages::by_url ( I , I "/main/completion/mapping_hints" );
- inter_symbol * wanted = PackageTypes::get ( I , I "_mapping_hint" );
- 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 ) {
- faux_instance * from = FauxInstances::xref ( faux_set , entry , I "^from" );
- faux_instance * to = FauxInstances::xref ( faux_set , entry , I "^to" );
- faux_instance * dir = FauxInstances::xref ( faux_set , entry , I "^dir" );
- faux_instance * as_dir = FauxInstances::xref ( faux_set , entry , I "^as_dir" );
- if (( dir ) && ( as_dir )) {
- if ( pass == 1 ) Decode a hint mapping one direction as if another 10.1 ;
- continue ;
- }
- if (( from ) && ( dir )) {
- if ( pass == 1 ) Decode a hint mapping one room in a specific direction from another 10.2 ;
- continue ;
- }
- text_stream * name = Metadata::read_optional_textual ( entry , I "^name" );
- if ( Str::len ( name ) > 0 ) {
- int scope_level = ( int ) Metadata::read_optional_numeric ( entry , I "^scope_level" );
- faux_instance * scope_I = FauxInstances::xref ( faux_set , entry , I "^scope_instance" );
- text_stream * text_val = Metadata::read_optional_textual ( entry , I "^text" );
- int int_val = ( int ) Metadata::read_optional_numeric ( entry , I "^number" );
- if ( scope_level != 1000000 ) {
- if ( pass == 2 ) Decode a hint setting EPS map parameters relating to levels 10.4 ;
- } else {
- if ( pass == 1 ) Decode a hint setting EPS map parameters 10.3 ;
- }
- continue ;
- }
- text_stream * annotation = Metadata::read_optional_textual ( entry , I "^annotation" );
- if ( Str::len ( annotation ) > 0 ) {
- if ( pass == 1 ) {
- rubric_holder * rh = CREATE ( rubric_holder );
- rh -> annotation = annotation ;
- rh -> point_size = ( int ) Metadata::read_optional_numeric ( entry , I "^point_size" );
- rh -> font = Metadata::read_optional_textual ( entry , I "^font" );
- rh -> colour = Metadata::read_optional_textual ( entry , I "^colour" );
- rh -> at_offset = ( int ) Metadata::read_optional_numeric ( entry , I "^offset" );
- rh -> offset_from = FauxInstances::xref ( faux_set , entry , I "^offset_from" );
- ADD_TO_LINKED_LIST ( rh , rubric_holder , faux_set -> rubrics );
- }
- continue ;
- }
+ inter_package * hint_pack ;
+ LOOP_THROUGH_SUBPACKAGES ( hint_pack , pack , I "_mapping_hint" ) {
+ faux_instance * from = FauxInstances::xref ( faux_set , hint_pack , I "^from" );
+ faux_instance * to = FauxInstances::xref ( faux_set , hint_pack , I "^to" );
+ faux_instance * dir = FauxInstances::xref ( faux_set , hint_pack , I "^dir" );
+ faux_instance * as_dir = FauxInstances::xref ( faux_set , hint_pack , I "^as_dir" );
+ if (( dir ) && ( as_dir )) {
+ if ( pass == 1 ) Decode a hint mapping one direction as if another 10.1 ;
+ continue ;
+ }
+ if (( from ) && ( dir )) {
+ if ( pass == 1 ) Decode a hint mapping one room in a specific direction from another 10.2 ;
+ continue ;
+ }
+ text_stream * name = Metadata::read_optional_textual ( hint_pack , I "^name" );
+ if ( Str::len ( name ) > 0 ) {
+ int scope_level = ( int ) Metadata::read_optional_numeric ( hint_pack , I "^scope_level" );
+ faux_instance * scope_I = FauxInstances::xref ( faux_set , hint_pack , I "^scope_instance" );
+ text_stream * text_val = Metadata::read_optional_textual ( hint_pack , I "^text" );
+ int int_val = ( int ) Metadata::read_optional_numeric ( hint_pack , I "^number" );
+ if ( scope_level != 1000000 ) {
+ if ( pass == 2 ) Decode a hint setting EPS map parameters relating to levels 10.4 ;
+ } else {
+ if ( pass == 1 ) Decode a hint setting EPS map parameters 10.3 ;
}
+ continue ;
+ }
+ text_stream * annotation = Metadata::read_optional_textual ( hint_pack , I "^annotation" );
+ if ( Str::len ( annotation ) > 0 ) {
+ if ( pass == 1 ) {
+ rubric_holder * rh = CREATE ( rubric_holder );
+ rh -> annotation = annotation ;
+ rh -> point_size = ( int ) Metadata::read_optional_numeric ( hint_pack , I "^point_size" );
+ rh -> font = Metadata::read_optional_textual ( hint_pack , I "^font" );
+ rh -> colour = Metadata::read_optional_textual ( hint_pack , I "^colour" );
+ rh -> at_offset = ( int ) Metadata::read_optional_numeric ( hint_pack , I "^offset" );
+ rh -> offset_from = FauxInstances::xref ( faux_set , hint_pack , I "^offset_from" );
+ ADD_TO_LINKED_LIST ( rh , rubric_holder , faux_set -> rubrics );
+ }
+ continue ;
}
}
}
diff --git a/docs/index-module/2-ir.html b/docs/index-module/2-ir.html
index 90ad3d217..8e12ddf45 100644
--- a/docs/index-module/2-ir.html
+++ b/docs/index-module/2-ir.html
@@ -159,17 +159,11 @@ with an
if ( rule_pack == NULL ) return FALSE ;
if ( rc . action_context ) {
int passes = FALSE ;
- inter_symbol * wanted = PackageTypes::get ( I , I "_relevant_action" );
- inter_tree_node * D = Inter::Packages::definition ( rule_pack );
- LOOP_THROUGH_INTER_CHILDREN ( C , D ) {
- if ( C -> W . data [ ID_IFLD ] == PACKAGE_IST ) {
- inter_package * rel_pack = Inter::Package::defined_by_frame ( C );
- if ( Inter::Packages::type ( rel_pack ) == wanted ) {
- inter_symbol * act_ds = Metadata::read_symbol ( rel_pack , I "^action" );
- if ( Inter::Packages::container ( act_ds -> definition ) == rc . action_context )
- passes = TRUE ;
- }
- }
+ inter_package * rel_pack ;
+ LOOP_THROUGH_SUBPACKAGES ( rel_pack , rule_pack , I "_relevant_action" ) {
+ inter_symbol * act_ds = Metadata::read_symbol ( rel_pack , I "^action" );
+ if ( Inter::Packages::container ( act_ds -> definition ) == rc . action_context )
+ passes = TRUE ;
}
if ( passes == FALSE ) return FALSE ;
}
@@ -189,16 +183,10 @@ no rules which fit
diff --git a/docs/index-module/2-iu.html b/docs/index-module/2-iu.html
index 8c51bae8e..458db7e70 100644
--- a/docs/index-module/2-iu.html
+++ b/docs/index-module/2-iu.html
@@ -72,7 +72,7 @@ function togglePopup(material_id) {
Miscellaneous utility functions for producing index content.
-
+
-void IndexUtilities::link ( OUTPUT_STREAM , int wn ) {
+void IndexUtilities::link ( OUTPUT_STREAM , int wn ) {
IndexUtilities::link_to_location ( OUT , Lexer::word_location ( wn ), TRUE );
}
+void IndexUtilities::link_package ( OUTPUT_STREAM , inter_package * pack ) {
+ int at = ( int ) Metadata::read_optional_numeric ( pack , I "^at" );
+ if ( at > 0 ) IndexUtilities::link ( OUT , at );
+}
+
void IndexUtilities::link_location ( OUTPUT_STREAM , source_location sl ) {
IndexUtilities::link_to_location ( OUT , sl , TRUE );
}
@@ -174,66 +179,77 @@ the source text in the application.
SourceLinks::link ( OUT , sl , nonbreaking_space );
}
-
+
+
+void IndexUtilities::link_to_documentation ( OUTPUT_STREAM , inter_package * pack ) {
+ text_stream * doc = Metadata::read_optional_textual ( pack , I "^documentation" );
+ if ( Str::len ( doc ) > 0 ) IndexUtilities::DocReferences::link ( OUT , doc );
+}
+
+
-void IndexUtilities::detail_link ( OUTPUT_STREAM , char * stub , int sub , int down ) {
+void IndexUtilities::detail_link ( OUTPUT_STREAM , char * stub , int sub , int down ) {
WRITE ( " " );
HTML_OPEN_WITH ( "a" , "href=%s%d_%s.html" , ( down )? "Details/" : "" , sub , stub );
HTML_TAG_WITH ( "img" , "border=0 src=inform:/doc_images/Beneath.png" );
HTML_CLOSE ( "a" );
}
-
-void IndexUtilities::below_link ( OUTPUT_STREAM , text_stream * p ) {
+void IndexUtilities::below_link ( OUTPUT_STREAM , text_stream * p ) {
WRITE ( " " );
HTML_OPEN_WITH ( "a" , "href=#%S" , p );
HTML_TAG_WITH ( "img" , "border=0 src=inform:/doc_images/Below.png" );
HTML_CLOSE ( "a" );
}
-void IndexUtilities::anchor ( OUTPUT_STREAM , text_stream * p ) {
+void IndexUtilities::anchor ( OUTPUT_STREAM , text_stream * p ) {
HTML_OPEN_WITH ( "a" , "name=%S" , p ); HTML_CLOSE ( "a" );
}
-void IndexUtilities::below_link_numbered ( OUTPUT_STREAM , int n ) {
+void IndexUtilities::below_link_numbered ( OUTPUT_STREAM , int n ) {
WRITE ( " " );
HTML_OPEN_WITH ( "a" , "href=#A%d" , n );
HTML_TAG_WITH ( "img" , "border=0 src=inform:/doc_images/Below.png" );
HTML_CLOSE ( "a" );
}
-void IndexUtilities::anchor_numbered ( OUTPUT_STREAM , int n ) {
+void IndexUtilities::anchor_numbered ( OUTPUT_STREAM , int n ) {
HTML_OPEN_WITH ( "a" , "name=A%d" , n ); HTML_CLOSE ( "a" );
}
-
+
-void IndexUtilities::extra_link ( OUTPUT_STREAM , int id ) {
+void IndexUtilities::extra_link ( OUTPUT_STREAM , int id ) {
HTML_OPEN_WITH ( "a" , "href=\"#\" onclick=\"showExtra('extra%d', 'plus%d'); return false;\"" , id , id );
HTML_TAG_WITH ( "img" , "border=0 id=\"plus%d\" src=inform:/doc_images/extra.png" , id );
HTML_CLOSE ( "a" );
WRITE ( " " );
}
-void IndexUtilities::extra_all_link_with ( OUTPUT_STREAM , int nr , char * icon ) {
+void IndexUtilities::extra_all_link_with ( OUTPUT_STREAM , int nr , char * icon ) {
HTML_OPEN_WITH ( "a" , "href=\"#\" onclick=\"showAllResp(%d); return false;\"" , nr );
HTML_TAG_WITH ( "img" , "border=0 src=inform:/doc_images/%s.png" , icon );
HTML_CLOSE ( "a" );
WRITE ( " " );
}
-void IndexUtilities::extra_link_with ( OUTPUT_STREAM , int id , char * icon ) {
+void IndexUtilities::extra_link_with ( OUTPUT_STREAM , int id , char * icon ) {
HTML_OPEN_WITH ( "a" , "href=\"#\" onclick=\"showResp('extra%d', 'plus%d'); return false;\"" , id , id );
HTML_TAG_WITH ( "img" , "border=0 id=\"plus%d\" src=inform:/doc_images/%s.png" , id , icon );
HTML_CLOSE ( "a" );
@@ -245,33 +261,33 @@ code.
WRITE ( " " );
}
-
-void IndexUtilities::extra_div_open ( OUTPUT_STREAM , int id , int indent , char * colour ) {
+void IndexUtilities::extra_div_open ( OUTPUT_STREAM , int id , int indent , char * colour ) {
HTML_OPEN_WITH ( "div" , "id=\"extra%d\" style=\"display: none;\"" , id );
HTML::open_indented_p ( OUT , indent , "" );
HTML::open_coloured_box ( OUT , colour , ROUND_BOX_TOP + ROUND_BOX_BOTTOM );
}
-void IndexUtilities::extra_div_close ( OUTPUT_STREAM , char * colour ) {
+void IndexUtilities::extra_div_close ( OUTPUT_STREAM , char * colour ) {
HTML::close_coloured_box ( OUT , colour , ROUND_BOX_TOP + ROUND_BOX_BOTTOM );
HTML_CLOSE ( "p" );
HTML_CLOSE ( "div" );
}
-void IndexUtilities::extra_div_open_nested ( OUTPUT_STREAM , int id , int indent ) {
+void IndexUtilities::extra_div_open_nested ( OUTPUT_STREAM , int id , int indent ) {
HTML_OPEN_WITH ( "div" , "id=\"extra%d\" style=\"display: none;\"" , id );
HTML::open_indented_p ( OUT , indent , "" );
}
-void IndexUtilities::extra_div_close_nested ( OUTPUT_STREAM ) {
+void IndexUtilities::extra_div_close_nested ( OUTPUT_STREAM ) {
HTML_CLOSE ( "p" );
HTML_CLOSE ( "div" );
}
-
+
void IndexUtilities::deprecation_icon ( OUTPUT_STREAM , int id ) {
@@ -281,7 +297,7 @@ code.
WRITE ( " " );
}
-
@@ -298,12 +314,12 @@ quotes.
}
}
-
-void IndexUtilities::show_definition_area ( OUTPUT_STREAM , inter_package * heading_pack ,
+void IndexUtilities::show_definition_area ( OUTPUT_STREAM , inter_package * heading_pack ,
int show_if_unhyphenated ) {
inter_ti parts = Metadata::read_optional_numeric ( heading_pack , I "^parts" );
if (( parts == 1 ) && ( show_if_unhyphenated == FALSE )) return ;
@@ -319,6 +335,18 @@ see the Phrasebook element for examples of how this comes out.
HTML_TAG ( "br" );
}
+
+
+
+void IndexUtilities::kind_name ( OUTPUT_STREAM , inter_package * pack , int plural ,
+ int with_links ) {
+ if ( pack == NULL ) return ;
+ text_stream * key = ( plural )? I "^index_plural" : I "^index_singular" ;
+ WRITE ( "%S" , Metadata::read_optional_textual ( pack , key ));
+ if ( with_links ) IndexUtilities::link_package ( OUT , pack );
+}
+
diff --git a/docs/index-module/2-lcl.html b/docs/index-module/2-lcl.html
index 44a5c9ad9..ad71ecf8b 100644
--- a/docs/index-module/2-lcl.html
+++ b/docs/index-module/2-lcl.html
@@ -288,8 +288,11 @@ with everything under the first line being italicised. For example:
How this project might be filed in a library
catalogue.|About the Library Card<LCARDS>; About IFIDs<IFIDS>
+
+
-void Localisation::write_0 ( OUTPUT_STREAM , localisation_dictionary * D , text_stream * key ) {
+void Localisation::write_0 ( OUTPUT_STREAM , localisation_dictionary * D , text_stream * key ) {
text_stream * vals [10];
Vacate the vals 5.1 ;
Localisation::write_general ( OUT , D , key , vals );
@@ -346,7 +349,9 @@ with everything under the first line being italicised. For example:
i ++;
while (( i < Str::len ( prototype )) && ( Str::get_at ( prototype , i ) != '>' ))
PUT_TO ( link , Str::get_at ( prototype , i ++));
- IndexUtilities::DocReferences::link ( OUT , link );
+ if ( Characters::isupper ( Str::get_at ( link , 0 )))
+ IndexUtilities::DocReferences::link ( OUT , link );
+ else WRITE ( "<%S>" , link );
DISCARD_TEXT ( link )
break ;
}
diff --git a/docs/index-module/2-lxc.html b/docs/index-module/2-lxc.html
index 831bc9532..b016e460d 100644
--- a/docs/index-module/2-lxc.html
+++ b/docs/index-module/2-lxc.html
@@ -406,15 +406,12 @@ source text: so any single link would be potentially misleading.
switch ( lex -> part_of_speech ) {
- case COMMON_NOUN_TLEXE: {
- text_stream * ref =
- Metadata::read_optional_textual ( lex -> lex_package , I "^documentation" );
- if ( Str::len ( ref ) > 0 ) IndexUtilities::DocReferences::link ( OUT , ref );
+ case COMMON_NOUN_TLEXE:
+ IndexUtilities::link_to_documentation ( OUT , lex -> lex_package );
break ;
- }
case VERB_TLEXE:
case PREP_TLEXE:
- IndexUtilities::below_link_numbered ( OUT , 10000 + verb_count ++);
+ IndexUtilities::below_link_numbered ( OUT , 10000 + verb_count ++);
break ;
}
if (( lex -> part_of_speech != ADJECTIVAL_PHRASE_TLEXE ) && ( lex -> link_to > 0 ))
diff --git a/docs/index-module/3-ae.html b/docs/index-module/3-ae.html
index b53f594e0..8df092921 100644
--- a/docs/index-module/3-ae.html
+++ b/docs/index-module/3-ae.html
@@ -118,7 +118,7 @@ function togglePopup(material_id) {
if ( oow ) HTML::begin_colour ( OUT , I "800000" );
WRITE ( "%S" , Metadata::read_optional_textual ( an_pack , I "^name" ));
if ( oow ) HTML::end_colour ( OUT );
- IndexUtilities::detail_link ( OUT , "A" , i , TRUE );
+ IndexUtilities::detail_link ( OUT , "A" , i , TRUE );
if ( requires_light ) AlphabeticElement::note ( OUT , I "Light" , LD );
@@ -132,7 +132,7 @@ function togglePopup(material_id) {
if ( noun_access == REQUIRES_ACCESS ) AlphabeticElement::note ( OUT , I "Touchable" , LD );
if ( noun_access == REQUIRES_POSSESSION ) AlphabeticElement::note ( OUT , I "Carried" , LD );
WRITE ( "<b>" );
- ChartElement::index_kind ( OUT , Inter::Packages::container ( noun_kind -> definition ), FALSE , FALSE );
+ IndexUtilities::kind_name ( OUT , Inter::Packages::container ( noun_kind -> definition ), FALSE , FALSE );
WRITE ( "</b>" );
}
@@ -147,7 +147,7 @@ function togglePopup(material_id) {
if ( second_access == REQUIRES_ACCESS ) AlphabeticElement::note ( OUT , I "Touchable" , LD );
if ( second_access == REQUIRES_POSSESSION ) AlphabeticElement::note ( OUT , I "Carried" , LD );
WRITE ( "<b>" );
- ChartElement::index_kind ( OUT , Inter::Packages::container ( second_kind -> definition ), FALSE , FALSE );
+ IndexUtilities::kind_name ( OUT , Inter::Packages::container ( second_kind -> definition ), FALSE , FALSE );
WRITE ( "</b>" );
}
diff --git a/docs/index-module/3-ae2.html b/docs/index-module/3-ae2.html
index 33da4807a..2bc274450 100644
--- a/docs/index-module/3-ae2.html
+++ b/docs/index-module/3-ae2.html
@@ -171,8 +171,7 @@ text, sorted into kind order of left and then right operand.
inter_package * pack =
Inter::Package::defined_by_frame ( inv -> multiplication_rule_nodes -> list [ i ]. node );
HTML::first_html_column ( OUT , 0 );
- int at = ( int ) Metadata::read_optional_numeric ( pack , I "^at" );
- if ( at > 0 ) IndexUtilities::link ( OUT , at );
+ IndexUtilities::link_package ( OUT , pack );
HTML::next_html_column ( OUT , 0 );
WRITE ( "%S" , Metadata::read_optional_textual ( pack , I "^left_operand" ));
HTML::begin_colour ( OUT , I "808080" );
diff --git a/docs/index-module/3-be.html b/docs/index-module/3-be.html
index 3fd20af5d..f455765f1 100644
--- a/docs/index-module/3-be.html
+++ b/docs/index-module/3-be.html
@@ -92,9 +92,8 @@ function togglePopup(material_id) {
inter_package * pack =
Inter::Package::defined_by_frame ( inv -> named_action_pattern_nodes -> list [ i ]. node );
text_stream * name = Metadata::read_optional_textual ( pack , I "^name" );
- int at = ( int ) Metadata::read_optional_numeric ( pack , I "^at" );
HTML_OPEN ( "p" ); WRITE ( "<b>%S</b>" , name );
- IndexUtilities::link ( OUT , at );
+ IndexUtilities::link_package ( OUT , pack );
HTML_TAG ( "br" );
WRITE ( " <i>" );
Localisation::write_0 ( OUT , LD , I "Index.Elements.Bh.Defined" );
@@ -108,8 +107,7 @@ function togglePopup(material_id) {
text_stream * text = Metadata::read_optional_textual ( entry , I "^text" );
HTML_TAG ( "br" );
WRITE ( " %S" , text );
- int at = ( int ) Metadata::read_optional_numeric ( entry , I "^at" );
- IndexUtilities::link ( OUT , at );
+ IndexUtilities::link_package ( OUT , entry );
}
}
}
diff --git a/docs/index-module/3-ce.html b/docs/index-module/3-ce.html
index 3d5dfbd94..bde62d32d 100644
--- a/docs/index-module/3-ce.html
+++ b/docs/index-module/3-ce.html
@@ -83,7 +83,7 @@ simplified form of the iFiction record, without the XML overhead.
inter_package * pack = Inter::Packages::by_url ( I , I "/main/completion/bibliographic" );
HTML_OPEN ( "p" );
- IndexUtilities::anchor ( OUT , I "LCARD" );
+ IndexUtilities::anchor ( OUT , I "LCARD" );
HTML::begin_html_table ( OUT , "*bg_images/indexcard.png" , FALSE , 0 , 3 , 3 , 0 , 0 );
CardElement::Library_Card_entry ( OUT , "Story title" , pack , I "^title" , I "Untitled" );
CardElement::Library_Card_entry ( OUT , "Story author" , pack , I "^author" , I "Anonymous" );
diff --git a/docs/index-module/3-ce2.html b/docs/index-module/3-ce2.html
index e325ecd40..7e8610b74 100644
--- a/docs/index-module/3-ce2.html
+++ b/docs/index-module/3-ce2.html
@@ -72,28 +72,33 @@ function togglePopup(material_id) {
To write the Chart element (Ch) in the index.
-
+
-
+
-void ChartElement::render ( OUTPUT_STREAM , localisation_dictionary * LD ) {
+void ChartElement::render ( OUTPUT_STREAM , localisation_dictionary * D ) {
inter_tree * I = InterpretIndex::get_tree ();
tree_inventory * inv = Synoptic::inv ( I );
TreeLists::sort ( inv -> kind_nodes , Synoptic::module_order );
TreeLists::sort ( inv -> instance_nodes , Synoptic::module_order );
- ChartElement::index_kinds ( OUT , inv , 1 );
- ChartElement::index_kinds ( OUT , inv , 2 );
+ HTML::begin_wide_html_table ( OUT );
+ int pass = 1 ;
+ Add a dotty row to the chart of kinds 1.3 ;
+ Add a titling row to the chart of kinds 1.2 ;
+ Add a dotty row to the chart of kinds 1.3 ;
+ Add the rubric below the chart of kinds 1.4 ;
+ Run through the kinds in priority order 1.1 ;
+ Add a dotty row to the chart of kinds 1.3 ;
+ HTML::end_html_table ( OUT );
+ pass = 2 ;
+ Run through the kinds in priority order 1.1 ;
+ Explain about covariance and contravariance 1.5 ;
}
-
-
-define LOWEST_INDEX_PRIORITY 100
-
-void ChartElement::index_kinds ( OUTPUT_STREAM , tree_inventory * inv , int pass ) {
- int priority ;
- if ( pass == 1 ) {
- HTML_OPEN ( "p" ); HTML_CLOSE ( "p" );
- HTML::begin_wide_html_table ( OUT );
- Add a dotty row to the chart of kinds 2.4 ;
- Add a titling row to the chart of kinds 2.2 ;
- Add a dotty row to the chart of kinds 2.4 ;
- Add the rubric below the chart of kinds 2.6 ;
- }
+
- for ( priority = 1 ; priority <= LOWEST_INDEX_PRIORITY ; priority ++) {
+
+ for ( int priority = 1 ; priority <= LOWEST_INDEX_PRIORITY ; priority ++) {
for ( int i =0; i <TreeLists::len(inv-> kind_nodes ); i ++) {
inter_package * pack = Inter::Package::defined_by_frame ( inv -> kind_nodes -> list [ i ]. node );
if (( Metadata::read_optional_numeric ( pack , I "^is_base" )) &&
( Metadata::read_optional_numeric ( pack , I "^is_subkind_of_object" ) == 0 ) &&
( priority == ( int ) Metadata::read_optional_numeric ( pack , I "^index_priority" ))) {
if (( priority == 8 ) || ( Metadata::read_optional_numeric ( pack , I "^is_definite" ))) {
- switch ( pass ) {
- case 1 : Write table row for this kind 2.5 ; break ;
- case 2 : {
- Write heading for the detailed index entry for this kind 2.7 ;
- HTML::open_indented_p ( OUT , 1 , "tight" );
- Index kinds of kinds matched by this kind 2.9 ;
- Index explanatory text supplied for a kind 2.11 ;
- Index literal patterns which can specify this kind 2.8 ;
- Index possible values of an enumerated kind 2.10 ;
- HTML_CLOSE ( "p" );
- break ;
- }
- }
- if ( Str::eq ( Metadata::read_textual ( pack , I "^printed_name" ), I "object" ))
- Recurse to index subkinds of object 2.1 ;
+ Index this kind package 1.1.2 ;
}
}
}
if (( priority == 1 ) || ( priority == 6 ) || ( priority == 7 )) {
if ( pass == 1 ) {
- Add a dotty row to the chart of kinds 2.4 ;
+ Add a dotty row to the chart of kinds 1.3 ;
if ( priority == 7 ) {
- Add a second titling row to the chart of kinds 2.3 ;
- Add a dotty row to the chart of kinds 2.4 ;
+ Add a second titling row to the chart of kinds 1.1.1 ;
+ Add a dotty row to the chart of kinds 1.3 ;
}
} else HTML_TAG ( "hr" );
}
}
-
- if ( pass == 1 ) {
- Add a dotty row to the chart of kinds 2.4 ;
- HTML::end_html_table ( OUT );
- } else {
- Explain about covariance and contravariance 2.12 ;
- }
-}
- This code is used in §1 (twice).
+
-
- ChartElement::index_subkinds ( OUT , inv , pack , 2 , pass );
-
-
-
-
-
HTML::first_html_column_nowrap ( OUT , 0 , "#e0e0e0" );
- WRITE ( "<b>basic kinds</b>" );
- ChartElement::index_kind_col_head ( OUT , "default value" , "default" );
- ChartElement::index_kind_col_head ( OUT , "repeat" , "repeat" );
- ChartElement::index_kind_col_head ( OUT , "props" , "props" );
- ChartElement::index_kind_col_head ( OUT , "under" , "under" );
+ WRITE ( "<b>" );
+ Localisation::write_0 ( OUT , D , I "Index.Elements.Ch.BasicKinds" );
+ WRITE ( "</b>" );
+ ChartElement::index_kind_col_head ( OUT , I "Index.Elements.Ch.DefaultColumn" , "default" , D );
+ ChartElement::index_kind_col_head ( OUT , I "Index.Elements.Ch.RepeatColumn" , "repeat" , D );
+ ChartElement::index_kind_col_head ( OUT , I "Index.Elements.Ch.PropsColumn" , "props" , D );
+ ChartElement::index_kind_col_head ( OUT , I "Index.Elements.Ch.UnderColumn" , "under" , D );
HTML::end_html_row ( OUT );
-
-
+
-
HTML::first_html_column_nowrap ( OUT , 0 , "#e0e0e0" );
- WRITE ( "<b>making new kinds from old</b>" );
- ChartElement::index_kind_col_head ( OUT , "default value" , "default" );
- ChartElement::index_kind_col_head ( OUT , "" , NULL );
- ChartElement::index_kind_col_head ( OUT , "" , NULL );
- ChartElement::index_kind_col_head ( OUT , "" , NULL );
+ WRITE ( "<b>" );
+ Localisation::write_0 ( OUT , D , I "Index.Elements.Ch.NewKinds" );
+ WRITE ( "</b>" );
+ ChartElement::index_kind_col_head ( OUT , I "Index.Elements.Ch.DefaultColumn" , "default" , D );
+ ChartElement::index_kind_col_head ( OUT , NULL , NULL , D );
+ ChartElement::index_kind_col_head ( OUT , NULL , NULL , D );
+ ChartElement::index_kind_col_head ( OUT , NULL , NULL , D );
HTML::end_html_row ( OUT );
-
-This code is used in §1.1 .
+
-
@@ -210,96 +183,90 @@ higher up, but kinds with priority 0 do not appear in the index at all.
HTML_CLOSE ( "td" );
HTML_CLOSE ( "tr" );
-This code is used in §2 (five times).
-
-
-
-
-
- char * repeat = "cross" , * props = "cross" , * under = "cross" ;
- int shaded = FALSE ;
- if ( Metadata::read_optional_numeric ( pack , I "^shaded_in_index" )) shaded = TRUE ;
- if ( Metadata::read_optional_numeric ( pack , I "^finite_domain" )) repeat = "tick" ;
- if ( Metadata::read_optional_numeric ( pack , I "^has_properties" )) props = "tick" ;
- if ( Metadata::read_optional_numeric ( pack , I "^understandable" )) under = "tick" ;
- if ( priority == 8 ) { repeat = NULL ; props = NULL ; under = NULL ; }
- ChartElement::begin_chart_row ( OUT );
- ChartElement::index_kind_name_cell ( OUT , shaded , pack );
- ChartElement::end_chart_row ( OUT , shaded , pack , repeat , props , under );
-
-
-This code is used in §1 (three times), §1.1 (twice).
+
-
HTML_OPEN_WITH ( "tr" , "style=\"display:none\" id=\"default\"" );
HTML_OPEN_WITH ( "td" , "colspan=\"5\"" );
- WRITE ( "The <b>default value</b> is used when we make something like "
- "a variable but don't tell Inform what its value is. For instance, if "
- "we write 'Zero hour is a time that varies', but don't tell Inform "
- "anything specific like 'Zero hour is 11:21 PM.', then Inform uses "
- "the value in the table above to decide what it will be. "
- "The same applies if we create a property (for instance, 'A person "
- "has a number called lucky number.'). Kinds of value not included "
- "in the table cannot be used in variables and properties." );
+ Localisation::write_0 ( OUT , D , I "Index.Elements.Ch.DefaultGloss" );
HTML_TAG ( "hr" );
HTML_CLOSE ( "td" );
HTML_CLOSE ( "tr" );
HTML_OPEN_WITH ( "tr" , "style=\"display:none\" id=\"repeat\"" );
HTML_OPEN_WITH ( "td" , "colspan=\"5\"" );
- WRITE ( "A tick for <b>repeat</b> means that it's possible to "
- "repeat through values of this kind. For instance, 'repeat with T "
- "running through times:' is allowed, but 'repeat with N running "
- "through numbers:' is not - there are too many numbers for this to "
- "make sense. A tick here also means it's possible to form lists such "
- "as 'list of rulebooks', or to count the 'number of scenes'." );
+ Localisation::write_0 ( OUT , D , I "Index.Elements.Ch.RepeatGloss" );
HTML_TAG ( "hr" );
HTML_CLOSE ( "td" );
HTML_CLOSE ( "tr" );
HTML_OPEN_WITH ( "tr" , "style=\"display:none\" id=\"props\"" );
HTML_OPEN_WITH ( "td" , "colspan=\"5\"" );
- WRITE ( "A tick for <b>props</b> means that values of this "
- "kind can have properties. For instance, 'A scene can be thrilling or "
- "dull.' makes an either/or property of a scene, but 'A number can be "
- "nice or nasty.' is not allowed because it would cost too much storage "
- "space. (Of course 'Definition:' can always be used to make adjectives "
- "applying to numbers; it's only properties which have storage "
- "worries.)" );
+ Localisation::write_0 ( OUT , D , I "Index.Elements.Ch.PropsGloss" );
HTML_TAG ( "hr" );
HTML_CLOSE ( "td" );
HTML_CLOSE ( "tr" );
HTML_OPEN_WITH ( "tr" , "style=\"display:none\" id=\"under\"" );
HTML_OPEN_WITH ( "td" , "colspan=\"5\"" );
- WRITE ( "A tick for <b>under</b> means that it's possible "
- "to understand values of this kind. For instance, 'Understand \"award "
- "[number]\" as awarding.' might be allowed, if awarding were an action "
- "applying to a number, but 'Understand \"run [rule]\" as rule-running.' "
- "is not allowed - there are so many rules with such long names that "
- "Inform doesn't add them to its vocabulary during play." );
+ Localisation::write_0 ( OUT , D , I "Index.Elements.Ch.UnderGloss" );
HTML_TAG ( "hr" );
HTML_CLOSE ( "td" );
HTML_CLOSE ( "tr" );
-
-
+
-
+
+
+ switch ( pass ) {
+ case 1 : {
+ char * repeat = "cross" , * props = "cross" , * under = "cross" ;
+ int shaded = FALSE ;
+ if ( Metadata::read_optional_numeric ( pack , I "^shaded_in_index" )) shaded = TRUE ;
+ if ( Metadata::read_optional_numeric ( pack , I "^finite_domain" )) repeat = "tick" ;
+ if ( Metadata::read_optional_numeric ( pack , I "^has_properties" )) props = "tick" ;
+ if ( Metadata::read_optional_numeric ( pack , I "^understandable" )) under = "tick" ;
+ if ( priority == 8 ) { repeat = NULL ; props = NULL ; under = NULL ; }
+ ChartElement::begin_chart_row ( OUT );
+ ChartElement::index_kind_name_cell ( OUT , shaded , pack );
+ ChartElement::end_chart_row ( OUT , shaded , pack , repeat , props , under );
+ break ;
+ }
+ case 2 : {
+ Write heading for the detailed index entry for this kind 1.1.2.1 ;
+ HTML::open_indented_p ( OUT , 1 , "tight" );
+ Index kinds of kinds matched by this kind 1.1.2.3 ;
+ Index explanatory text supplied for a kind 1.1.2.5 ;
+ Index literal patterns which can specify this kind 1.1.2.2 ;
+ Index possible values of an enumerated kind 1.1.2.4 ;
+ HTML_CLOSE ( "p" );
+ break ;
+ }
+ }
+ if ( Str::eq ( Metadata::read_textual ( pack , I "^printed_name" ), I "object" ))
+ ChartElement::index_subkinds ( OUT , inv , pack , 2 , pass , D );
+
+This code is used in §1.1 .
+
HTML::open_indented_p ( OUT , 1 , "halftight" );
- IndexUtilities::anchor_numbered ( OUT , i );
- WRITE ( "<b>" ); ChartElement::index_kind ( OUT , pack , FALSE , TRUE ); WRITE ( "</b>" );
- WRITE ( " (<i>plural</i> " ); ChartElement::index_kind ( OUT , pack , TRUE , FALSE ); WRITE ( ")" );
- text_stream * doc_ref = Metadata::read_optional_textual ( pack , I "^documentation" );
- if ( Str::len ( doc_ref ) > 0 ) IndexUtilities::DocReferences::link ( OUT , doc_ref );
+ IndexUtilities::anchor_numbered ( OUT , i );
+ WRITE ( "<b>" ); IndexUtilities::kind_name ( OUT , pack , FALSE , TRUE ); WRITE ( "</b>" );
+ WRITE ( " (<i>" );
+ Localisation::write_0 ( OUT , D , I "Index.Elements.Ch.Plural" );
+ WRITE ( "</i> " );
+ IndexUtilities::kind_name ( OUT , pack , TRUE , FALSE ); WRITE ( ")" );
+ IndexUtilities::link_to_documentation ( OUT , pack );
HTML_CLOSE ( "p" );
text_stream * variance = Metadata::read_optional_textual ( pack , I "^variance" );
if ( Str::len ( variance ) > 0 ) {
@@ -312,8 +279,8 @@ row.
HTML_CLOSE ( "p" );
}
-
-This code is used in §1.1.2 .
+
@@ -323,71 +290,63 @@ row.
HTML_TAG ( "br" );
}
-
-This code is used in §1.1.2 .
+
int f = FALSE ;
WRITE ( "<i>Matches:</i> " );
- inter_symbol * wanted = PackageTypes::get ( inv -> of_tree , I "_conformance" );
- 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 ) {
- inter_symbol * xref = Metadata::read_optional_symbol ( entry , I "^conformed_to" );
- inter_package * other = Inter::Packages::container ( xref -> definition );
- if ( f ) WRITE ( ", " );
- ChartElement::index_kind ( OUT , other , FALSE , TRUE );
- f = TRUE ;
- }
- }
+ inter_package * conf_pack ;
+ LOOP_THROUGH_SUBPACKAGES ( conf_pack , pack , I "_conformance" ) {
+ inter_symbol * xref = Metadata::read_optional_symbol ( conf_pack , I "^conformed_to" );
+ inter_package * other = Inter::Packages::container ( xref -> definition );
+ if ( f ) WRITE ( ", " );
+ IndexUtilities::kind_name ( OUT , other , FALSE , TRUE );
+ f = TRUE ;
}
HTML_TAG ( "br" );
-
-This code is used in §1.1.2 .
+
if ( Str::ne ( Metadata::read_textual ( pack , I "^printed_name" ), I "object" ))
if ( Metadata::read_optional_numeric ( pack , I "^instance_count" ) > 0 )
- ChartElement::index_instances ( OUT , inv , pack , 1 );
+ ChartElement::index_instances ( OUT , inv , pack , 1 );
-
-This code is used in §1.1.2 .
+
- ChartElement::index_inferences ( OUT , pack , FALSE );
+ ChartElement::index_inferences ( OUT , pack , FALSE );
-
-This code is used in §1.1.2 .
+
HTML_OPEN ( "p" );
HTML_TAG_WITH ( "a" , "name=contra" );
HTML_OPEN_WITH ( "span" , "class=\"smaller\"" );
- WRITE ( "<b>Covariance</b> means that if K is a kind of L, then something "
- "you make from K can be used as the same thing made from L. For example, "
- "a list of doors can be used as a list of things, because 'list of K' is "
- "covariant. <b>Contravariance</b> means it works the other way round. "
- "For example, an activity on things can be used as an activity on doors, "
- "but not vice versa, because 'activity of K' is contravariant." );
+ Localisation::write_0 ( OUT , D , I "Index.Elements.Ch.CovarianceGloss" );
HTML_CLOSE ( "span" );
HTML_CLOSE ( "p" );
-
-
+
-void ChartElement::index_kind_col_head ( OUTPUT_STREAM , char * name , char * anchor ) {
+void ChartElement::index_kind_col_head ( OUTPUT_STREAM , text_stream * key , char * anchor ,
+ localisation_dictionary * D ) {
HTML::next_html_column_nowrap ( OUT , 0 );
- WRITE ( "<i>%s</i> " , name );
+ WRITE ( "<i>" );
+ if ( Str::len ( key ) > 0 ) Localisation::write_0 ( OUT , D , key );
+ WRITE ( "</i> " );
if ( anchor ) {
HTML_OPEN_WITH ( "a" , "href=\"#\" onClick=\"showBasic('%s');\"" , anchor );
HTML_TAG_WITH ( "img" , "border=0 src=inform:/doc_images/shelp.png" );
@@ -395,55 +354,48 @@ link is to the part of the rubric explaining what goes into the column.
}
}
-
int striper = FALSE ;
-void ChartElement::begin_chart_row ( OUTPUT_STREAM ) {
+void ChartElement::begin_chart_row ( OUTPUT_STREAM ) {
char * col = NULL ;
if ( striper ) col = "#f0f0ff" ;
striper = striper ? FALSE:TRUE ;
HTML::first_html_column_nowrap ( OUT , 0 , col );
}
-
-
-
-int ChartElement::index_kind_name_cell ( OUTPUT_STREAM , int shaded , inter_package * pack ) {
+int ChartElement::index_kind_name_cell ( OUTPUT_STREAM , int shaded , inter_package * pack ) {
if ( shaded ) HTML::begin_colour ( OUT , I "808080" );
- ChartElement::index_kind ( OUT , pack , FALSE , TRUE );
+ IndexUtilities::kind_name ( OUT , pack , FALSE , TRUE );
if ( Metadata::read_optional_numeric ( pack , I "^is_quasinumerical" )) {
WRITE ( " " );
HTML_OPEN_WITH ( "a" , "href=\"Kinds.html?segment2\"" );
HTML_TAG_WITH ( "img" , "border=0 src=inform:/doc_images/calc1.png" );
HTML_CLOSE ( "a" );
}
- text_stream * doc_ref = Metadata::read_optional_textual ( pack , I "^documentation" );
- if ( Str::len ( doc_ref ) > 0 ) IndexUtilities::DocReferences::link ( OUT , doc_ref );
+ IndexUtilities::link_to_documentation ( OUT , pack );
int i = ( int ) Metadata::read_optional_numeric ( pack , I "^instance_count" );
if ( i >= 1 ) WRITE ( " [%d]" , i );
- IndexUtilities::below_link_numbered ( OUT , pack -> allocation_id );
+ IndexUtilities::below_link_numbered ( OUT , pack -> allocation_id );
if ( shaded ) HTML::end_colour ( OUT );
return shaded ;
}
-
-void ChartElement::end_chart_row ( OUTPUT_STREAM , int shaded , inter_package * pack ,
+void ChartElement::end_chart_row ( OUTPUT_STREAM , int shaded , inter_package * pack ,
char * tick1 , char * tick2 , char * tick3 ) {
if ( tick1 ) HTML::next_html_column ( OUT , 0 );
else HTML::next_html_column_spanning ( OUT , 0 , 4 );
@@ -470,71 +422,61 @@ whole row.
HTML::end_html_row ( OUT );
}
-
-
-
-void ChartElement::index_kind ( OUTPUT_STREAM , inter_package * pack , int plural , int with_links ) {
- if ( pack == NULL ) return ;
- text_stream * key = ( plural )? I "^index_plural" : I "^index_singular" ;
- WRITE ( "%S" , Metadata::read_optional_textual ( pack , key ));
- if ( with_links ) {
- int at = ( int ) Metadata::read_optional_numeric ( pack , I "^at" );
- if ( at > 0 ) IndexUtilities::link ( OUT , at );
- }
-}
-
-
+
define MAX_OBJECT_INDEX_DEPTH 10000
-void ChartElement::index_subkinds ( OUTPUT_STREAM , tree_inventory * inv , inter_package * pack , int depth , int pass ) {
+void ChartElement::index_subkinds ( OUTPUT_STREAM , tree_inventory * inv , inter_package * pack ,
+ int depth , int pass , localisation_dictionary * D ) {
for ( int j =0; j <TreeLists::len(inv-> kind_nodes ); j ++) {
inter_package * inner_pack = Inter::Package::defined_by_frame ( inv -> kind_nodes -> list [ j ]. node );
if (( Metadata::read_optional_numeric ( inner_pack , I "^is_base" )) &&
( Metadata::read_optional_numeric ( inner_pack , I "^is_subkind_of_object" ))) {
inter_symbol * super_weak = Metadata::read_optional_symbol ( inner_pack , I "^superkind" );
if (( super_weak ) && ( Inter::Packages::container ( super_weak -> definition ) == pack ))
- ChartElement::index_object_kind ( OUT , inv , inner_pack , depth , pass );
+ ChartElement::index_object_kind ( OUT , inv , inner_pack , depth , pass , D );
}
}
}
-void ChartElement::index_object_kind ( OUTPUT_STREAM , tree_inventory * inv , inter_package * pack , int depth , int pass ) {
+void ChartElement::index_object_kind ( OUTPUT_STREAM , tree_inventory * inv ,
+ inter_package * pack , int depth , int pass , localisation_dictionary * D ) {
if ( depth == MAX_OBJECT_INDEX_DEPTH ) internal_error ( "MAX_OBJECT_INDEX_DEPTH exceeded" );
inter_symbol * class_s = Metadata::read_optional_symbol ( pack , I "^object_class" );
if ( class_s == NULL ) internal_error ( "no class for object kind" );
text_stream * anchor = class_s -> symbol_name ;
int shaded = FALSE ;
- Begin the object citation line 8.1 ;
- Index the name part of the object citation 8.3 ;
- Index the link icons part of the object citation 8.4 ;
- End the object citation line 8.2 ;
- if ( pass == 2 ) Add a subsidiary paragraph of details about this object 8.5 ;
- ChartElement::index_subkinds ( OUT , inv , pack , depth +1, pass );
+ Begin the object citation line 6.1 ;
+ Index the name part of the object citation 6.3 ;
+ Index the link icons part of the object citation 6.4 ;
+ End the object citation line 6.2 ;
+ if ( pass == 2 ) Add a subsidiary paragraph of details about this object 6.5 ;
+ ChartElement::index_subkinds ( OUT , inv , pack , depth +1, pass , D );
}
-
- if ( pass == 1 ) ChartElement::begin_chart_row ( OUT );
+ if ( pass == 1 ) ChartElement::begin_chart_row ( OUT );
if ( pass == 2 ) {
HTML::open_indented_p ( OUT , depth , "halftight" );
- IndexUtilities::anchor ( OUT , anchor );
+ IndexUtilities::anchor ( OUT , anchor );
}
-
-
+
- if ( pass == 1 ) ChartElement::end_chart_row ( OUT , shaded , pack , "tick" , "tick" , "tick" );
+ if ( pass == 1 ) ChartElement::end_chart_row ( OUT , shaded , pack , "tick" , "tick" , "tick" );
if ( pass == 2 ) HTML_CLOSE ( "p" );
-
-
+
@@ -542,78 +484,78 @@ whole row.
int c = ( int ) Metadata::read_optional_numeric ( pack , I "^instance_count" );
if (( c == 0 ) && ( pass == 1 )) shaded = TRUE ;
if ( shaded ) HTML::begin_colour ( OUT , I "808080" );
- Quote the name of the object being indexed 8.3.1 ;
+ Quote the name of the object being indexed 6.3.1 ;
if ( shaded ) HTML::end_colour ( OUT );
if (( pass == 1 ) && ( c > 0 )) WRITE ( " [%d]" , c );
} else {
- Quote the name of the object being indexed 8.3.1 ;
+ Quote the name of the object being indexed 6.3.1 ;
}
-
-
+
if ( pass == 2 ) WRITE ( "<b>" );
- ChartElement::index_kind ( OUT , pack , FALSE , FALSE );
+ IndexUtilities::kind_name ( OUT , pack , FALSE , FALSE );
if ( pass == 2 ) WRITE ( "</b>" );
if ( pass == 2 ) {
- WRITE ( " (<i>plural</i> " ); ChartElement::index_kind ( OUT , pack , TRUE , FALSE );
+ WRITE ( " (<i>" );
+ Localisation::write_0 ( OUT , D , I "Index.Elements.Ch.Plural" );
+ WRITE ( "</i> " );
+ IndexUtilities::kind_name ( OUT , pack , TRUE , FALSE );
WRITE ( ")" );
}
-This code is used in §8.3 (twice).
-This code is used in §6.3 (twice).
+
- int at = ( int ) Metadata::read_optional_numeric ( pack , I "^at" );
- if ( at > 0 ) IndexUtilities::link ( OUT , at );
- text_stream * doc_ref = Metadata::read_optional_textual ( pack , I "^documentation" );
- if ( Str::len ( doc_ref ) > 0 ) IndexUtilities::DocReferences::link ( OUT , doc_ref );
- if ( pass == 1 ) IndexUtilities::below_link ( OUT , anchor );
+ IndexUtilities::link_package ( OUT , pack );
+ IndexUtilities::link_to_documentation ( OUT , pack );
+ if ( pass == 1 ) IndexUtilities::below_link ( OUT , anchor );
-
-
+
HTML::open_indented_p ( OUT , depth , "tight" );
- ChartElement::index_inferences ( OUT , pack , TRUE );
+ ChartElement::index_inferences ( OUT , pack , TRUE );
HTML_CLOSE ( "p" );
- ChartElement::index_instances ( OUT , inv , pack , depth );
+ ChartElement::index_instances ( OUT , inv , pack , depth );
-
-
+
+
-int ii_xtras = 900000 ;
-
-void ChartElement::index_instances ( OUTPUT_STREAM , tree_inventory * inv , inter_package * pack , int depth ) {
+void ChartElement::index_instances ( OUTPUT_STREAM , tree_inventory * inv , inter_package * pack ,
+ int depth ) {
HTML::open_indented_p ( OUT , depth , "tight" );
int c = ( int ) Metadata::read_optional_numeric ( pack , I "^instance_count" );
if ( c >= 10 ) {
- int xtra = ii_xtras ++;
- IndexUtilities::extra_link ( OUT , xtra );
+ int xtra = IndexRules::extra_ID ();
+ IndexUtilities::extra_link ( OUT , xtra );
HTML::begin_colour ( OUT , I "808080" );
WRITE ( "%d " , c );
- ChartElement::index_kind ( OUT , pack , TRUE , FALSE );
+ IndexUtilities::kind_name ( OUT , pack , TRUE , FALSE );
HTML::end_colour ( OUT );
HTML_CLOSE ( "p" );
- IndexUtilities::extra_div_open ( OUT , xtra , depth +1, "e0e0e0" );
- Itemise the instances 9.1 ;
- IndexUtilities::extra_div_close ( OUT , "e0e0e0" );
+ IndexUtilities::extra_div_open ( OUT , xtra , depth +1, "e0e0e0" );
+ Itemise the instances 7.1 ;
+ IndexUtilities::extra_div_close ( OUT , "e0e0e0" );
} else {
- Itemise the instances 9.1 ;
+ Itemise the instances 7.1 ;
HTML_CLOSE ( "p" );
}
}
-
- c = 0 ;
+ int c = 0 ;
for ( int i =0; i <TreeLists::len(inv-> instance_nodes ); i ++) {
inter_package * I_pack = Inter::Package::defined_by_frame ( inv -> instance_nodes -> list [ i ]. node );
inter_symbol * strong_kind_ID = Metadata::read_optional_symbol ( I_pack , I "^kind_xref" );
@@ -622,16 +564,16 @@ whole row.
HTML::begin_colour ( OUT , I "808080" );
WRITE ( "%S" , Metadata::read_optional_textual ( I_pack , I "^name" ));
HTML::end_colour ( OUT );
- int at = ( int ) Metadata::read_optional_numeric ( I_pack , I "^at" );
- if ( at > 0 ) IndexUtilities::link ( OUT , at );
+ IndexUtilities::link_package ( OUT , I_pack );
}
}
-This code is used in §9 (twice).
-
+This code is used in §7 (twice).
+
-void ChartElement::index_inferences ( OUTPUT_STREAM , inter_package * pack , int brief ) {
+void ChartElement::index_inferences ( OUTPUT_STREAM , inter_package * pack , int brief ) {
text_stream * explanation = Metadata::read_optional_textual ( pack , I "^specification" );
if ( Str::len ( explanation ) > 0 ) {
WRITE ( "%S" , explanation );
diff --git a/docs/index-module/3-ce3.html b/docs/index-module/3-ce3.html
index 0a281ec39..75a651a47 100644
--- a/docs/index-module/3-ce3.html
+++ b/docs/index-module/3-ce3.html
@@ -72,7 +72,7 @@ function togglePopup(material_id) {
To write the Commands element (Cm) in the index.
-
+
@@ -80,106 +80,51 @@ function togglePopup(material_id) {
void CommandsElement::render ( OUTPUT_STREAM , localisation_dictionary * LD ) {
inter_tree * I = InterpretIndex::get_tree ();
- command_index_entry * vie , * vie2 , * last_vie2 , * list_start = NULL ;
- int head_letter ;
+ linked_list * entries = NEW_LINKED_LIST ( command_index_entry );
+ Create the entries for the command list 1.1 ;
+ linked_list * sorted = CommandsElement::sort ( entries );
- inter_package * pack = Inter::Packages::by_url ( I , I "/main/completion/grammar" );
- inter_symbol * wanted = PackageTypes::get ( I , I "_command_grammar" );
- 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 ) {
- if (( Metadata::read_optional_numeric ( entry , I "^is_command" )) &&
- ( CommandsElement::no_lines ( I , entry ) > 0 )) {
- text_stream * main_command = Metadata::read_optional_textual ( entry , I "^command" );
- if ( Str::len ( main_command ) == 0 ) main_command = I "0" ;
- CommandsElement::vie_new_from ( main_command , entry , NORMAL_COMMAND );
- inter_symbol * wanted_i = PackageTypes::get ( I , I "_cg_alias" );
- LOOP_THROUGH_INTER_CHILDREN ( B , C ) {
- if ( B -> W . data [ ID_IFLD ] == PACKAGE_IST ) {
- inter_package * alias = Inter::Package::defined_by_frame ( B );
- if ( Inter::Packages::type ( alias ) == wanted_i ) {
- text_stream * alias_command = Metadata::read_textual ( alias , I "^alias" );
- CommandsElement::vie_new_from ( alias_command , entry , ALIAS_COMMAND );
- }
- }
- }
- }
- }
- }
- }
-
- CommandsElement::direction_verb ();
-
- LOOP_OVER ( vie , command_index_entry ) {
- if ( list_start == NULL ) { list_start = vie ; continue ; }
- vie2 = list_start ;
- last_vie2 = NULL ;
- while ( vie2 && ( Str::cmp ( vie -> command_headword , vie2 -> command_headword ) > 0 )) {
- last_vie2 = vie2 ;
- vie2 = vie2 -> next_alphabetically ;
- }
- if ( last_vie2 == NULL ) {
- vie -> next_alphabetically = list_start ; list_start = vie ;
- } else {
- last_vie2 -> next_alphabetically = vie ; vie -> next_alphabetically = vie2 ;
- }
- }
-
- for ( vie = list_start , head_letter = 0 ; vie ; vie = vie -> next_alphabetically ) {
- if ( Str::get_first_char ( vie -> command_headword ) != head_letter ) {
+ wchar_t head_letter = 0 ;
+ command_index_entry * cie ;
+ LOOP_OVER_LINKED_LIST ( cie , command_index_entry , sorted ) {
+ if ( Str::get_first_char ( cie -> command_headword ) != head_letter ) {
if ( head_letter ) HTML_TAG ( "br" );
- head_letter = Str::get_first_char ( vie -> command_headword );
- }
- inter_package * cg = vie -> cg_indexed ;
- switch ( vie -> nature ) {
- case NORMAL_COMMAND:
- CommandsElement::index_normal ( OUT , I , cg , vie -> command_headword );
- break ;
- case ALIAS_COMMAND:
- CommandsElement::index_alias ( OUT , I , cg , vie -> command_headword );
- break ;
- case OUT_OF_WORLD_COMMAND:
- HTML::begin_colour ( OUT , I "800000" );
- WRITE ( ""%S", <i>a command for controlling play</i>" ,
- vie -> command_headword );
- HTML::end_colour ( OUT );
- HTML_TAG ( "br" );
- break ;
- case TESTING_COMMAND:
- HTML::begin_colour ( OUT , I "800000" );
- WRITE ( ""%S", <i>a testing command not available "
- "in the final game</i>" ,
- vie -> command_headword );
- HTML::end_colour ( OUT );
- HTML_TAG ( "br" );
- break ;
- case BARE_DIRECTION_COMMAND:
- WRITE ( ""[direction]" - <i>going</i>" );
- HTML_TAG ( "br" );
- break ;
+ head_letter = Str::get_first_char ( cie -> command_headword );
}
+ Render an index entry from the sorted list 1.5 ;
}
}
-
-int CommandsElement::no_lines ( inter_tree * I , inter_package * cg ) {
- int N = 0 ;
- inter_symbol * wanted = PackageTypes::get ( I , I "_cg_line" );
- inter_tree_node * D = Inter::Packages::definition ( cg );
- 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 ) N ++;
- }
- }
- return N ;
-}
-
+
+
+ inter_package * pack = Inter::Packages::by_url ( I , I "/main/completion/grammar" );
+ inter_package * entry ;
+ LOOP_THROUGH_SUBPACKAGES ( entry , pack , I "_command_grammar" )
+ if (( Metadata::read_optional_numeric ( entry , I "^is_command" )) &&
+ ( InterTree::no_subpackages ( entry , I "_cg_line" ) > 0 ))
+ Create entry for this command 1.1.1 ;
+ CommandsElement::make_direction_entry ( entries );
+
+
+
+
+
+ text_stream * main_command = Metadata::read_optional_textual ( entry , I "^command" );
+ if ( Str::len ( main_command ) == 0 ) main_command = I "0" ;
+ CommandsElement::make_entry ( main_command , entry , NORMAL_COMMAND , entries );
+ inter_package * alias ;
+ LOOP_THROUGH_SUBPACKAGES ( alias , entry , I "_cg_alias" ) {
+ text_stream * alias_command = Metadata::read_textual ( alias , I "^alias" );
+ CommandsElement::make_entry ( alias_command , entry , ALIAS_COMMAND , entries );
+ }
+
+This code is used in §1.1 .
+
define NORMAL_COMMAND 1
@@ -200,86 +145,147 @@ we divide these headwords into five "natures":
command_index_entry * sorted_command_index = NULL ;
The structure command_index_entry is private to this section.
-
+
-void CommandsElement::test_verb ( text_stream * t ) {
- command_index_entry * vie ;
- vie = CREATE ( command_index_entry );
- vie -> command_headword = Str::duplicate ( t );
- vie -> nature = TESTING_COMMAND ;
- vie -> cg_indexed = NULL ;
- vie -> next_alphabetically = NULL ;
+void CommandsElement::make_test_entry ( text_stream * t , linked_list * entries ) {
+ command_index_entry * cie ;
+ cie = CREATE ( command_index_entry );
+ cie -> command_headword = Str::duplicate ( t );
+ cie -> nature = TESTING_COMMAND ;
+ cie -> cg_indexed = NULL ;
+ cie -> next_alphabetically = NULL ;
+ ADD_TO_LINKED_LIST ( cie , command_index_entry , entries );
}
-command_index_entry * CommandsElement::vie_new_from ( text_stream * headword , inter_package * cg , int nature ) {
- command_index_entry * vie = CREATE ( command_index_entry );
- vie -> command_headword = Str::duplicate ( headword );
- vie -> nature = nature ;
- vie -> cg_indexed = cg ;
- vie -> next_alphabetically = NULL ;
- return vie ;
+void CommandsElement::make_entry ( text_stream * headword , inter_package * cg_pack ,
+ int nature , linked_list * entries ) {
+ command_index_entry * cie = CREATE ( command_index_entry );
+ cie -> command_headword = Str::duplicate ( headword );
+ cie -> nature = nature ;
+ cie -> cg_indexed = cg_pack ;
+ cie -> next_alphabetically = NULL ;
+ ADD_TO_LINKED_LIST ( cie , command_index_entry , entries );
}
-void CommandsElement::direction_verb ( void ) {
- command_index_entry * vie = CREATE ( command_index_entry );
- vie -> command_headword = I "0" ;
- vie -> nature = BARE_DIRECTION_COMMAND ;
- vie -> cg_indexed = NULL ;
- vie -> next_alphabetically = NULL ;
+void CommandsElement::make_direction_entry ( linked_list * entries ) {
+ command_index_entry * cie = CREATE ( command_index_entry );
+ cie -> command_headword = I "0" ;
+ cie -> nature = BARE_DIRECTION_COMMAND ;
+ cie -> cg_indexed = NULL ;
+ cie -> next_alphabetically = NULL ;
+ ADD_TO_LINKED_LIST ( cie , command_index_entry , entries );
}
-
+
+
+linked_list * CommandsElement::sort ( linked_list * entries ) {
+ command_index_entry * cie , * list_start = NULL ;
+ LOOP_OVER_LINKED_LIST ( cie , command_index_entry , entries ) {
+ if ( list_start == NULL ) { list_start = cie ; continue ; }
+ command_index_entry * cie2 = list_start , * last_cie2 = NULL ;
+ while ( cie2 && ( Str::cmp ( cie -> command_headword , cie2 -> command_headword ) > 0 )) {
+ last_cie2 = cie2 ;
+ cie2 = cie2 -> next_alphabetically ;
+ }
+ if ( last_cie2 == NULL ) {
+ cie -> next_alphabetically = list_start ; list_start = cie ;
+ } else {
+ last_cie2 -> next_alphabetically = cie ; cie -> next_alphabetically = cie2 ;
+ }
+ }
+ linked_list * sorted = NEW_LINKED_LIST ( command_index_entry );
+ for ( command_index_entry * cie = list_start ; cie ; cie = cie -> next_alphabetically )
+ ADD_TO_LINKED_LIST ( cie , command_index_entry , sorted );
+ return sorted ;
+}
+
+
+
+
-void CommandsElement::index_normal ( OUTPUT_STREAM , inter_tree * I , inter_package * cg , text_stream * headword ) {
- inter_symbol * wanted = PackageTypes::get ( I , I "_cg_line" );
- inter_tree_node * D = Inter::Packages::definition ( cg );
- 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 )
- CommandsElement::cgl_index_normal ( OUT , entry , headword );
- }
+ inter_package * cg_pack = cie -> cg_indexed ;
+ switch ( cie -> nature ) {
+ case NORMAL_COMMAND:
+ CommandsElement::index_normal ( OUT , I , cg_pack , cie -> command_headword , LD );
+ break ;
+ case ALIAS_COMMAND:
+ CommandsElement::index_alias ( OUT , I , cg_pack , cie -> command_headword , LD );
+ break ;
+ case OUT_OF_WORLD_COMMAND:
+ HTML::begin_colour ( OUT , I "800000" );
+ WRITE ( ""%S", <i>" , cie -> command_headword );
+ Localisation::write_0 ( OUT , LD , I "Index.Elements.Cm.Command" );
+ WRITE ( "</i>" );
+ HTML::end_colour ( OUT );
+ HTML_TAG ( "br" );
+ break ;
+ case TESTING_COMMAND:
+ HTML::begin_colour ( OUT , I "800000" );
+ WRITE ( ""%S", <i>" , cie -> command_headword );
+ Localisation::write_0 ( OUT , LD , I "Index.Elements.Cm.TestingCommand" );
+ WRITE ( "</i>" );
+ HTML::end_colour ( OUT );
+ HTML_TAG ( "br" );
+ break ;
+ case BARE_DIRECTION_COMMAND:
+ WRITE ( ""[direction]" - <i>" );
+ Localisation::write_0 ( OUT , LD , I "Index.Elements.Cm.DirectionCommand" );
+ WRITE ( "</i>" );
+ HTML_TAG ( "br" );
+ break ;
}
+
+
+
+
+
+void CommandsElement::index_normal ( OUTPUT_STREAM , inter_tree * I , inter_package * cg_pack ,
+ text_stream * headword , localisation_dictionary * LD ) {
+ inter_package * entry ;
+ LOOP_THROUGH_SUBPACKAGES ( entry , cg_pack , I "_cg_line" )
+ CommandsElement::index_grammar_line ( OUT , entry , headword , LD );
}
-void CommandsElement::cgl_index_normal ( OUTPUT_STREAM , inter_package * cgl , text_stream * headword ) {
+void CommandsElement::index_alias ( OUTPUT_STREAM , inter_tree * I , inter_package * cg_pack ,
+ text_stream * headword , localisation_dictionary * LD ) {
+ WRITE ( ""%S", <i>" , headword );
+ Localisation::write_0 ( OUT , LD , I "Index.Elements.Cm.Alias" );
+ WRITE ( "</i> "%S"" , Metadata::read_textual ( cg_pack , I "^command" ));
+ IndexUtilities::link_package ( OUT , cg_pack );
+ HTML_TAG ( "br" );
+}
+
+void CommandsElement::index_grammar_line ( OUTPUT_STREAM , inter_package * cgl ,
+ text_stream * headword , localisation_dictionary * LD ) {
inter_symbol * an_s = Metadata::read_optional_symbol ( cgl , I "^action" );
if ( an_s == NULL ) return ;
inter_package * an = Inter::Packages::container ( an_s -> definition );
int oow = ( int ) Metadata::read_optional_numeric ( an , I "^out_of_world" );
- if ( Str::len ( headword ) > 0 ) IndexUtilities::anchor ( OUT , headword );
+ if ( Str::len ( headword ) > 0 ) IndexUtilities::anchor ( OUT , headword );
if ( oow ) HTML::begin_colour ( OUT , I "800000" );
WRITE ( """ );
TokensElement::verb_definition ( OUT , Metadata::read_optional_textual ( cgl , I "^text" ),
headword , EMPTY_WORDING );
WRITE ( """ );
- int at = ( int ) Metadata::read_optional_numeric ( cgl , I "^at" );
- if ( at > 0 ) IndexUtilities::link ( OUT , at );
+ IndexUtilities::link_package ( OUT , cgl );
WRITE ( " - <i>%S" , Metadata::read_textual ( an , I "^name" ));
- IndexUtilities::detail_link ( OUT , "A" , ( int ) Metadata::read_numeric ( an , I "action_id" ), TRUE );
- if ( Metadata::read_optional_numeric ( cgl , I "^reversed" ))
- WRITE ( " <i>reversed</i>" );
+ IndexUtilities::detail_link ( OUT , "A" ,
+ ( int ) Metadata::read_numeric ( an , I "action_id" ), TRUE );
+ if ( Metadata::read_optional_numeric ( cgl , I "^reversed" )) {
+ WRITE ( " <i>" );
+ Localisation::write_0 ( OUT , LD , I "Index.Elements.Cm.Reversed" );
+ WRITE ( "</i>" );
+ }
WRITE ( "</i>" );
if ( oow ) HTML::end_colour ( OUT );
HTML_TAG ( "br" );
}
-
-void CommandsElement::index_alias ( OUTPUT_STREAM , inter_tree * I , inter_package * cg , text_stream * headword ) {
- WRITE ( ""%S", <i>same as</i> "%S"" ,
- headword , Metadata::read_textual ( cg , I "^command" ));
- int at = ( int ) Metadata::read_optional_numeric ( cg , I "^at" );
- if ( at > 0 ) IndexUtilities::link ( OUT , at );
- HTML_TAG ( "br" );
-}
diff --git a/docs/index-module/3-ce4.html b/docs/index-module/3-ce4.html
index 622cc505c..0c2988d3f 100644
--- a/docs/index-module/3-ce4.html
+++ b/docs/index-module/3-ce4.html
@@ -147,8 +147,7 @@ function togglePopup(material_id) {
WRITE ( "%d words" , Metadata::read_numeric ( pack , I "^word_count" ));
if ( L > min_positive_level ) HTML::end_colour ( OUT );
- int at = ( int ) Metadata::read_optional_numeric ( pack , I "^at" );
- if ( at > 0 ) IndexUtilities::link ( OUT , at );
+ IndexUtilities::link_package ( OUT , pack );
HTML_CLOSE ( "span" );
HTML_CLOSE ( "li" );
HTML_CLOSE ( "ul" );
@@ -223,8 +222,7 @@ giving only minimal entries about them.
HTML_OPEN ( "span" );
WRITE ( "%S " , Metadata::read_textual ( pack , I "^title" ));
if ( Metadata::read_optional_numeric ( pack , I "^standard" ) == 0 ) {
- int ext_at = ( int ) Metadata::read_optional_numeric ( pack , I "^at" );
- if ( ext_at > 0 ) { IndexUtilities::link ( OUT , ext_at ); WRITE ( " " ); }
+ IndexUtilities::link_package ( OUT , pack ); WRITE ( " " );
}
if ( auto_included != TRUE ) WRITE ( "by %S " , Metadata::read_textual ( pack , I "^author" ));
diff --git a/docs/index-module/3-ee.html b/docs/index-module/3-ee.html
index b0c22617c..cf077bb30 100644
--- a/docs/index-module/3-ee.html
+++ b/docs/index-module/3-ee.html
@@ -105,8 +105,7 @@ function togglePopup(material_id) {
when_count ++;
HTML_OPEN_WITH ( "p" , "class=\"tightin2\"" );
WRITE ( "%S" , Metadata::read_textual ( pack , I "^preamble" ));
- int at = ( int ) Metadata::read_optional_numeric ( pack , I "^at" );
- if ( at > 0 ) IndexUtilities::link ( OUT , at );
+ IndexUtilities::link_package ( OUT , pack );
WRITE ( " (where triggered: " );
inter_tree_node * D = Inter::Packages::definition ( pack );
LOOP_THROUGH_INTER_CHILDREN ( C , D ) {
@@ -141,8 +140,7 @@ function togglePopup(material_id) {
tt_count ++;
HTML_OPEN_WITH ( "p" , "class=\"in2\"" );
WRITE ( "%S" , Metadata::read_textual ( pack , I "^preamble" ));
- int at = ( int ) Metadata::read_optional_numeric ( pack , I "^at" );
- if ( at > 0 ) IndexUtilities::link ( OUT , at );
+ IndexUtilities::link_package ( OUT , pack );
HTML_CLOSE ( "p" );
}
}
diff --git a/docs/index-module/3-fe.html b/docs/index-module/3-fe.html
index 121ede1cd..f168eb8b6 100644
--- a/docs/index-module/3-fe.html
+++ b/docs/index-module/3-fe.html
@@ -178,8 +178,7 @@ to match this width, preserving the aspect ratio.
HTML::next_html_column ( OUT , 0 );
WRITE ( "%S" , Metadata::read_textual ( pack , I "^name" ));
- int at = ( int ) Metadata::read_optional_numeric ( pack , I "^at" );
- if ( at > 0 ) IndexUtilities::link ( OUT , at );
+ IndexUtilities::link_package ( OUT , pack );
HTML_TAG ( "br" );
if ( Str::len ( line2 ) > 0 ) {
@@ -295,8 +294,7 @@ to match this width, preserving the aspect ratio.
WRITE ( " " );
HTML::next_html_column ( OUT , 0 );
WRITE ( "%S" , Metadata::read_textual ( pack , I "^name" ));
- int at = ( int ) Metadata::read_optional_numeric ( pack , I "^at" );
- if ( at > 0 ) IndexUtilities::link ( OUT , at );
+ IndexUtilities::link_package ( OUT , pack );
HTML_TAG ( "br" );
if ( Str::len ( line2 ) > 0 ) {
WRITE ( "%S" , line2 );
@@ -332,8 +330,7 @@ to match this width, preserving the aspect ratio.
WRITE ( " " );
HTML::next_html_column ( OUT , 0 );
WRITE ( "%S" , Metadata::read_textual ( pack , I "^name" ));
- int at = ( int ) Metadata::read_optional_numeric ( pack , I "^at" );
- if ( at > 0 ) IndexUtilities::link ( OUT , at );
+ IndexUtilities::link_package ( OUT , pack );
HTML_TAG ( "br" );
WRITE ( "Filename: %s %S- owned by " ,
( is_binary )? "- binary " : "" ,
diff --git a/docs/index-module/3-ge2.html b/docs/index-module/3-ge2.html
index bab301af5..e5bcaca14 100644
--- a/docs/index-module/3-ge2.html
+++ b/docs/index-module/3-ge2.html
@@ -122,21 +122,20 @@ function togglePopup(material_id) {
WRITE ( "%S" , Metadata::read_optional_textual ( an_pack , I "^name" ));
if ( bold ) WRITE ( "</b>" );
if ( oow ) HTML::end_colour ( OUT );
- int at = ( int ) Metadata::read_optional_numeric ( an_pack , I "^at" );
- if ( at > 0 ) IndexUtilities::link ( OUT , at );
- IndexUtilities::detail_link ( OUT , "A" , i , ( on_details_page )? FALSE:TRUE );
+ IndexUtilities::link_package ( OUT , an_pack );
+ IndexUtilities::detail_link ( OUT , "A" , i , ( on_details_page )? FALSE:TRUE );
}
-void GroupedElement::detail_pages ( localisation_dictionary * D ) {
+void GroupedElement::detail_pages ( localisation_dictionary * LD ) {
inter_tree * I = InterpretIndex::get_tree ();
tree_inventory * inv = Synoptic::inv ( I );
TreeLists::sort ( inv -> action_nodes , Synoptic::module_order );
for ( int i =0; i <TreeLists::len(inv-> action_nodes ); i ++) {
inter_package * an_pack = Inter::Package::defined_by_frame ( inv -> action_nodes -> list [ i ]. node );
- text_stream * OUT = InterpretIndex::open_file ( NULL , I "A.html" , I "<Actions" , i , D );
+ text_stream * OUT = InterpretIndex::open_file ( NULL , I "A.html" , I "<Actions" , i , LD );
IndexUtilities::banner_line ( OUT , NULL , 1 , I "^" , I "Details" ,
- I "Index.Pages.ActionDetails.Heading" , "../Actions.html" , D );
+ I "Index.Pages.ActionDetails.Heading" , "../Actions.html" , LD );
HTML_TAG ( "hr" );
text_stream * this_area = Metadata::read_optional_textual ( an_pack , I "^index_heading" );
text_stream * this_subarea = Metadata::read_optional_textual ( an_pack , I "^index_subheading" );
@@ -152,7 +151,7 @@ function togglePopup(material_id) {
if ( j == i ) WRITE ( "<b>" );
WRITE ( "%S" , Metadata::read_optional_textual ( an2_pack , I "^name" ));
if ( j == i ) WRITE ( "</b>" );
- if ( j != i ) IndexUtilities::detail_link ( OUT , "A" , j , FALSE );
+ if ( j != i ) IndexUtilities::detail_link ( OUT , "A" , j , FALSE );
}
}
HTML_CLOSE ( "p" );
@@ -178,8 +177,7 @@ function togglePopup(material_id) {
WRITE ( "%S" , Metadata::read_optional_textual ( an_pack , I "^display_name" ));
if ( oow ) HTML::end_colour ( OUT );
WRITE ( "</b>" );
- int at = ( int ) Metadata::read_optional_numeric ( an_pack , I "^at" );
- if ( at > 0 ) IndexUtilities::link ( OUT , at );
+ IndexUtilities::link_package ( OUT , an_pack );
if ( requires_light ) WRITE ( " (requires light)" );
WRITE ( " (<i>past tense</i> %S)" , Metadata::read_optional_textual ( an_pack , I "^past_name" ));
text_stream * spec = Metadata::read_optional_textual ( an_pack , I "^specification" );
@@ -196,17 +194,11 @@ function togglePopup(material_id) {
HTML_OPEN ( "p" ); WRITE ( "<b>Typed commands leading to this action</b>\n" ); HTML_CLOSE ( "p" );
HTML_OPEN ( "p" );
int producers = 0 ;
- inter_symbol * wanted = PackageTypes::get ( I , I "_cg_line" );
- inter_tree_node * D = Inter::Packages::definition ( an_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 ) {
- inter_symbol * xref = Metadata::read_symbol ( entry , I "^line" );
- CommandsElement::cgl_index_normal ( OUT , Inter::Packages::container ( xref -> definition ), NULL );
- producers ++;
- }
- }
+ inter_package * line_pack ;
+ LOOP_THROUGH_SUBPACKAGES ( line_pack , an_pack , I "_cg_line" ) {
+ inter_symbol * xref = Metadata::read_symbol ( line_pack , I "^line" );
+ CommandsElement::index_grammar_line ( OUT , Inter::Packages::container ( xref -> definition ), NULL , LD );
+ producers ++;
}
if ( producers == 0 ) WRITE ( "<i>None</i>" );
HTML_CLOSE ( "p" );
@@ -218,7 +210,7 @@ function togglePopup(material_id) {
if ( GroupedElement::no_vars ( an_pack , I ) > 0 ) {
HTML_OPEN ( "p" ); WRITE ( "<b>Named values belonging to this action</b>\n" ); HTML_CLOSE ( "p" );
- GroupedElement::index_stv_set ( OUT , I , an_pack );
+ GroupedElement::index_shv_set ( OUT , I , an_pack );
}
@@ -232,11 +224,11 @@ function togglePopup(material_id) {
int resp_count = 0 ;
inter_ti oow = Metadata::read_optional_numeric ( an_pack , I "^out_of_world" );
if ( oow == FALSE ) {
- resp_count += IndexRules::index_action_rules ( OUT , inv , an_pack , NULL , I "persuasion" , I "persuasion" , D );
- resp_count += IndexRules::index_action_rules ( OUT , inv , an_pack , NULL , I "unsuccessful_attempt_by" , I "unsuccessful attempt" , D );
- resp_count += IndexRules::index_action_rules ( OUT , inv , an_pack , NULL , I "setting_action_variables" , I "set action variables for" , D );
- resp_count += IndexRules::index_action_rules ( OUT , inv , an_pack , NULL , I "before" , I "before" , D );
- resp_count += IndexRules::index_action_rules ( OUT , inv , an_pack , NULL , I "instead" , I "instead of" , D );
+ resp_count += IndexRules::index_action_rules ( OUT , inv , an_pack , NULL , I "persuasion" , I "persuasion" , LD );
+ resp_count += IndexRules::index_action_rules ( OUT , inv , an_pack , NULL , I "unsuccessful_attempt_by" , I "unsuccessful attempt" , LD );
+ resp_count += IndexRules::index_action_rules ( OUT , inv , an_pack , NULL , I "setting_action_variables" , I "set action variables for" , LD );
+ resp_count += IndexRules::index_action_rules ( OUT , inv , an_pack , NULL , I "before" , I "before" , LD );
+ resp_count += IndexRules::index_action_rules ( OUT , inv , an_pack , NULL , I "instead" , I "instead of" , LD );
}
inter_symbol * check_s = Metadata::read_symbol ( an_pack , I "^check_rulebook" );
inter_symbol * carry_out_s = Metadata::read_symbol ( an_pack , I "^carry_out_rulebook" );
@@ -245,16 +237,16 @@ function togglePopup(material_id) {
inter_package * carry_out_pack = Inter::Packages::container ( carry_out_s -> definition );
inter_package * report_pack = Inter::Packages::container ( report_s -> definition );
- resp_count += IndexRules::index_action_rules ( OUT , inv , an_pack , check_pack , I "check" , I "check" , D );
- resp_count += IndexRules::index_action_rules ( OUT , inv , an_pack , carry_out_pack , I "carry_out" , I "carry out" , D );
+ resp_count += IndexRules::index_action_rules ( OUT , inv , an_pack , check_pack , I "check" , I "check" , LD );
+ resp_count += IndexRules::index_action_rules ( OUT , inv , an_pack , carry_out_pack , I "carry_out" , I "carry out" , LD );
if ( oow == FALSE )
- resp_count += IndexRules::index_action_rules ( OUT , inv , an_pack , NULL , I "after" , I "after" , D );
- resp_count += IndexRules::index_action_rules ( OUT , inv , an_pack , report_pack , I "report" , I "report" , D );
+ resp_count += IndexRules::index_action_rules ( OUT , inv , an_pack , NULL , I "after" , I "after" , LD );
+ resp_count += IndexRules::index_action_rules ( OUT , inv , an_pack , report_pack , I "report" , I "report" , LD );
if ( resp_count > 1 ) {
WRITE ( "Click on the speech-bubble icons to see the responses, "
"or here to see all of them:" );
WRITE ( " " );
- IndexUtilities::extra_all_link_with ( OUT , TreeLists::len ( inv -> rule_nodes ), "responses" );
+ IndexUtilities::extra_all_link_with ( OUT , TreeLists::len ( inv -> rule_nodes ), "responses" );
WRITE ( "%d" , resp_count );
}
HTML_CLOSE ( "p" );
@@ -264,37 +256,18 @@ function togglePopup(material_id) {
int GroupedElement::no_vars ( inter_package * set , inter_tree * I ) {
- int sv = 0 ;
- inter_symbol * wanted = PackageTypes::get ( I , I "_shared_variable" );
- inter_tree_node * D = Inter::Packages::definition ( set );
- 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 ) {
- sv ++;
- }
- }
- }
- return sv ;
+ return InterTree::no_subpackages ( set , I "_shared_variable" );
}
-void GroupedElement::index_stv_set ( OUTPUT_STREAM , inter_tree * I , inter_package * set ) {
- inter_symbol * wanted = PackageTypes::get ( I , I "_shared_variable" );
- inter_tree_node * D = Inter::Packages::definition ( set );
- LOOP_THROUGH_INTER_CHILDREN ( C , D ) {
- if ( C -> W . data [ ID_IFLD ] == PACKAGE_IST ) {
- inter_package * var_pack = Inter::Package::defined_by_frame ( C );
- if ( Inter::Packages::type ( var_pack ) == wanted ) {
- HTML::open_indented_p ( OUT , 2 , "tight" );
- WRITE ( "%S" , Metadata::read_optional_textual ( var_pack , I "^name" ));
- int at = ( int ) Metadata::read_optional_numeric ( var_pack , I "^at" );
- if ( at > 0 ) IndexUtilities::link ( OUT , at );
- text_stream * doc_ref = Metadata::read_optional_textual ( var_pack , I "^documentation" );
- if ( Str::len ( doc_ref ) > 0 ) IndexUtilities::DocReferences::link ( OUT , doc_ref );
- WRITE ( " - <i>%S</i>" , Metadata::read_optional_textual ( var_pack , I "^kind" ));
- HTML_CLOSE ( "p" );
- }
- }
+void GroupedElement::index_shv_set ( OUTPUT_STREAM , inter_tree * I , inter_package * set ) {
+ inter_package * var_pack ;
+ LOOP_THROUGH_SUBPACKAGES ( var_pack , set , I "_shared_variable" ) {
+ HTML::open_indented_p ( OUT , 2 , "tight" );
+ WRITE ( "%S" , Metadata::read_optional_textual ( var_pack , I "^name" ));
+ IndexUtilities::link_package ( OUT , var_pack );
+ IndexUtilities::link_to_documentation ( OUT , var_pack );
+ WRITE ( " - <i>%S</i>" , Metadata::read_optional_textual ( var_pack , I "^kind" ));
+ HTML_CLOSE ( "p" );
}
}
diff --git a/docs/index-module/3-ie.html b/docs/index-module/3-ie.html
index 939636689..f25f9c2a3 100644
--- a/docs/index-module/3-ie.html
+++ b/docs/index-module/3-ie.html
@@ -85,22 +85,22 @@ function togglePopup(material_id) {
Show the use options 1.2 ;
HTML_OPEN ( "p" );
- IndexUtilities::extra_link ( OUT , 3 );
+ IndexUtilities::extra_link ( OUT , 3 );
WRITE ( "See some technicalities for Inform maintainers only" );
HTML_CLOSE ( "p" );
- IndexUtilities::extra_div_open ( OUT , 3 , 2 , "e0e0e0" );
+ IndexUtilities::extra_div_open ( OUT , 3 , 2 , "e0e0e0" );
HTML_OPEN ( "p" );
- IndexUtilities::anchor ( OUT , I "CONFIG" );
+ IndexUtilities::anchor ( OUT , I "CONFIG" );
Show the language elements used 1.3 ;
Add some paste buttons for the debugging log 1.4 ;
- IndexUtilities::extra_div_close ( OUT , "e0e0e0" );
+ IndexUtilities::extra_div_close ( OUT , "e0e0e0" );
}
- IndexUtilities::anchor ( OUT , I "STORYFILE" );
+ IndexUtilities::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" );
@@ -174,27 +174,21 @@ function togglePopup(material_id) {
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" );
- }
+ inter_package * aspect_pack ;
+ LOOP_THROUGH_SUBPACKAGES ( aspect_pack , pack , I "_debugging_aspect" ) {
+ TEMPORARY_TEXT ( is )
+ WRITE_TO ( is , "Include %S in the debugging log." ,
+ Metadata::read_textual ( aspect_pack , I "^name" ));
+ PasteButtons::paste_text ( OUT , is );
+ WRITE ( " %S " , is );
+ DISCARD_TEXT ( is )
+ if ( Metadata::read_optional_numeric ( aspect_pack , 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" );
diff --git a/docs/index-module/3-le.html b/docs/index-module/3-le.html
index 9b7a15df5..f45bab8e5 100644
--- a/docs/index-module/3-le.html
+++ b/docs/index-module/3-le.html
@@ -76,7 +76,7 @@ function togglePopup(material_id) {
void LexiconElement::render ( OUTPUT_STREAM , localisation_dictionary * LD ) {
- IndexUtilities::anchor ( OUT , I "LEXICON" );
+ IndexUtilities::anchor ( OUT , I "LEXICON" );
HTML_OPEN ( "p" );
HTML_OPEN_WITH ( "span" , "class=\"smaller\"" );
WRITE ( "For instance, the description 'an unlocked door' is made "
diff --git a/docs/index-module/3-me.html b/docs/index-module/3-me.html
index 95c84921f..b7861f40e 100644
--- a/docs/index-module/3-me.html
+++ b/docs/index-module/3-me.html
@@ -89,7 +89,7 @@ function togglePopup(material_id) {
PL::HTMLMap::add_region_key ( OUT );
MapElement::index_backdrop_further ( OUT , NULL , 0 , FALSE , 1 );
- IndexUtilities::anchor ( OUT , I "MDETAILS" );
+ IndexUtilities::anchor ( OUT , I "MDETAILS" );
int unruly = FALSE ;
Mark parts, directions and kinds as ineligible for listing in the World index 1.1 ;
Give room details within each region in turn in the World index 1.2 ;
@@ -216,19 +216,19 @@ will be things which are offstage (and their contents and any parts thereof):
Begin the object citation line 2.1 ;
int xtra = -1;
if ( I ) xtra = xtras_count ++;
- if ( xtra >= 0 ) IndexUtilities::extra_link ( OUT , xtra );
+ if ( xtra >= 0 ) IndexUtilities::extra_link ( OUT , xtra );
Index the name part of the object citation 2.3 ;
if ( I ) Index the kind attribution part of the object citation 2.4 ;
Index the link icons part of the object citation 2.5 ;
End the object citation line 2.2 ;
if ( details ) Add a subsidiary paragraph of details about this object 2.7 ;
if ( xtra >= 0 ) {
- IndexUtilities::extra_div_open ( OUT , xtra , depth +1, "e0e0e0" );
+ IndexUtilities::extra_div_open ( OUT , xtra , depth +1, "e0e0e0" );
Add the chain of kinds 2.8 ;
Add the catalogue of specific properties 2.9 ;
Add details depending on the kind 2.10 ;
MapElement::index_usages ( OUT , I );
- IndexUtilities::extra_div_close ( OUT , "e0e0e0" );
+ IndexUtilities::extra_div_close ( OUT , "e0e0e0" );
}
Recurse the index citation for the object as necessary 2.6 ;
}
@@ -239,7 +239,7 @@ will be things which are offstage (and their contents and any parts thereof):
if ( details ) {
HTML::open_indented_p ( OUT , depth , "halftight" );
- if ( I != indexing_room ) IndexUtilities::anchor ( OUT , I -> anchor_text );
+ if ( I != indexing_room ) IndexUtilities::anchor ( OUT , I -> anchor_text );
} else {
# ifdef IF_MODULE
if ( I ) MapElement::index_spatial_relationship ( OUT , I );
diff --git a/docs/index-module/3-pe.html b/docs/index-module/3-pe.html
index db6b1a760..2476d2084 100644
--- a/docs/index-module/3-pe.html
+++ b/docs/index-module/3-pe.html
@@ -78,51 +78,34 @@ function togglePopup(material_id) {
void PhrasebookElement::render ( OUTPUT_STREAM , localisation_dictionary * LD ) {
inter_tree * I = InterpretIndex::get_tree ();
inter_package * pack = Inter::Packages::by_url ( I , I "/main/completion/phrases" );
- inter_symbol * wanted = PackageTypes::get ( I , I "_phrasebook_super_heading" );
- inter_tree_node * D = Inter::Packages::definition ( pack );
for ( int pass = 1 ; pass <= 2 ; pass ++) {
int grand_c = 0 ;
- 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 ) {
- if ( pass == 2 ) HTML_TAG ( "hr" );
- HTML_OPEN_WITH ( "p" , "class=\"in1\"" );
- WRITE ( "<b>%S</b>" , Metadata::read_textual ( entry , I "^text" ));
+ inter_package * sh_pack ;
+ LOOP_THROUGH_SUBPACKAGES ( sh_pack , pack , I "_phrasebook_super_heading" ) {
+ if ( pass == 2 ) HTML_TAG ( "hr" );
+ HTML_OPEN_WITH ( "p" , "class=\"in1\"" );
+ WRITE ( "<b>%S</b>" , Metadata::read_textual ( sh_pack , I "^text" ));
+ HTML_CLOSE ( "p" );
+ int c = 0 ;
+ inter_package * h_pack ;
+ LOOP_THROUGH_SUBPACKAGES ( h_pack , sh_pack , I "_phrasebook_heading" ) {
+ c ++; grand_c ++;
+ if (( pass == 1 ) && ( c > 1 )) WRITE ( ", " );
+ if ( pass == 2 ) {
+ IndexUtilities::anchor_numbered ( OUT , grand_c );
+ HTML_OPEN_WITH ( "p" , "class=\"in2\"" );
+ WRITE ( "<b>" );
+ }
+ WRITE ( "%S" , Metadata::read_textual ( h_pack , I "^text" ));
+ if ( pass == 1 ) IndexUtilities::below_link_numbered ( OUT , grand_c );
+ if ( pass == 2 ) {
+ WRITE ( "</b>" );
HTML_CLOSE ( "p" );
- int c = 0 ;
- inter_symbol * wanted_b = PackageTypes::get ( I , I "_phrasebook_heading" );
- LOOP_THROUGH_INTER_CHILDREN ( B , C ) {
- if ( C -> W . data [ ID_IFLD ] == PACKAGE_IST ) {
- inter_package * entry_b = Inter::Package::defined_by_frame ( B );
- if ( Inter::Packages::type ( entry_b ) == wanted_b ) {
- c ++; grand_c ++;
- if (( pass == 1 ) && ( c > 1 )) WRITE ( ", " );
- if ( pass == 2 ) {
- IndexUtilities::anchor_numbered ( OUT , grand_c );
- HTML_OPEN_WITH ( "p" , "class=\"in2\"" );
- WRITE ( "<b>" );
- }
- WRITE ( "%S" , Metadata::read_textual ( entry_b , I "^text" ));
- if ( pass == 1 ) IndexUtilities::below_link_numbered ( OUT , grand_c );
- if ( pass == 2 ) {
- WRITE ( "</b>" );
- HTML_CLOSE ( "p" );
- }
- if ( pass == 2 ) {
- inter_symbol * wanted_c = PackageTypes::get ( I , I "_phrasebook_entry" );
- LOOP_THROUGH_INTER_CHILDREN ( A , B ) {
- if ( C -> W . data [ ID_IFLD ] == PACKAGE_IST ) {
- inter_package * entry_c = Inter::Package::defined_by_frame ( A );
- if ( Inter::Packages::type ( entry_c ) == wanted_c ) {
- WRITE ( "%S" , Metadata::read_textual ( entry_c , I "^text" ));
- }
- }
- }
- }
- }
- }
- }
+ }
+ if ( pass == 2 ) {
+ inter_package * entry_pack ;
+ LOOP_THROUGH_SUBPACKAGES ( entry_pack , h_pack , I "_phrasebook_entry" )
+ WRITE ( "%S" , Metadata::read_textual ( entry_pack , I "^text" ));
}
}
}
diff --git a/docs/index-module/3-pe2.html b/docs/index-module/3-pe2.html
index 462fb19aa..657e086af 100644
--- a/docs/index-module/3-pe2.html
+++ b/docs/index-module/3-pe2.html
@@ -111,38 +111,27 @@ seems natural enough to learn in practice.
ssc -> pack = sc_pack ;
ssc -> no_ends = 0 ;
ssc -> indexed_already = FALSE ;
- inter_symbol * wanted = PackageTypes::get ( I , I "_scene_end" );
- inter_symbol * wanted_within = PackageTypes::get ( I , I "_scene_connector" );
- inter_tree_node * D = Inter::Packages::definition ( sc_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 ) {
- simplified_end * se = CREATE ( simplified_end );
- se -> end_pack = entry ;
- se -> anchor_connectors = NULL ;
- LOOP_THROUGH_INTER_CHILDREN ( B , C ) {
- if ( B -> W . data [ ID_IFLD ] == PACKAGE_IST ) {
- inter_package * inner_entry = Inter::Package::defined_by_frame ( B );
- if ( Inter::Packages::type ( inner_entry ) == wanted_within ) {
- simplified_connector * scon = CREATE ( simplified_connector );
- scon -> con_pack = inner_entry ;
- scon -> next = NULL ;
- if ( se -> anchor_connectors == NULL ) {
- se -> anchor_connectors = scon ;
- } else {
- simplified_connector * last = se -> anchor_connectors ;
- while (( last ) && ( last -> next )) last = last -> next ;
- last -> next = scon ;
- }
- scon -> connect_to = NULL ;
- }
- }
- }
- if ( ssc -> no_ends >= MAX_SCENE_ENDS ) internal_error ( "too many scene ends" );
- ssc -> ends [ ssc -> no_ends ++] = se ;
+ inter_package * end_pack ;
+ LOOP_THROUGH_SUBPACKAGES ( end_pack , sc_pack , I "_scene_end" ) {
+ simplified_end * se = CREATE ( simplified_end );
+ se -> end_pack = end_pack ;
+ se -> anchor_connectors = NULL ;
+ inter_package * con_pack ;
+ LOOP_THROUGH_SUBPACKAGES ( con_pack , end_pack , I "_scene_connector" ) {
+ simplified_connector * scon = CREATE ( simplified_connector );
+ scon -> con_pack = con_pack ;
+ scon -> next = NULL ;
+ if ( se -> anchor_connectors == NULL ) {
+ se -> anchor_connectors = scon ;
+ } else {
+ simplified_connector * last = se -> anchor_connectors ;
+ while (( last ) && ( last -> next )) last = last -> next ;
+ last -> next = scon ;
}
+ scon -> connect_to = NULL ;
}
+ if ( ssc -> no_ends >= MAX_SCENE_ENDS ) internal_error ( "too many scene ends" );
+ ssc -> ends [ ssc -> no_ends ++] = se ;
}
return ssc ;
}
@@ -295,7 +284,7 @@ about and created but never made use of.)
- IndexUtilities::anchor ( OUT , I "SDETAILS" );
+ IndexUtilities::anchor ( OUT , I "SDETAILS" );
simplified_scene * ssc ;
LOOP_OVER ( ssc , simplified_scene ) {
HTML_TAG ( "hr" );
@@ -331,10 +320,9 @@ fact, end.
HTML::open_indented_p ( OUT , 1 , "hanging" );
- IndexUtilities::anchor_numbered ( OUT , ssc -> allocation_id );
+ IndexUtilities::anchor_numbered ( OUT , ssc -> allocation_id );
WRITE ( "<b>The <i>%S</i> scene</b>" , Metadata::read_textual ( ssc -> pack , I "^name" ));
- int at = ( int ) Metadata::read_optional_numeric ( ssc -> pack , I "^at" );
- if ( at > 0 ) IndexUtilities::link ( OUT , at );
+ IndexUtilities::link_package ( OUT , ssc -> pack );
if ( PlotElement::recurs ( ssc )) WRITE ( " <i>recurring</i>" );
HTML_CLOSE ( "p" );
@@ -506,7 +494,7 @@ on the initial call when
if ( mc > 0 ) {
HTML::end_html_table ( OUT );
- if ( open_cat > 1 ) IndexUtilities::extra_div_close ( OUT , "e0e0e0" );
+ if ( open_cat > 1 ) IndexUtilities::extra_div_close ( OUT , "e0e0e0" );
}
This code is used in §1 (twice).
@@ -156,8 +156,7 @@ Helvetica-style lower case "x", but life is full of compromises.
inter_package * entry = Inter::Package::defined_by_frame ( C );
if ( Inter::Packages::type ( entry ) == PackageTypes::get ( I , I "_table_contribution" )) {
if ( ntc ++ > 0 ) WRITE ( " +" );
- int at = ( int ) Metadata::read_optional_numeric ( entry , I "^at" );
- IndexUtilities::link ( OUT , at );
+ IndexUtilities::link_package ( OUT , entry );
}
}
}
diff --git a/docs/index-module/3-te2.html b/docs/index-module/3-te2.html
index 8d9c56f4f..dada149c9 100644
--- a/docs/index-module/3-te2.html
+++ b/docs/index-module/3-te2.html
@@ -101,16 +101,10 @@ function togglePopup(material_id) {
TokensElement::index_tokens_for ( OUT , I , "things inside" , NULL , I "things_token" , NULL );
TokensElement::index_tokens_for ( OUT , I , "things preferably held" , NULL , I "things_token" , NULL );
inter_package * pack = Inter::Packages::by_url ( I , I "/main/completion/grammar" );
- inter_symbol * wanted = PackageTypes::get ( I , I "_command_grammar" );
- 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 ) {
- if ( Metadata::read_optional_numeric ( entry , I "^is_token" ))
- TokensElement::index_tokens_for ( OUT , I , NULL , entry , NULL , NULL );
- }
- }
+ inter_package * cg_pack ;
+ LOOP_THROUGH_SUBPACKAGES ( cg_pack , pack , I "_command_grammar" ) {
+ if ( Metadata::read_optional_numeric ( cg_pack , I "^is_token" ))
+ TokensElement::index_tokens_for ( OUT , I , NULL , cg_pack , NULL , NULL );
}
}
@@ -121,10 +115,7 @@ function togglePopup(material_id) {
if ( special ) WRITE ( "%s" , special );
else if ( defns ) WRITE ( "%S" , Metadata::read_optional_textual ( defns , I "^name" ));
WRITE ( "]\"" );
- if ( defns ) {
- int at = ( int ) Metadata::read_optional_numeric ( defns , I "^at" );
- if ( at > 0 ) IndexUtilities::link ( OUT , at );
- }
+ if ( defns ) IndexUtilities::link_package ( OUT , defns );
if ( Str::len ( help ) > 0 ) IndexUtilities::DocReferences::link ( OUT , help );
if ( explanation ) WRITE ( " - %s" , explanation );
HTML_CLOSE ( "p" );
@@ -132,32 +123,25 @@ function togglePopup(material_id) {
}
void TokensElement::index_list_for_token ( OUTPUT_STREAM , inter_tree * I , inter_package * cg ) {
- inter_symbol * wanted = PackageTypes::get ( I , I "_cg_line" );
- inter_tree_node * D = Inter::Packages::definition ( cg );
int k = 0 ;
- 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 ) {
- text_stream * trueverb = Metadata::read_optional_textual ( entry , I "^true_verb" );
- HTML::open_indented_p ( OUT , 2 , "hanging" );
- if ( k ++ == 0 ) WRITE ( "=" ); else WRITE ( "or" );
- WRITE ( " "" );
- TokensElement::verb_definition ( OUT ,
- Metadata::read_optional_textual ( entry , I "^text" ),
- trueverb , EMPTY_WORDING );
- WRITE ( """ );
- int at = ( int ) Metadata::read_optional_numeric ( entry , I "^at" );
- if ( at > 0 ) IndexUtilities::link ( OUT , at );
- if ( Metadata::read_optional_numeric ( entry , I "^reversed" ))
- WRITE ( " <i>reversed</i>" );
- HTML_CLOSE ( "p" );
- }
- }
+ inter_package * line_pack ;
+ LOOP_THROUGH_SUBPACKAGES ( line_pack , cg , I "_cg_line" ) {
+ text_stream * trueverb = Metadata::read_optional_textual ( line_pack , I "^true_verb" );
+ HTML::open_indented_p ( OUT , 2 , "hanging" );
+ if ( k ++ == 0 ) WRITE ( "=" ); else WRITE ( "or" );
+ WRITE ( " "" );
+ TokensElement::verb_definition ( OUT ,
+ Metadata::read_optional_textual ( line_pack , I "^text" ),
+ trueverb , EMPTY_WORDING );
+ WRITE ( """ );
+ IndexUtilities::link_package ( OUT , line_pack );
+ if ( Metadata::read_optional_numeric ( line_pack , I "^reversed" ))
+ WRITE ( " <i>reversed</i>" );
+ HTML_CLOSE ( "p" );
}
}
-void TokensElement::verb_definition ( OUTPUT_STREAM , text_stream * T , text_stream * trueverb , wording W ) {
+void TokensElement::verb_definition ( OUTPUT_STREAM , text_stream * T , text_stream * trueverb , wording W ) {
int i = 1 ;
if ( Str::len ( T ) < 2 ) return ;
if ( Str::len ( trueverb ) > 0 ) {
diff --git a/docs/index-module/3-ve.html b/docs/index-module/3-ve.html
index f57df42d0..084761d9b 100644
--- a/docs/index-module/3-ve.html
+++ b/docs/index-module/3-ve.html
@@ -91,7 +91,7 @@ function togglePopup(material_id) {
inter_symbol * definition_area = NULL , * current_area = NULL ;
HTML_OPEN ( "p" );
- IndexUtilities::anchor ( OUT , I "NAMES" );
+ IndexUtilities::anchor ( OUT , I "NAMES" );
int understood_note_given = FALSE ;
for ( int i =0; i <TreeLists::len(inv-> variable_nodes ); i ++) {
inter_package * pack = Inter::Package::defined_by_frame ( inv -> variable_nodes -> list [ i ]. node );
@@ -126,16 +126,14 @@ function togglePopup(material_id) {
inter_package * heading_pack = Inter::Packages::container ( definition_area -> definition );
HTML_CLOSE ( "p" );
HTML_OPEN ( "p" );
- IndexUtilities::show_definition_area ( OUT , heading_pack , FALSE );
+ IndexUtilities::show_definition_area ( OUT , heading_pack , FALSE );
}
current_area = definition_area ;
text_stream * name = Metadata::read_optional_textual ( pack , I "^name" );
WRITE ( "%S" , name );
- int at = ( int ) Metadata::read_optional_numeric ( pack , I "^at" );
- if ( at > 0 ) IndexUtilities::link ( OUT , at );
- text_stream * doc = Metadata::read_optional_textual ( pack , I "^documentation" );
- if ( Str::len ( doc ) > 0 ) IndexUtilities::DocReferences::link ( OUT , doc );
+ IndexUtilities::link_package ( OUT , pack );
+ IndexUtilities::link_to_documentation ( OUT , pack );
text_stream * contents = Metadata::read_optional_textual ( pack , I "^contents" );
WRITE ( " - <i>%S</i>" , contents );
HTML_TAG ( "br" );
diff --git a/docs/index-module/3-ve2.html b/docs/index-module/3-ve2.html
index f5fcf83b0..b4e3641e7 100644
--- a/docs/index-module/3-ve2.html
+++ b/docs/index-module/3-ve2.html
@@ -88,13 +88,12 @@ function togglePopup(material_id) {
( lex -> part_of_speech == PREP_TLEXE )) {
text_stream * entry_text = lex -> lemma ;
HTML_OPEN_WITH ( "p" , "class=\"hang\"" );
- IndexUtilities::anchor_numbered ( OUT , 10000 + verb_count ++);
+ IndexUtilities::anchor_numbered ( OUT , 10000 + verb_count ++);
if ( lex -> part_of_speech == VERB_TLEXE ) WRITE ( "To <b>%S</b>" , entry_text );
else if ( lex -> part_of_speech == MVERB_TLEXE ) WRITE ( "To <b>%S</b>" , entry_text );
else if ( lex -> part_of_speech == PREP_TLEXE ) WRITE ( "To be <b>%S</b>" , entry_text );
else WRITE ( "To be able to <b>%S</b>" , entry_text );
- int at = ( int ) Metadata::read_optional_numeric ( lex -> lex_package , I "^at" );
- if ( at > 0 ) IndexUtilities::link ( OUT , at );
+ IndexUtilities::link_package ( OUT , lex -> lex_package );
if ( lex -> part_of_speech == MVERB_TLEXE ) WRITE ( " ... for saying only" );
else WRITE ( " ... <i>%S</i>" , Metadata::read_optional_textual ( lex -> lex_package , I "^meaning" ));
HTML_CLOSE ( "p" );
diff --git a/docs/index-module/4-rhm.html b/docs/index-module/4-rhm.html
index e641fc7bb..7bfa38686 100644
--- a/docs/index-module/4-rhm.html
+++ b/docs/index-module/4-rhm.html
@@ -745,7 +745,7 @@ that the grids are calculated, the region colours decided, and so on.
void PL::HTMLMap::render_single_room_as_HTML ( OUTPUT_STREAM , faux_instance * R ) {
WRITE ( "\n\n" );
HTML_OPEN ( "p" );
- IndexUtilities::anchor ( OUT , R -> anchor_text );
+ IndexUtilities::anchor ( OUT , R -> anchor_text );
HTML_TAG_WITH ( "a" , "name=wo_%d" , R -> allocation_id );
HTML::begin_plain_html_table ( OUT );
HTML::first_html_column ( OUT , 0 );
diff --git a/inform7/Figures/memory-diagnostics.txt b/inform7/Figures/memory-diagnostics.txt
index c9b0807e7..a5965833d 100644
--- a/inform7/Figures/memory-diagnostics.txt
+++ b/inform7/Figures/memory-diagnostics.txt
@@ -1,4 +1,4 @@
-Total memory consumption was 391661K = 382 MB
+Total memory consumption was 391667K = 382 MB
60.4% was used for 1994926 objects, in 371045 frames in 296 x 800K = 236800K = 231 MB:
@@ -236,7 +236,7 @@ Total memory consumption was 391661K = 382 MB
39.5% was used for memory not allocated for objects:
- 20.6% text stream storage 82735296 bytes in 530462 claims
+ 20.6% text stream storage 82741540 bytes in 530498 claims
4.5% dictionary storage 18153472 bytes in 33229 claims
---- sorting 744 bytes in 3 claims
1.7% source text 7200000 bytes in 3 claims
diff --git a/inform7/Figures/timings-diagnostics.txt b/inform7/Figures/timings-diagnostics.txt
index c6042ba8a..674c4e4ac 100644
--- a/inform7/Figures/timings-diagnostics.txt
+++ b/inform7/Figures/timings-diagnostics.txt
@@ -1,9 +1,9 @@
100.0% in inform7 run
55.6% in compilation to Inter
39.8% in //Sequence::undertake_queued_tasks//
- 3.6% in //MajorNodes::pre_pass//
+ 3.5% in //MajorNodes::pre_pass//
2.6% in //MajorNodes::pass_1//
- 2.1% in //RTPhrasebook::compile_entries//
+ 2.0% in //RTPhrasebook::compile_entries//
1.4% in //ImperativeDefinitions::assess_all//
1.1% in //RTKindConstructors::compile//
0.4% in //ImperativeDefinitions::compile_first_block//
@@ -18,11 +18,11 @@
0.1% in //World::stages_II_and_III//
1.7% not specifically accounted for
42.2% in running Inter pipeline
- 11.0% in step preparation
- 10.0% in inter step 7/14: consolidate-text
- 8.2% in inter step 2/14: link
- 7.1% in inter step 14/14: generate inform6 -> auto.inf
- 1.5% in inter step 10/14: make-identifiers-unique
+ 11.2% in step preparation
+ 9.8% in inter step 7/14: consolidate-text
+ 8.1% in inter step 2/14: link
+ 7.2% in inter step 14/14: generate inform6 -> auto.inf
+ 1.6% in inter step 10/14: make-identifiers-unique
0.4% in inter step 11/14: reconcile-verbs
0.2% in inter step 13/14: eliminate-redundant-operations
0.2% in inter step 6/14: assimilate
diff --git a/inform7/Internal/Languages/English/Index.txt b/inform7/Internal/Languages/English/Index.txt
index 9e6427a4d..c62ef1828 100644
--- a/inform7/Internal/Languages/English/Index.txt
+++ b/inform7/Internal/Languages/English/Index.txt
@@ -44,6 +44,13 @@
%Index.Elements.Cm.Title = Commands
%Index.Elements.Cm.Heading = Commands which the player can type|About commands
+%Index.Elements.Cm.Command = a command for controlling play
+%Index.Elements.Cm.TestingCommand = a testing command not available in the final game
+%Index.Elements.Cm.DirectionCommand = going
+
+%Index.Elements.Cm.Alias = same as
+%Index.Elements.Cm.Reversed = reversed
+
%Index.Elements.To.Title = Tokens
%Index.Elements.To.Heading = Those square-bracketed pieces inside Understand grammar|About tokens; New tokens
@@ -53,6 +60,54 @@
%Index.Elements.Ch.Title = Chart
%Index.Elements.Ch.Heading = A chart of all the kinds|About kinds; New kinds of object; Other new kinds
+%Index.Elements.Ch.BasicKinds = basic kinds
+%Index.Elements.Ch.NewKinds = making new kinds from old
+%Index.Elements.Ch.Plural = plural
+
+%Index.Elements.Ch.DefaultColumn = default value
+%Index.Elements.Ch.RepeatColumn = repeat
+%Index.Elements.Ch.PropsColumn = props
+%Index.Elements.Ch.UnderColumn = under
+
+%Index.Elements.Ch.DefaultGloss =
+ The default value is used when we make something like
+ a variable but don't tell Inform what its value is. For instance, if
+ we write 'Zero hour is a time that varies', but don't tell Inform
+ anything specific like 'Zero hour is 11:21 PM.', then Inform uses
+ the value in the table above to decide what it will be.
+ The same applies if we create a property (for instance, 'A person
+ has a number called lucky number.'). Kinds of value not included
+ in the table cannot be used in variables and properties.
+%Index.Elements.Ch.RepeatGloss =
+ A tick for repeat means that it's possible to
+ repeat through values of this kind. For instance, 'repeat with T
+ running through times:' is allowed, but 'repeat with N running
+ through numbers:' is not - there are too many numbers for this to
+ make sense. A tick here also means it's possible to form lists such
+ as 'list of rulebooks', or to count the 'number of scenes'.
+%Index.Elements.Ch.PropsGloss =
+ A tick for props means that values of this
+ kind can have properties. For instance, 'A scene can be thrilling or
+ dull.' makes an either/or property of a scene, but 'A number can be
+ nice or nasty.' is not allowed because it would cost too much storage
+ space. (Of course 'Definition:' can always be used to make adjectives
+ applying to numbers; it's only properties which have storage
+ worries.)
+%Index.Elements.Ch.UnderGloss =
+ A tick for under means that it's possible
+ to understand values of this kind. For instance, 'Understand "award
+ [number]" as awarding.' might be allowed, if awarding were an action
+ applying to a number, but 'Understand "run [rule]" as rule-running.'
+ is not allowed - there are so many rules with such long names that
+ Inform doesn't add them to its vocabulary during play.
+%Index.Elements.Ch.CovarianceGloss =
+ Covariance means that if K is a kind of L, then something
+ you make from K can be used as the same thing made from L. For example,
+ a list of doors can be used as a list of things, because 'list of K' is
+ covariant. Contravariance means it works the other way round.
+ For example, an activity on things can be used as an activity on doors,
+ but not vice versa, because 'activity of K' is contravariant.
+
%Index.Elements.Ar.Title = Arithmetic
%Index.Elements.Ar.Heading = Which values can be added up, multiplied and so on|About arithmetic
diff --git a/inform7/Tests/Test Internals/_Results_Ideal/Index-Chart.txt b/inform7/Tests/Test Internals/_Results_Ideal/Index-Chart.txt
index e2ac68d70..175dc3dfc 100644
--- a/inform7/Tests/Test Internals/_Results_Ideal/Index-Chart.txt
+++ b/inform7/Tests/Test Internals/_Results_Ideal/Index-Chart.txt
@@ -1,5 +1,4 @@
1. Ch
-
@@ -30,25 +29,48 @@
- The default value is used when we make something like a variable but don't tell Inform what its value is. For instance, if we write 'Zero hour is a time that varies', but don't tell Inform anything specific like 'Zero hour is 11:21 PM.', then Inform uses the value in the table above to decide what it will be. The same applies if we create a property (for instance, 'A person has a number called lucky number.'). Kinds of value not included in the table cannot be used in variables and properties.
+ The default value is used when we make something like
+ a variable but don't tell Inform what its value is. For instance, if
+ we write 'Zero hour is a time that varies', but don't tell Inform
+ anything specific like 'Zero hour is 11:21 PM.', then Inform uses
+ the value in the table above to decide what it will be.
+ The same applies if we create a property (for instance, 'A person
+ has a number called lucky number.'). Kinds of value not included
+ in the table cannot be used in variables and properties.
- A tick for repeat means that it's possible to repeat through values of this kind. For instance, 'repeat with T running through times:' is allowed, but 'repeat with N running through numbers:' is not - there are too many numbers for this to make sense. A tick here also means it's possible to form lists such as 'list of rulebooks', or to count the 'number of scenes'.
+ A tick for repeat means that it's possible to
+ repeat through values of this kind. For instance, 'repeat with T
+ running through times:' is allowed, but 'repeat with N running
+ through numbers:' is not - there are too many numbers for this to
+ make sense. A tick here also means it's possible to form lists such
+ as 'list of rulebooks', or to count the 'number of scenes'.
- A tick for props means that values of this kind can have properties. For instance, 'A scene can be thrilling or dull.' makes an either/or property of a scene, but 'A number can be nice or nasty.' is not allowed because it would cost too much storage space. (Of course 'Definition:' can always be used to make adjectives applying to numbers; it's only properties which have storage worries.)
+ A tick for props means that values of this
+ kind can have properties. For instance, 'A scene can be thrilling or
+ dull.' makes an either/or property of a scene, but 'A number can be
+ nice or nasty.' is not allowed because it would cost too much storage
+ space. (Of course 'Definition:' can always be used to make adjectives
+ applying to numbers; it's only properties which have storage
+ worries.)
- A tick for under means that it's possible to understand values of this kind. For instance, 'Understand "award [number]" as awarding.' might be allowed, if awarding were an action applying to a number, but 'Understand "run [rule]" as rule-running.' is not allowed - there are so many rules with such long names that Inform doesn't add them to its vocabulary during play.
+ A tick for under means that it's possible
+ to understand values of this kind. For instance, 'Understand "award
+ [number]" as awarding.' might be allowed, if awarding were an action
+ applying to a number, but 'Understand "run [rule]" as rule-running.'
+ is not allowed - there are so many rules with such long names that
+ Inform doesn't add them to its vocabulary during play.
@@ -1028,8 +1050,8 @@ and southwest, for instance; down and up.
Usually unmarked for listing not marked for listing.
Can have opposite (direction ).
- 12 directions
-