1
0
Fork 0
mirror of https://github.com/ganelson/inform.git synced 2024-06-17 07:40:47 +03:00

Further work on inbuild verbosity

This commit is contained in:
Graham Nelson 2023-06-01 22:24:00 +01:00
parent 5b3a34c942
commit 203cc39e33
18 changed files with 116 additions and 29 deletions

View file

@ -1,6 +1,6 @@
# Inform 7
[Version](notes/versioning.md): 10.2.0-beta+6W52 'Krypton' (27 May 2023)
[Version](notes/versioning.md): 10.2.0-beta+6W53 'Krypton' (1 June 2023)
## About Inform

View file

@ -1,3 +1,3 @@
Prerelease: beta
Build Date: 27 May 2023
Build Number: 6W52
Build Date: 1 June 2023
Build Number: 6W53

View file

@ -90,6 +90,7 @@ error in this case.
((others_exist == FALSE) && (D))) {
SVEXPLAIN(1, "(in absence of explicit -internal, inventing -internal %p)\n",
Supervisor::default_internal_path());
if (path_to_tools) SVEXPLAIN(2, "(note that -tools is %p)\n", path_to_tools);
Supervisor::add_nest(
Supervisor::default_internal_path(), INTERNAL_NEST_TAG);
}
@ -402,7 +403,7 @@ other options to the selection defined here.
CommandLine::declare_switch(ARCHIVE_TO_CLSW, L"archive-to", 2,
L"sync copies of all extensions, kits and so on needed into nest X");
CommandLine::declare_switch(TOOLS_CLSW, L"tools", 2,
L"make X the directory of intools executables, and exit developer mode");
L"make X the directory of intools executables");
CommandLine::declare_boolean_switch(DRY_CLSW, L"dry", 1,
L"make this a dry run (print but do not execute shell commands)", FALSE);
CommandLine::declare_boolean_switch(BUILD_TRACE_CLSW, L"build-trace", 1,
@ -459,7 +460,9 @@ void Main::option(int id, int val, text_stream *arg, void *state) {
case ARCHIVE_CLSW: inbuild_task = ARCHIVE_TTASK; break;
case USE_MISSING_CLSW: inbuild_task = USE_MISSING_TTASK; break;
case BUILD_MISSING_CLSW: inbuild_task = BUILD_MISSING_TTASK; break;
case TOOLS_CLSW: path_to_tools = Pathnames::from_text(arg); break;
case TOOLS_CLSW:
path_to_tools = Pathnames::from_text(arg);
Supervisor::set_tools_location(path_to_tools); break;
case MATCHING_CLSW: filter_text = Str::duplicate(arg); break;
case CONTENTS_OF_CLSW: contents_of_used = TRUE;
Main::add_directory_contents_targets(Pathnames::from_text(arg)); break;

View file

@ -18,7 +18,7 @@ void Supervisor::set_verbosity(int level) {
if (level < 0) level = 0;
if (level > 3) level = 3;
supervisor_verbosity = level;
if (level > 0) WRITE_TO(STDOUT, "(Verbosity set to %d)\n", level);
if (level > 0) WRITE_TO(STDOUT, "(inbuild verbosity set to %d)\n", level);
}
@h Phases.
@ -543,8 +543,17 @@ inbuild_nest *Supervisor::external(void) {
no better indication of where they are.
=
pathname *supervisor_tools_location = NULL;
void Supervisor::set_tools_location(pathname *P) {
supervisor_tools_location = P;
}
pathname *Supervisor::default_internal_path(void) {
return Pathnames::from_text(I"inform7/Internal");
pathname *P = supervisor_tools_location;
P = Pathnames::down(P, I"inform7");
P = Pathnames::down(P, I"Internal");
return P;
}
@ This tells the //html// module where to find, say, CSS files. Those files
@ -616,7 +625,7 @@ int Supervisor::set_I7_bundle(pathname *P) {
SVEXPLAIN(1, "(reading further command-line settings from: %f)\n", expert_settings);
CommandLine::also_read_file(expert_settings);
} else {
SVEXPLAIN(2, "(no command-line settings file is present at %f)\n");
SVEXPLAIN(2, "(no command-line settings file found at %f)\n", expert_settings);
}
DISCARD_TEXT(leaf)
return TRUE;

View file

@ -17,6 +17,7 @@ void JSONMetadata::read_metadata_file(inbuild_copy *C, filename *F,
TEMPORARY_TEXT(contents)
TextFiles::read(F, FALSE, "unable to read file of JSON metadata", TRUE,
&JSONMetadata::read_metadata_file_helper, NULL, contents);
SVEXPLAIN(2, "(read JSON metadata file found at %f)\n", F);
text_file_position tfp = TextFiles::at(F, 1);
JSON_value *obj = JSON::decode(contents, &tfp);
if ((obj) && (obj->JSON_type == ERROR_JSONTYPE)) {

View file

@ -131,12 +131,38 @@ genre's manager to look for copies of that genre:
=
void Nests::search_for(inbuild_requirement *req,
linked_list *search_list, linked_list *results) {
text_stream *OUT = STDOUT;
if (supervisor_verbosity >= 3) {
WRITE("(search for ");
Requirements::write(OUT, req);
WRITE(" in ");
inbuild_nest *N; int c = 0;
LOOP_OVER_LINKED_LIST(N, inbuild_nest, search_list) {
if (c++ > 0) WRITE(", ");
WRITE("%S nest at %p", Nests::tag_name(N->tag_value), N->location);
}
WRITE(")\n");
INDENT;
}
inbuild_nest *N;
LOOP_OVER_LINKED_LIST(N, inbuild_nest, search_list) {
inbuild_genre *G;
LOOP_OVER(G, inbuild_genre)
VOID_METHOD_CALL(G, GENRE_SEARCH_NEST_FOR_MTID, N, req, results);
}
if (supervisor_verbosity >= 3) {
OUTDENT;
inbuild_search_result *R;
int c = 1;
LOOP_OVER_LINKED_LIST(R, inbuild_search_result, results) {
WRITE(" (Result %d. ", c++);
Copies::write_copy(OUT, R->copy);
WRITE(" from %S nest at %p)\n", Nests::tag_name(R->nest->tag_value), R->nest->location);
}
WRITE("(search complete with %d result(s))\n", c);
}
}
@ Oftentimes, we want only the single best result, and won't even look at the
@ -147,10 +173,14 @@ inbuild_search_result *Nests::search_for_best(inbuild_requirement *req,
linked_list *search_list) {
linked_list *L = NEW_LINKED_LIST(inbuild_search_result);
Nests::search_for(req, search_list, L);
inbuild_search_result *best = NULL, *search_result;
LOOP_OVER_LINKED_LIST(search_result, inbuild_search_result, L)
if (Nests::better_result(search_result, best))
best = search_result;
inbuild_search_result *best = NULL, *search_result; int c = 1, bc = 0;
LOOP_OVER_LINKED_LIST(search_result, inbuild_search_result, L) {
if (Nests::better_result(search_result, best)) {
best = search_result; bc = c;
}
c++;
}
SVEXPLAIN(3, "(best result is %d)\n", bc);
return best;
}

View file

@ -167,6 +167,7 @@ void Graphs::describe_r(OUTPUT_STREAM, int depth, build_vertex *V,
if (V->last_described_in_generation == description_round) { WRITE(" q.v.\n"); return; }
V->last_described_in_generation = description_round;
WRITE("\n");
@<Add locations in verbose mode@>;
if (recurse) {
if (V->as_copy) stem = V->as_copy->location_if_path;
if (V->as_file)
@ -179,6 +180,17 @@ void Graphs::describe_r(OUTPUT_STREAM, int depth, build_vertex *V,
}
}
@<Add locations in verbose mode@> =
if ((V->type == COPY_VERTEX) && (supervisor_verbosity > 0)) {
for (int i=0; i<depth; i++) WRITE(" ");
WRITE(" > at ");
inbuild_copy *C = V->as_copy;
if ((C) && (C->location_if_file)) WRITE("%f", C->location_if_file);
if ((C) && (C->location_if_path)) WRITE("%p", C->location_if_path);
WRITE("\n");
}
@ =
void Graphs::describe_vertex(OUTPUT_STREAM, build_vertex *V) {
if (V == NULL) WRITE("<none>");
else switch (V->type) {
@ -206,17 +218,20 @@ void Graphs::show_needs_r(OUTPUT_STREAM, build_vertex *V,
inbuild_copy *C = V->as_copy;
if (C->last_scanned != scan_count) {
C->last_scanned = scan_count;
if (paths) {
/* if (paths) {
if (C->location_if_path) WRITE("%p", C->location_if_path);
else if (C->location_if_file) WRITE("%f", C->location_if_file);
else WRITE("?unlocated");
WRITE(" (%S)", C->edition->work->genre->genre_name);
} else {
*/
for (int i=0; i<depth; i++) WRITE(" ");
WRITE("%S: ", C->edition->work->genre->genre_name);
Copies::write_copy(OUT, C);
}
/* }
*/
WRITE("\n");
if (paths) @<Add needs-locations@>;
}
depth++;
}
@ -243,6 +258,15 @@ void Graphs::show_needs_r(OUTPUT_STREAM, build_vertex *V,
}
}
@<Add needs-locations@> =
for (int i=0; i<depth; i++) WRITE(" ");
int L = Str::len(C->edition->work->genre->genre_name) + 2;
for (int i=0; i<L; i++) WRITE(" ");
if ((C) && (C->location_if_file)) WRITE("at %f", C->location_if_file);
else if ((C) && (C->location_if_path)) WRITE("at %p", C->location_if_path);
else WRITE("?unlocated");
WRITE("\n");
@ And for |-build-missing| and |-use-missing|.
=

View file

@ -350,6 +350,7 @@ are immutable, and need to be for the extensions dictionary to work.
}
}
} else {
SVEXPLAIN(2, "(no JSON metadata file found at %f)\n", F);
if (repair_mode) {
force_JSON_write = I"the JSON file is currently missing";
} else {
@ -797,6 +798,7 @@ void Extensions::read_source_text_for(inform_extension *E) {
TEMPORARY_TEXT(synopsis)
@<Concoct a synopsis for the extension to be read@>;
E->read_into_file = SourceText::read_file(E->as_copy, F, synopsis, doc_only, FALSE);
SVEXPLAIN(1, "(from %f)\n", F);
DISCARD_TEXT(synopsis)
if (E->read_into_file) {
E->read_into_file->your_ref = STORE_POINTER_inbuild_copy(E->as_copy);

View file

@ -85,6 +85,8 @@ void Kits::scan(inbuild_copy *C) {
K->supports_nl = FALSE;
filename *F = Filenames::in(C->location_if_path, I"kit_metadata.json");
if (TextFiles::exists(F) == FALSE)
SVEXPLAIN(2, "(no JSON metadata file found at %f)\n", F);
JSONMetadata::read_metadata_file(C, F, NULL, NULL);
if (C->metadata_record) {

View file

@ -83,6 +83,7 @@ void Languages::scan(inbuild_copy *C) {
}
}
} else {
SVEXPLAIN(2, "(no JSON metadata file found at %f)\n", F);
TEMPORARY_TEXT(err)
WRITE_TO(err, "a language bundle must now provide a 'language_metadata.json' file");
Copies::attach_error(C, CopyErrors::new_T(METADATA_MALFORMED_CE, -1, err));
@ -243,14 +244,18 @@ so the function is now deprecated:
=
text_stream *Languages::find_by_native_cue(text_stream *cue, linked_list *search) {
SVEXPLAIN(3, "(find language by native cue %S)\n", cue);
linked_list *results = NEW_LINKED_LIST(inbuild_search_result);
Nests::search_for(Requirements::anything_of_genre(language_genre), search, results);
inbuild_search_result *search_result;
LOOP_OVER_LINKED_LIST(search_result, inbuild_search_result, results) {
inform_language *L = LanguageManager::from_copy(search_result->copy);
if (Str::eq_insensitive(cue, L->native_cue))
if (Str::eq_insensitive(cue, L->native_cue)) {
SVEXPLAIN(3, "(found at %p)\n", L->as_copy->location_if_path);
return L->as_copy->edition->work->title;
}
}
SVEXPLAIN(3, "(not found)\n");
return NULL;
}

View file

@ -101,6 +101,8 @@ void Projects::scan(inbuild_copy *C) {
@<Extract this requirement@>;
}
}
} else {
SVEXPLAIN(2, "(no JSON metadata file found at %f)\n", F);
}
}
@ -1104,6 +1106,7 @@ it comes.
}
N->as_source_file =
SourceText::read_file(proj->as_copy, F, N->source_source, FALSE, TRUE);
SVEXPLAIN(1, "(from %f)\n", F);
}
int l = SyntaxTree::push_bud(proj->syntax_tree, proj->syntax_tree->root_node);
Sentences::break_into_project_copy(

View file

@ -310,6 +310,8 @@ compiler via Delia scripts in |intest|.
@e TEST_OUTPUT_CLSW
@e SILENCE_CLSW
@e CHECK_RESOURCES_CLSW
@e INBUILD_VERBOSE_CLSW
@e INBUILD_VERBOSITY_CLSW
@<Register command-line arguments@> =
CommandLine::begin_group(INFORM_TESTING_CLSG, I"for testing and debugging inform7");
@ -335,6 +337,10 @@ compiler via Delia scripts in |intest|.
L"write output of internal tests to file X");
CommandLine::declare_boolean_switch(SILENCE_CLSW, L"silence", 1,
L"practice 'silence is golden': print only Unix-style errors", FALSE);
CommandLine::declare_boolean_switch(INBUILD_VERBOSE_CLSW, L"inbuild-verbose", 1,
L"equivalent to -inbuild-verbosity=1", FALSE);
CommandLine::declare_numerical_switch(INBUILD_VERBOSITY_CLSW, L"inbuild-verbosity", 1,
L"how much inbuild should explain: lowest is 0 (default), highest is 3");
CommandLine::end_group();
@ Three of the five options here actually configure the |problems| module
@ -357,6 +363,8 @@ void Main::switch(int id, int val, text_stream *arg, void *state) {
case CHECK_RESOURCES_CLSW: ResourceFinder::set_mode(val); break;
case TEST_OUTPUT_CLSW: InternalTests::set_file(Filenames::from_text(arg)); break;
case SILENCE_CLSW: silence_is_golden = TRUE; break;
case INBUILD_VERBOSE_CLSW: Supervisor::set_verbosity(1); break;
case INBUILD_VERBOSITY_CLSW: Supervisor::set_verbosity(val); break;
}
Supervisor::option(id, val, arg, state);
}

View file

@ -2,7 +2,7 @@
"is": {
"type": "kit",
"title": "BasicInformExtrasKit",
"version": "10.2.0-beta+6W52"
"version": "10.2.0-beta+6W53"
},
"kit-details": {
"has-priority": 1

View file

@ -2,7 +2,7 @@
"is": {
"type": "kit",
"title": "BasicInformKit",
"version": "10.2.0-beta+6W52"
"version": "10.2.0-beta+6W53"
},
"needs": [ {
"unless": {

View file

@ -2,7 +2,7 @@
"is": {
"type": "kit",
"title": "CommandParserKit",
"version": "10.2.0-beta+6W52"
"version": "10.2.0-beta+6W53"
},
"needs": [ {
"need": {

View file

@ -2,7 +2,7 @@
"is": {
"type": "kit",
"title": "EnglishLanguageKit",
"version": "10.2.0-beta+6W52"
"version": "10.2.0-beta+6W53"
},
"needs": [ {
"need": {

View file

@ -2,7 +2,7 @@
"is": {
"type": "kit",
"title": "WorldModelKit",
"version": "10.2.0-beta+6W52"
"version": "10.2.0-beta+6W53"
},
"needs": [ {
"need": {

View file

@ -1213,44 +1213,44 @@ When made with the Glulx setting, an Inform project can include sound effects or
</p>
<hr>
<p class="halftightin1"><a name=A46></a><b>list of K</b> (<i>plural</i> lists of K)&nbsp;<a href=inform:/doc350.html><img border=0 src=inform:/doc_images/help.png></a></p>
<p class="tightin1"><i>covariant&nbsp;<a href=#contra>><img border=0 src=inform:/doc_images/shelp.png></a></i></p>
<p class="tightin1"><i>covariant&nbsp;<a href=#contra><img border=0 src=inform:/doc_images/shelp.png></a></i></p>
<p class="tightin1"><i>Matches:</i> value, sayable value<br>
A flexible-length list of values, where all of the items have to have the same kind of value as each other - for instance, a list of rooms, or a list of lists of numbers. The empty list, with no items yet, is written { }, and a list with items in is written with commas dividing them - say {2, 5, 9}.<br>
</p>
<p class="halftightin1"><a name=A55></a><b>phrase K -> L</b> (<i>plural</i> phrases K -> L)</p>
<p class="tightin1"><i>contravariant in K, covariant in L&nbsp;<a href=#contra>><img border=0 src=inform:/doc_images/shelp.png></a></i></p>
<p class="tightin1"><i>contravariant in K, covariant in L&nbsp;<a href=#contra><img border=0 src=inform:/doc_images/shelp.png></a></i></p>
<p class="tightin1"><i>Matches:</i> value, sayable value<br>
</p>
<p class="halftightin1"><a name=A57></a><b><span class="indexgrey"></span>relation<span class="indexgrey"> of K</span></b> (<i>plural</i> <span class="indexgrey"></span>relations<span class="indexgrey"> of K</span>)</p>
<p class="tightin1"><i>covariant&nbsp;<a href=#contra>><img border=0 src=inform:/doc_images/shelp.png></a></i></p>
<p class="tightin1"><i>covariant&nbsp;<a href=#contra><img border=0 src=inform:/doc_images/shelp.png></a></i></p>
<p class="tightin1"><i>Matches:</i> value, sayable value<br>
</p>
<p class="halftightin1"><a name=A58></a><b><span class="indexgrey">K based</span> rule<span class="indexgrey"> producing L</span></b> (<i>plural</i> <span class="indexgrey">K based</span> rules<span class="indexgrey"> producing L</span>)&nbsp;<a href=inform:/doc325.html><img border=0 src=inform:/doc_images/help.png></a></p>
<p class="tightin1"><i>contravariant in K, covariant in L&nbsp;<a href=#contra>><img border=0 src=inform:/doc_images/shelp.png></a></i></p>
<p class="tightin1"><i>contravariant in K, covariant in L&nbsp;<a href=#contra><img border=0 src=inform:/doc_images/shelp.png></a></i></p>
<p class="tightin1"><i>Matches:</i> value, sayable value<br>
One of many, many rules which determine what happens during play. Rules can be triggered by scenes beginning or ending, by certain actions, at certain times, or in the course of carrying out certain activities.<br>
</p>
<p class="halftightin1"><a name=A59></a><b><span class="indexgrey">K based</span> rulebook<span class="indexgrey"> producing L</span></b> (<i>plural</i> <span class="indexgrey">K based</span> rulebooks<span class="indexgrey"> producing L</span>)&nbsp;<a href=inform:/doc325.html><img border=0 src=inform:/doc_images/help.png></a></p>
<p class="tightin1"><i>contravariant in K, covariant in L&nbsp;<a href=#contra>><img border=0 src=inform:/doc_images/shelp.png></a></i></p>
<p class="tightin1"><i>contravariant in K, covariant in L&nbsp;<a href=#contra><img border=0 src=inform:/doc_images/shelp.png></a></i></p>
<p class="tightin1"><i>Matches:</i> value, sayable value<br>
A list of rules to follow, in sequence, to get something done. A rulebook is like a ring-binder, with the individual rules as sheets of paper. Inform normally sorts these into their 'natural' order, with the most specific rules first, but it's easy to shuffle the pages if you need to. When some task is carried out during play, Inform is normally working through a rulebook, turning the pages one by one.<br>
</p>
<p class="halftightin1"><a name=A60></a><b><span class="indexgrey"></span>activity<span class="indexgrey"> on K</span></b> (<i>plural</i> <span class="indexgrey"></span>activities<span class="indexgrey"> on K</span>)&nbsp;<a href=inform:/doc285.html><img border=0 src=inform:/doc_images/help.png></a></p>
<p class="tightin1"><i>contravariant&nbsp;<a href=#contra>><img border=0 src=inform:/doc_images/shelp.png></a></i></p>
<p class="tightin1"><i>contravariant&nbsp;<a href=#contra><img border=0 src=inform:/doc_images/shelp.png></a></i></p>
<p class="tightin1"><i>Matches:</i> value<br>
An activity is something which Inform does as part of the mechanics of play - for instance, printing the name of an object, which Inform often has to do. An activity can happen by itself ('printing the banner text', for instance) or can be applied to an object ('printing the name of something', say).<br>
</p>
<p class="halftightin1"><a name=A61></a><b>description of K</b> (<i>plural</i> descriptions of K)&nbsp;<a href=inform:/doc362.html><img border=0 src=inform:/doc_images/help.png></a></p>
<p class="tightin1"><i>covariant&nbsp;<a href=#contra>><img border=0 src=inform:/doc_images/shelp.png></a></i></p>
<p class="tightin1"><i>covariant&nbsp;<a href=#contra><img border=0 src=inform:/doc_images/shelp.png></a></i></p>
<p class="tightin1"><i>Matches:</i> value<br>
A description of a set of values, where all of the items have to have the same kind of value as each other - for instance, 'even numbers' or 'open doors which are in lighted rooms'.<br>
</p>
<p class="halftightin1"><a name=A62></a><b><span class="indexgrey">K valued</span> property<span class="indexgrey"></span></b> (<i>plural</i> <span class="indexgrey">K valued</span> properties<span class="indexgrey"></span>)</p>
<p class="tightin1"><i>covariant&nbsp;<a href=#contra>><img border=0 src=inform:/doc_images/shelp.png></a></i></p>
<p class="tightin1"><i>covariant&nbsp;<a href=#contra><img border=0 src=inform:/doc_images/shelp.png></a></i></p>
<p class="tightin1"><i>Matches:</i> value<br>
</p>
<p class="halftightin1"><a name=A63></a><b><span class="indexgrey">K valued</span> table<span class="indexgrey"></span> column<span class="indexgrey"></span></b> (<i>plural</i> <span class="indexgrey">K valued</span> table<span class="indexgrey"></span> columns<span class="indexgrey"></span>)</p>
<p class="tightin1"><i>covariant&nbsp;<a href=#contra>><img border=0 src=inform:/doc_images/shelp.png></a></i></p>
<p class="tightin1"><i>covariant&nbsp;<a href=#contra><img border=0 src=inform:/doc_images/shelp.png></a></i></p>
<p class="tightin1"><i>Matches:</i> value<br>
</p>
<p><a name=contra><span class="smaller"><b>Covariance</b> means that if K is a kind of L, then something