diff --git a/docs/codegen-module/2-itr.html b/docs/codegen-module/2-itr.html index 5f2cd2c90..657fae5f2 100644 --- a/docs/codegen-module/2-itr.html +++ b/docs/codegen-module/2-itr.html @@ -144,10 +144,10 @@ stages — before and after — they are accumulated. #endif LOGIF(TEMPLATE_READING, "Intervention at stage %d Segment %S Part %S\n", stage, segment, part); if (i6ti->I6T_matter) { - TemplateReader::interpret(OUT, i6ti->I6T_matter, NULL, -1, kit); + TemplateReader::interpret(OUT, i6ti->I6T_matter, NULL, -1, kit, NULL); } if (Str::len(i6ti->alternative_segment) > 0) - TemplateReader::interpret(OUT, NULL, i6ti->alternative_segment, -1, kit); + TemplateReader::interpret(OUT, NULL, i6ti->alternative_segment, -1, kit, NULL); if (stage == 0) rv = TRUE; } return rv; @@ -313,7 +313,7 @@ and therefore no interventions will have happened.)
     void TemplateReader::extract(text_stream *template_file, I6T_kit *kit) {
         text_stream *SP = Str::new();
-        TemplateReader::interpret(SP, NULL, template_file, -1, kit);
+        TemplateReader::interpret(SP, NULL, template_file, -1, kit, NULL);
         (*(kit->raw_callback))(SP, kit);
     }
 
@@ -323,27 +323,23 @@ and therefore no interventions will have happened.)
     } contents_section_state;
 
     void TemplateReader::interpret(OUTPUT_STREAM, text_stream *sf,
-        text_stream *segment_name, int N_escape, I6T_kit *kit) {
+        text_stream *segment_name, int N_escape, I6T_kit *kit, filename *Input_Filename) {
         if (Str::eq(segment_name, I"all")) {
             for (int area=0; area<kit->no_i6t_file_areas; area++) {
                 pathname *P = Pathnames::up(kit->i6t_files[area]);
-                filename *F = Filenames::in_folder(P, I"Contents.w");
-                if (TextFiles::exists(F)) {
-                    contents_section_state CSS;
-                    CSS.active = FALSE;
-                    CSS.sects = NEW_LINKED_LIST(text_stream);
-                    TextFiles::read(F, FALSE,
-                        NULL, FALSE, TemplateReader::read_contents, NULL, (void *) &CSS);
-                    text_stream *segment;
-                    LOOP_OVER_LINKED_LIST(segment, text_stream, CSS.sects)
-                        TemplateReader::interpret(OUT, sf, segment, N_escape, kit);
-                    return;
+                web_md *Wm = WebMetadata::get(P, NULL, V2_SYNTAX, NULL, FALSE, TRUE, NULL);
+                chapter_md *Cm;
+                LOOP_OVER_LINKED_LIST(Cm, chapter_md, Wm->chapters_md) {
+                    section_md *Sm;
+                    LOOP_OVER_LINKED_LIST(Sm, section_md, Cm->sections_md) {
+                        filename *SF = Sm->source_file_for_section;
+                        TemplateReader::interpret(OUT, sf, Sm->sect_title, N_escape, kit, SF);
+                    }
                 }
             }
             TemplateReader::error("unable to find a contents section to read 'all'", I"Contents.w");
             return;
         }
-        FILE *Input_File = NULL;
         TEMPORARY_TEXT(heading_name);
         int skip_part = FALSE, comment = TRUE;
         int col = 1, cr, sfp = 0;
@@ -354,7 +350,8 @@ and therefore no interventions will have happened.)
             (TemplateReader::I6T_file_intervene(OUT, INSTEAD_LINK_STAGE, segment_name, NULL, kit)))
             goto OmitFile;
 
-        if (Str::len(segment_name) > 0) {
+        FILE *Input_File = NULL;
+        if ((Str::len(segment_name) > 0) || (Input_Filename)) {
             <Open the I6 template file 10.1>;
             comment = TRUE;
         } else comment = FALSE;
@@ -392,7 +389,8 @@ part of the I6T kit.
 
 
 
-        Input_File = NULL;
+        if (Input_Filename)
+            Input_File = Filenames::fopen(Input_Filename, "r");
         for (int area=0; area<kit->no_i6t_file_areas; area++)
             if (Input_File == NULL)
                 Input_File = Filenames::fopen(
@@ -717,7 +715,7 @@ safely between {-open-index}<
         if (Str::eq_wide_string(command, L"segment")) {
             (*(kit->raw_callback))(OUT, kit);
             Str::clear(OUT);
-            TemplateReader::interpret(OUT, NULL, argument, -1, kit);
+            TemplateReader::interpret(OUT, NULL, argument, -1, kit, NULL);
             (*(kit->raw_callback))(OUT, kit);
             Str::clear(OUT);
             continue;
@@ -747,7 +745,7 @@ safely between {-open-index}<
 
 

-

The function TemplateReader::read_contents is used in §10.

+

The function TemplateReader::read_contents appears nowhere else.

§12. Template errors. Errors here used to be basically failed assertions, but inevitably people reported that as a bug (0001596). It was never intended that I6T coding diff --git a/docs/inpolicy/2-pc.html b/docs/inpolicy/2-pc.html index 526affaa6..c917f97c7 100644 --- a/docs/inpolicy/2-pc.html +++ b/docs/inpolicy/2-pc.html @@ -35,7 +35,7 @@

To see which problem messages have test cases and which are linked to the documentation.

-
+

§1. Observation. Problem messages are identified by their code-names, e.g., PM_MisplacedFrom; those names should be unique, but any number of problems can instead be @@ -99,7 +99,7 @@ and augment its bitmap of known contexts:

-

The function Coverage::observe_problem is used in §3, §4, §7.

+

The function Coverage::observe_problem is used in §3, §4, §6.

§3. Problems which have test cases. Here we ask Intest to produce a roster of all known test cases, then parse this back to look for cases whose names have the PM_... format. Those are @@ -129,7 +129,7 @@ the problem message test cases, so we observe them.

-

The function Coverage::which_problems_have_test_cases is used in §8.1.

+

The function Coverage::which_problems_have_test_cases is used in §7.1.

The function Coverage::test_case_harvester appears nowhere else.

@@ -160,88 +160,45 @@ to problem messages:

-

The function Coverage::which_problems_are_referenced is used in §8.1.

+

The function Coverage::which_problems_are_referenced is used in §7.1.

The function Coverage::xref_harvester appears nowhere else.

-

§5. Problems generated in the I7 source. Which is to say, actually existing problem messages. Ideally, this code -should find the modules included in Inform in some more sophisticated way. +

§5. Problems generated in the I7 source. Which is to say, actually existing problem messages.

     void Coverage::which_problems_exist(void) {
-        Coverage::which_problems_exist_inner(Pathnames::from_text(I"inform7"));
-        Coverage::which_problems_exist_inner(Pathnames::from_text(I"inform7/core-module"));
-        Coverage::which_problems_exist_inner(Pathnames::from_text(I"inform7/if-module"));
-        Coverage::which_problems_exist_inner(Pathnames::from_text(I"inform7/multimedia-module"));
-        Coverage::which_problems_exist_inner(Pathnames::from_text(I"inter/codegen-module"));
-    }
-
- -

- -

The function Coverage::which_problems_exist is used in §8.1.

- -

§6. So now we have to read the contents page of a web, to see what section -files it contains: -

- - -
-    typedef struct existence_state {
-        struct pathname *web_path;
-        struct pathname *chapter_path;
-        struct filename *section;
-    } existence_state;
-
-    void Coverage::which_problems_exist_inner(pathname *D) {
-        filename *C = Filenames::in_folder(D, I"Contents.w");
-        existence_state es;
-        es.web_path = D;
-        es.chapter_path = NULL;
-        TextFiles::read(C, FALSE, "unable to read contents page of 'inform7' web", TRUE,
-            &Coverage::section_harvester, NULL, &es);
-    }
-
-    void Coverage::section_harvester(text_stream *text, text_file_position *tfp, void *state) {
-        existence_state *es = (existence_state *) state;
-        match_results mr = Regexp::create_mr();
-        if (Regexp::match(&mr, text, L"(Chapter %d+)%c+"))
-            es->chapter_path = Pathnames::subfolder(es->web_path, mr.exp[0]);
-        if (Regexp::match(&mr, text, L"Appendix%c+")) es->chapter_path = NULL;
-        if (Regexp::match(&mr, text, L"Preliminaries%c+")) es->chapter_path = NULL;
-        if ((es->chapter_path) && (Regexp::match(&mr, text, L" (%c+?) *"))) {
-            TEMPORARY_TEXT(leaf);
-            Str::copy(leaf, mr.exp[0]);
-            if (Regexp::match(&mr, leaf, L"(%c+?) %[%[%c+")) Str::copy(leaf, mr.exp[0]);
-            WRITE_TO(leaf, ".w");
-            es->section = Filenames::in_folder(es->chapter_path, leaf);
-            DISCARD_TEXT(leaf);
-            TextFiles::read(es->section, FALSE, "unable to read section page from 'inform7' web", TRUE,
-                &Coverage::existence_harvester, NULL, es);
+        pathname *tools = Pathnames::up(path_to_inpolicy);
+        pathname *path_to_inweb = Pathnames::subfolder(Pathnames::up(tools), I"inweb");
+        pathname *path_to_inform7 = Pathnames::subfolder(tools, I"inform7");
+        web_md *Wm = WebMetadata::get(path_to_inform7, NULL, V2_SYNTAX,
+                        NULL, FALSE, TRUE, path_to_inweb);
+        chapter_md *Cm;
+        LOOP_OVER_LINKED_LIST(Cm, chapter_md, Wm->chapters_md) {
+            section_md *Sm;
+            LOOP_OVER_LINKED_LIST(Sm, section_md, Cm->sections_md) {
+                filename *SF = Sm->source_file_for_section;
+                TextFiles::read(SF, FALSE, "unable to read section page from 'inform7'",
+                    TRUE, &Coverage::existence_harvester, NULL, (void *) SF);
+            }
         }
-        Regexp::dispose_of(&mr);
     }
 

-

The function Coverage::which_problems_exist_inner is used in §5.

+

The function Coverage::which_problems_exist is used in §7.1.

-

The function Coverage::section_harvester appears nowhere else.

- -

The structure existence_state is private to this section.

- -

§7. So now we're working through individual section files. The exclusion of -the case called sigil throws out a macro definition in the source code, -not a specific problem case. +

§6. So now we have to read a section, looking for the existence of problem +messages:

     void Coverage::existence_harvester(text_stream *text, text_file_position *tfp, void *state) {
-        existence_state *es = (existence_state *) state;
+        filename *SF = (filename *) state;
         match_results mr = Regexp::create_mr();
         while (Regexp::match(&mr, text, L"(%c*?)_p_%((%c+?)%)(%c*)")) {
             Str::clear(text);
@@ -252,13 +209,13 @@ not a specific problem case.
             int context = CODE_MENTIONS_PCON;
             if (Str::eq(name, I"BelievedImpossible")) {
                 context = IMPOSSIBLE_PCON;
-                WRITE_TO(name, "_%f_line%d", es->section, tfp->line_count);
+                WRITE_TO(name, "_%f_line%d", SF, tfp->line_count);
             } else if (Str::eq(name, I"Untestable")) {
                 context = UNTESTABLE_PCON;
-                WRITE_TO(name, "_%f_line%d", es->section, tfp->line_count);
+                WRITE_TO(name, "_%f_line%d", SF, tfp->line_count);
             } else if (Str::eq(name, I"...")) {
                 context = NAMELESS_PCON;
-                WRITE_TO(name, "_%f_line%d", es->section, tfp->line_count);
+                WRITE_TO(name, "_%f_line%d", SF, tfp->line_count);
             }
             Coverage::observe_problem(name, context);
             DISCARD_TEXT(name);
@@ -269,9 +226,9 @@ not a specific problem case.
 
 

-

The function Coverage::existence_harvester is used in §6.

+

The function Coverage::existence_harvester is used in §5.

-

§8. Checking. So the actual policy-enforcement routine is here: +

§7. Checking. So the actual policy-enforcement routine is here:

@@ -279,12 +236,12 @@ not a specific problem case. int observations_made = FALSE; int Coverage::check(OUTPUT_STREAM) { if (observations_made == FALSE) { - <Perform the observations 8.1>; + <Perform the observations 7.1>; observations_made = TRUE; } int all_is_well = TRUE; - <Report and decide how grave the situation is 8.2>; + <Report and decide how grave the situation is 7.2>; if (all_is_well) WRITE("All is well.\n"); else WRITE("This needs attention.\n"); WRITE("\n"); @@ -296,8 +253,8 @@ not a specific problem case.

The function Coverage::check is used in 1/mn (§2).

-

§8.1. -<Perform the observations 8.1> = +

§7.1. +<Perform the observations 7.1> =

@@ -309,14 +266,14 @@ not a specific problem case.

-

This code is used in §8.

+

This code is used in §7.

-

§8.2. Okay, so that's all of the scanning done; now to report on it. +

§7.2. Okay, so that's all of the scanning done; now to report on it.

-<Report and decide how grave the situation is 8.2> = +<Report and decide how grave the situation is 7.2> =

@@ -372,9 +329,9 @@ not a specific problem case.

-

This code is used in §8.

+

This code is used in §7.

-

§9.

+

§8.

@@ -403,9 +360,9 @@ not a specific problem case.
 
 

-

The function Coverage::cite is used in §8.2.

+

The function Coverage::cite is used in §7.2.

-

The function Coverage::list is used in §8.2.

+

The function Coverage::list is used in §7.2.


diff --git a/inpolicy/Chapter 2/Problem Coverage.w b/inpolicy/Chapter 2/Problem Coverage.w index 653213e31..3e8b025dc 100644 --- a/inpolicy/Chapter 2/Problem Coverage.w +++ b/inpolicy/Chapter 2/Problem Coverage.w @@ -99,64 +99,32 @@ void Coverage::xref_harvester(text_stream *text, text_file_position *tfp, void * } @h Problems generated in the I7 source. -Which is to say, actually existing problem messages. Ideally, this code -should find the modules included in Inform in some more sophisticated way. +Which is to say, actually existing problem messages. = void Coverage::which_problems_exist(void) { - Coverage::which_problems_exist_inner(Pathnames::from_text(I"inform7")); - Coverage::which_problems_exist_inner(Pathnames::from_text(I"inform7/core-module")); - Coverage::which_problems_exist_inner(Pathnames::from_text(I"inform7/if-module")); - Coverage::which_problems_exist_inner(Pathnames::from_text(I"inform7/multimedia-module")); - Coverage::which_problems_exist_inner(Pathnames::from_text(I"inter/codegen-module")); -} - -@ So now we have to read the contents page of a web, to see what section -files it contains: - -= -typedef struct existence_state { - struct pathname *web_path; - struct pathname *chapter_path; - struct filename *section; -} existence_state; - -void Coverage::which_problems_exist_inner(pathname *D) { - filename *C = Filenames::in_folder(D, I"Contents.w"); - existence_state es; - es.web_path = D; - es.chapter_path = NULL; - TextFiles::read(C, FALSE, "unable to read contents page of 'inform7' web", TRUE, - &Coverage::section_harvester, NULL, &es); -} - -void Coverage::section_harvester(text_stream *text, text_file_position *tfp, void *state) { - existence_state *es = (existence_state *) state; - match_results mr = Regexp::create_mr(); - if (Regexp::match(&mr, text, L"(Chapter %d+)%c+")) - es->chapter_path = Pathnames::subfolder(es->web_path, mr.exp[0]); - if (Regexp::match(&mr, text, L"Appendix%c+")) es->chapter_path = NULL; - if (Regexp::match(&mr, text, L"Preliminaries%c+")) es->chapter_path = NULL; - if ((es->chapter_path) && (Regexp::match(&mr, text, L" (%c+?) *"))) { - TEMPORARY_TEXT(leaf); - Str::copy(leaf, mr.exp[0]); - if (Regexp::match(&mr, leaf, L"(%c+?) %[%[%c+")) Str::copy(leaf, mr.exp[0]); - WRITE_TO(leaf, ".w"); - es->section = Filenames::in_folder(es->chapter_path, leaf); - DISCARD_TEXT(leaf); - TextFiles::read(es->section, FALSE, "unable to read section page from 'inform7' web", TRUE, - &Coverage::existence_harvester, NULL, es); + pathname *tools = Pathnames::up(path_to_inpolicy); + pathname *path_to_inweb = Pathnames::subfolder(Pathnames::up(tools), I"inweb"); + pathname *path_to_inform7 = Pathnames::subfolder(tools, I"inform7"); + web_md *Wm = WebMetadata::get(path_to_inform7, NULL, V2_SYNTAX, + NULL, FALSE, TRUE, path_to_inweb); + chapter_md *Cm; + LOOP_OVER_LINKED_LIST(Cm, chapter_md, Wm->chapters_md) { + section_md *Sm; + LOOP_OVER_LINKED_LIST(Sm, section_md, Cm->sections_md) { + filename *SF = Sm->source_file_for_section; + TextFiles::read(SF, FALSE, "unable to read section page from 'inform7'", + TRUE, &Coverage::existence_harvester, NULL, (void *) SF); + } } - Regexp::dispose_of(&mr); } -@ So now we're working through individual section files. The exclusion of -the case called |sigil| throws out a macro definition in the source code, -not a specific problem case. +@ So now we have to read a section, looking for the existence of problem +messages: = void Coverage::existence_harvester(text_stream *text, text_file_position *tfp, void *state) { - existence_state *es = (existence_state *) state; + filename *SF = (filename *) state; match_results mr = Regexp::create_mr(); while (Regexp::match(&mr, text, L"(%c*?)_p_%((%c+?)%)(%c*)")) { Str::clear(text); @@ -167,13 +135,13 @@ void Coverage::existence_harvester(text_stream *text, text_file_position *tfp, v int context = CODE_MENTIONS_PCON; if (Str::eq(name, I"BelievedImpossible")) { context = IMPOSSIBLE_PCON; - WRITE_TO(name, "_%f_line%d", es->section, tfp->line_count); + WRITE_TO(name, "_%f_line%d", SF, tfp->line_count); } else if (Str::eq(name, I"Untestable")) { context = UNTESTABLE_PCON; - WRITE_TO(name, "_%f_line%d", es->section, tfp->line_count); + WRITE_TO(name, "_%f_line%d", SF, tfp->line_count); } else if (Str::eq(name, I"...")) { context = NAMELESS_PCON; - WRITE_TO(name, "_%f_line%d", es->section, tfp->line_count); + WRITE_TO(name, "_%f_line%d", SF, tfp->line_count); } Coverage::observe_problem(name, context); DISCARD_TEXT(name); diff --git a/inter/codegen-module/Chapter 2/Template Reader.w b/inter/codegen-module/Chapter 2/Template Reader.w index 64676449a..a2c8e6f80 100644 --- a/inter/codegen-module/Chapter 2/Template Reader.w +++ b/inter/codegen-module/Chapter 2/Template Reader.w @@ -71,10 +71,10 @@ int TemplateReader::I6T_file_intervene(OUTPUT_STREAM, int stage, text_stream *se #endif LOGIF(TEMPLATE_READING, "Intervention at stage %d Segment %S Part %S\n", stage, segment, part); if (i6ti->I6T_matter) { - TemplateReader::interpret(OUT, i6ti->I6T_matter, NULL, -1, kit); + TemplateReader::interpret(OUT, i6ti->I6T_matter, NULL, -1, kit, NULL); } if (Str::len(i6ti->alternative_segment) > 0) - TemplateReader::interpret(OUT, NULL, i6ti->alternative_segment, -1, kit); + TemplateReader::interpret(OUT, NULL, i6ti->alternative_segment, -1, kit, NULL); if (stage == 0) rv = TRUE; } return rv; @@ -200,7 +200,7 @@ and therefore no interventions will have happened.) = void TemplateReader::extract(text_stream *template_file, I6T_kit *kit) { text_stream *SP = Str::new(); - TemplateReader::interpret(SP, NULL, template_file, -1, kit); + TemplateReader::interpret(SP, NULL, template_file, -1, kit, NULL); (*(kit->raw_callback))(SP, kit); } @@ -210,27 +210,23 @@ typedef struct contents_section_state { } contents_section_state; void TemplateReader::interpret(OUTPUT_STREAM, text_stream *sf, - text_stream *segment_name, int N_escape, I6T_kit *kit) { + text_stream *segment_name, int N_escape, I6T_kit *kit, filename *Input_Filename) { if (Str::eq(segment_name, I"all")) { for (int area=0; areano_i6t_file_areas; area++) { pathname *P = Pathnames::up(kit->i6t_files[area]); - filename *F = Filenames::in_folder(P, I"Contents.w"); - if (TextFiles::exists(F)) { - contents_section_state CSS; - CSS.active = FALSE; - CSS.sects = NEW_LINKED_LIST(text_stream); - TextFiles::read(F, FALSE, - NULL, FALSE, TemplateReader::read_contents, NULL, (void *) &CSS); - text_stream *segment; - LOOP_OVER_LINKED_LIST(segment, text_stream, CSS.sects) - TemplateReader::interpret(OUT, sf, segment, N_escape, kit); - return; + web_md *Wm = WebMetadata::get(P, NULL, V2_SYNTAX, NULL, FALSE, TRUE, NULL); + chapter_md *Cm; + LOOP_OVER_LINKED_LIST(Cm, chapter_md, Wm->chapters_md) { + section_md *Sm; + LOOP_OVER_LINKED_LIST(Sm, section_md, Cm->sections_md) { + filename *SF = Sm->source_file_for_section; + TemplateReader::interpret(OUT, sf, Sm->sect_title, N_escape, kit, SF); + } } } TemplateReader::error("unable to find a contents section to read 'all'", I"Contents.w"); return; } - FILE *Input_File = NULL; TEMPORARY_TEXT(heading_name); int skip_part = FALSE, comment = TRUE; int col = 1, cr, sfp = 0; @@ -241,7 +237,8 @@ void TemplateReader::interpret(OUTPUT_STREAM, text_stream *sf, (TemplateReader::I6T_file_intervene(OUT, INSTEAD_LINK_STAGE, segment_name, NULL, kit))) goto OmitFile; - if (Str::len(segment_name) > 0) { + FILE *Input_File = NULL; + if ((Str::len(segment_name) > 0) || (Input_Filename)) { @; comment = TRUE; } else comment = FALSE; @@ -263,7 +260,8 @@ void TemplateReader::interpret(OUTPUT_STREAM, text_stream *sf, part of the I6T kit. @ = - Input_File = NULL; + if (Input_Filename) + Input_File = Filenames::fopen(Input_Filename, "r"); for (int area=0; areano_i6t_file_areas; area++) if (Input_File == NULL) Input_File = Filenames::fopen( @@ -486,7 +484,7 @@ safely between |{-open-index}| and |{-close-index}|. if (Str::eq_wide_string(command, L"segment")) { (*(kit->raw_callback))(OUT, kit); Str::clear(OUT); - TemplateReader::interpret(OUT, NULL, argument, -1, kit); + TemplateReader::interpret(OUT, NULL, argument, -1, kit, NULL); (*(kit->raw_callback))(OUT, kit); Str::clear(OUT); continue; diff --git a/scripts/makescript.txt b/scripts/makescript.txt index b21416003..a6d532d8b 100644 --- a/scripts/makescript.txt +++ b/scripts/makescript.txt @@ -66,50 +66,18 @@ INBUILDX = inbuild/Tangled/inbuild # After its declaration, we list all modules needed to compile the tool. {tool} INBLORB inblorb inblorb -{dep} INBLORB on FOUNDATION {tool} INDOC indoc indoc -{dep} INDOC on FOUNDATION {tool} INFORM7 inform7 inform7 -{dep} INFORM7 on FOUNDATION -{dep} INFORM7 on WORDS -{dep} INFORM7 on INFLECTIONS -{dep} INFORM7 on SYNTAX -{dep} INFORM7 on LINGUISTICS -{dep} INFORM7 on KINDS -{dep} INFORM7 on PROBLEMS -{dep} INFORM7 on CORE -{dep} INFORM7 on IF -{dep} INFORM7 on MULTIMEDIA -{dep} INFORM7 on INDEX -{dep} INFORM7 on HTML -{dep} INFORM7 on ARCH -{dep} INFORM7 on INTER -{dep} INFORM7 on BUILDING -{dep} INFORM7 on CODEGEN -{dep} INFORM7 on INBUILD {tool} INPOLICY inpolicy inpolicy -{dep} INPOLICY on FOUNDATION {tool} INRTPS inrtps inrtps -{dep} INRTPS on FOUNDATION {tool} INBUILDTOOL inbuild inbuild -{dep} INBUILDTOOL on FOUNDATION -{dep} INBUILDTOOL on WORDS -{dep} INBUILDTOOL on SYNTAX -{dep} INBUILDTOOL on HTML -{dep} INBUILDTOOL on ARCH -{dep} INBUILDTOOL on INBUILD {tool} INTERTOOL inter inter -{dep} INTERTOOL on FOUNDATION -{dep} INTERTOOL on ARCH -{dep} INTERTOOL on INTER -{dep} INTERTOOL on BUILDING -{dep} INTERTOOL on CODEGEN # Inform 6 is not a web, so we have to give it special treatment: @@ -118,41 +86,18 @@ INFORM6X = inform6/Tangled/inform6 # While these are also executables, they only provide unit tests for modules: {tool} INFLECTIONSTEST inflections-test inform7/inflections-test -{dep} INFLECTIONSTEST on FOUNDATION -{dep} INFLECTIONSTEST on WORDS -{dep} INFLECTIONSTEST on INFLECTIONS {tool} LINGUISTICSTEST linguistics-test inform7/linguistics-test -{dep} LINGUISTICSTEST on FOUNDATION -{dep} LINGUISTICSTEST on WORDS -{dep} LINGUISTICSTEST on INFLECTIONS -{dep} LINGUISTICSTEST on SYNTAX -{dep} LINGUISTICSTEST on LINGUISTICS {tool} PROBLEMSTEST problems-test inform7/problems-test -{dep} PROBLEMSTEST on FOUNDATION -{dep} PROBLEMSTEST on WORDS -{dep} PROBLEMSTEST on SYNTAX -{dep} PROBLEMSTEST on PROBLEMS {tool} SYNTAXTEST syntax-test inbuild/syntax-test -{dep} SYNTAXTEST on FOUNDATION -{dep} SYNTAXTEST on WORDS -{dep} SYNTAXTEST on SYNTAX {tool} WORDSTEST words-test inbuild/words-test -{dep} WORDSTEST on FOUNDATION -{dep} WORDSTEST on WORDS {tool} BUILDINGTEST building-test inter/building-test -{dep} BUILDINGTEST on FOUNDATION -{dep} BUILDINGTEST on BUILDING -{dep} BUILDINGTEST on INTER -{dep} BUILDINGTEST on WORDS {tool} ARCHTEST arch-test inbuild/arch-test -{dep} ARCHTEST on FOUNDATION -{dep} ARCHTEST on ARCH # ----------------------------------------------------------------------------- # Targets "all" and "force" @@ -181,15 +126,15 @@ inform7/Internal/Languages/English/Syntax.preform: inform7/Tangled/Syntax.prefor # ----------------------------------------------------------------------------- # Each individual tool has its own makefile, stored inside its individual web. # "make makers" runs through each tool in turn and creates this makefile. -# Note the repeatblock feature: the line in the block is repeated once for each +# Note the repeat-tools-block feature: the line in the block is repeated once for each # defined tool. Inside the block, an asterisk expands to the tool's symbol # name: so for example, for inblorb, *WEB would become INBLORBWEB. .PHONY: makers makers: - {repeatblock} + {repeat-tools-block} $(INWEBX) $(*WEB) -makefile $(*MAKER) - {endblock} + {end-block} $(INWEBX) -prototype inform6/makescript.txt -makefile inform6/inform6.mk $(INWEBX) -prototype retrospective/makescript.txt -makefile retrospective/makefile @@ -201,9 +146,9 @@ makers: .PHONY: gitignores gitignores: $(INWEBX) -prototype scripts/gitignorescript.txt -gitignore .gitignore - {repeatblock} + {repeat-tools-block} $(INWEBX) $(*WEB) -gitignore $(*WEB)/.gitignore - {endblock} + {end-block} $(INWEBX) -prototype inform6/gitignorescript.txt -gitignore inform6/.gitignore # ----------------------------------------------------------------------------- @@ -213,9 +158,9 @@ gitignores: .PHONY: versions versions: - {repeatblock} + {repeat-tools-block} $(*X) -version - {endblock} + {end-block} $(INFORM6X) -V # ----------------------------------------------------------------------------- @@ -261,13 +206,13 @@ forcekits: # Note the use of repeat to make a list: $(INBLORBX) $(INDOCX) ..., etc. .PHONY: tools -tools: {repeatspan}$(*X){endspan} $(INFORM6X) +tools: {repeat-tools-span}$(*X){end-span} $(INFORM6X) -{repeatblock} -$(*X): {dependent-files-for}* +{repeat-tools-block} +$(*X): {dependent-files-for-tool}* $(MAKE) -f $(*MAKER) -{endblock} +{end-block} # As ever, Inform 6 needs special handling: @@ -292,10 +237,10 @@ retrospective: .PHONY: forcetools forcetools: - {repeatblock} + {repeat-tools-block} $(MAKE) -f $(*MAKER) force $(MAKE) -f inform6/inform6.mk force - {endblock} + {end-block} # ----------------------------------------------------------------------------- # Target "check" @@ -309,9 +254,9 @@ forcetools: check: $(MAKE) -f inform6/inform6.mk test $(INPOLICYX) -silence -check-problems - {repeatblock} + {repeat-tools-block} $(MAKE) -f $(*MAKER) test - {endblock} + {end-block} # ----------------------------------------------------------------------------- # Target "tangle" @@ -324,9 +269,9 @@ tangle: $(call tangle-webs) define tangle-webs - {repeatblock} + {repeat-tools-block} $(INWEBX) $(*WEB) -tangle - {endblock} + {end-block} endef # ----------------------------------------------------------------------------- @@ -342,9 +287,9 @@ weave: $(call weave-webs) define weave-webs - {repeatblock} + {repeat-tools-block} $(INWEBX) $(*WEB) $(WEAVEOPTS) - {endblock} + {end-block} endef # ----------------------------------------------------------------------------- @@ -468,9 +413,9 @@ clean: $(call clean-up) define clean-up - {repeatblock} + {repeat-tools-block} $(MAKE) -f $(*MAKER) clean - {endblock} + {end-block} $(MAKE) -f inform6/inform6.mk clean endef @@ -485,9 +430,9 @@ purge: $(call purge-up) define purge-up - {repeatblock} + {repeat-tools-block} $(MAKE) -f $(*MAKER) purge - {endblock} + {end-block} $(MAKE) -f inform6/inform6.mk purge endef