diff --git a/inbuild/Tests/Miscellany/_Results_Ideal/inspection.txt b/inbuild/Tests/Miscellany/_Results_Ideal/inspection.txt index 32c9b8971..53317164a 100644 --- a/inbuild/Tests/Miscellany/_Results_Ideal/inspection.txt +++ b/inbuild/Tests/Miscellany/_Results_Ideal/inspection.txt @@ -1,5 +1,5 @@ -kit: CastrovalvaKit v2.7.1 (not for 32 or 32d) at path inbuild/Tests/Zoo/Inter/CastrovalvaKit -extension: New Standard Tuning by Robert Fripp v3 (for 32 or 32d) in directory inbuild/Tests/Zoo/Extensions/Robert Fripp +kit: CastrovalvaKit v2.7.1 (not for Glulx version 3.1.2 or Glulx version 3.1.2 with debugging) at path inbuild/Tests/Zoo/Inter/CastrovalvaKit +extension: New Standard Tuning by Robert Fripp v3 (for Glulx version 3.1.2 or Glulx version 3.1.2 with debugging) in directory inbuild/Tests/Zoo/Extensions/Robert Fripp extension: Damaged by Anonymous in directory inbuild/Tests/Zoo/Extensions/Robert Fripp - 4 errors 1. extension misworded: the opening line does not end 'begin(s) here' 2. extension misworded: the titling line does not give both author and title diff --git a/inbuild/Tests/Zoo/Inter/CastrovalvaKit/kit_metadata.txt b/inbuild/Tests/Zoo/Inter/CastrovalvaKit/kit_metadata.txt index 5f562f7a9..4890121c9 100644 --- a/inbuild/Tests/Zoo/Inter/CastrovalvaKit/kit_metadata.txt +++ b/inbuild/Tests/Zoo/Inter/CastrovalvaKit/kit_metadata.txt @@ -1,3 +1,3 @@ version: 2.7.1 -compatibility: not for 32 or 32d +compatibility: not for 32-bit priority: 1 diff --git a/inbuild/arch-module/Chapter 2/Target Virtual Machines.w b/inbuild/arch-module/Chapter 2/Target Virtual Machines.w index 1dda705fa..97a12f8fc 100644 --- a/inbuild/arch-module/Chapter 2/Target Virtual Machines.w +++ b/inbuild/arch-module/Chapter 2/Target Virtual Machines.w @@ -21,7 +21,8 @@ typedef struct target_vm { } target_vm; target_vm *TargetVMs::new(text_stream *code, text_stream *nick, semantic_version_number V, - text_stream *image, text_stream *interpreter, text_stream *blorbed, text_stream *arch, int debug) { + text_stream *image, text_stream *interpreter, text_stream *blorbed, text_stream *arch, + int debug, int max_locals) { target_vm *VM = CREATE(target_vm); VM->family_name = Str::duplicate(code); VM->version = V; @@ -29,7 +30,7 @@ target_vm *TargetVMs::new(text_stream *code, text_stream *nick, semantic_version VM->VM_unblorbed_extension = Str::duplicate(nick); VM->VM_blorbed_extension = Str::duplicate(blorbed); VM->VM_image = Str::duplicate(image); - VM->max_locals = 15; + VM->max_locals = max_locals; VM->default_browser_interpreter = Str::duplicate(interpreter); VM->architecture = Architectures::from_codename(arch); if (VM->architecture == NULL) internal_error("no such architecture"); @@ -52,20 +53,20 @@ void TargetVMs::write(OUTPUT_STREAM, target_vm *VM) { void TargetVMs::create(void) { /* hat tip: Joel Berez and Marc Blank, 1979, and later hands */ TargetVMs::new(I"Z-Machine", I"z5", VersionNumbers::from_text(I"5"), - I"vm_z5.png", I"Parchment", I"zblorb", I"16", FALSE); + I"vm_z5.png", I"Parchment", I"zblorb", I"16", FALSE, 15); TargetVMs::new(I"Z-Machine", I"z5", VersionNumbers::from_text(I"5"), - I"vm_z5.png", I"Parchment", I"zblorb", I"16d", TRUE); + I"vm_z5.png", I"Parchment", I"zblorb", I"16d", TRUE, 15); TargetVMs::new(I"Z-Machine", I"z8", VersionNumbers::from_text(I"8"), - I"vm_z8.png", I"Parchment", I"zblorb", I"16", FALSE); + I"vm_z8.png", I"Parchment", I"zblorb", I"16", FALSE, 15); TargetVMs::new(I"Z-Machine", I"z8", VersionNumbers::from_text(I"8"), - I"vm_z8.png", I"Parchment", I"zblorb", I"16d", TRUE); + I"vm_z8.png", I"Parchment", I"zblorb", I"16d", TRUE, 15); /* hat tip: Andrew Plotkin, 2000 */ TargetVMs::new(I"Glulx", I"ulx", VersionNumbers::from_text(I"3.1.2"), - I"vm_glulx.png", I"Quixe", I"gblorb", I"32", FALSE); + I"vm_glulx.png", I"Quixe", I"gblorb", I"32", FALSE, 256); TargetVMs::new(I"Glulx", I"ulx", VersionNumbers::from_text(I"3.1.2"), - I"vm_glulx.png", I"Quixe", I"gblorb", I"32d", TRUE); + I"vm_glulx.png", I"Quixe", I"gblorb", I"32d", TRUE, 256); } target_vm *TargetVMs::find(text_stream *ext, int debug) { diff --git a/inbuild/inbuild-module/Chapter 2/Copies.w b/inbuild/inbuild-module/Chapter 2/Copies.w index 02898b4cf..4959a19fb 100644 --- a/inbuild/inbuild-module/Chapter 2/Copies.w +++ b/inbuild/inbuild-module/Chapter 2/Copies.w @@ -55,6 +55,10 @@ void Copies::write_copy(OUTPUT_STREAM, inbuild_copy *C) { Editions::write(OUT, C->edition); } +void Copies::inspect_copy(OUTPUT_STREAM, inbuild_copy *C) { + Editions::inspect(OUT, C->edition); +} + void Copies::go_operational(inbuild_copy *C) { VMETHOD_CALL(C->edition->work->genre, GENRE_GO_OPERATIONAL_MTID, C); } @@ -101,7 +105,7 @@ inbuild_copy *Copies::claim(text_stream *arg) { void Copies::inspect(OUTPUT_STREAM, inbuild_copy *C) { WRITE("%S: ", Genres::name(C->edition->work->genre)); - Copies::write_copy(STDOUT, C); + Copies::inspect_copy(STDOUT, C); if (C->location_if_path) { WRITE(" at path %p", C->location_if_path); } diff --git a/inbuild/inbuild-module/Chapter 2/Editions.w b/inbuild/inbuild-module/Chapter 2/Editions.w index 4f267b1a6..5576165d2 100644 --- a/inbuild/inbuild-module/Chapter 2/Editions.w +++ b/inbuild/inbuild-module/Chapter 2/Editions.w @@ -28,6 +28,10 @@ void Editions::write(OUTPUT_STREAM, inbuild_edition *E) { if (VersionNumbers::is_null(V) == FALSE) { WRITE(" v%v", &V); } +} + +void Editions::inspect(OUTPUT_STREAM, inbuild_edition *E) { + Editions::write(OUT, E); if (Compatibility::universal(E->compatibility) == FALSE) { WRITE(" ("); Compatibility::write(OUT, E->compatibility); diff --git a/inbuild/inbuild-module/Chapter 4/Extension Census.w b/inbuild/inbuild-module/Chapter 4/Extension Census.w index a8d2dcefa..b3091b4af 100644 --- a/inbuild/inbuild-module/Chapter 4/Extension Census.w +++ b/inbuild/inbuild-module/Chapter 4/Extension Census.w @@ -563,8 +563,8 @@ where all is optional except the title part. } Works::end_extension_link(OUT, ecd->found_as->copy->edition->work); - text_stream *VMR = ExtensionManager::from_copy(ecd->found_as->copy)->reqs_as_lexed; - if (Str::len(VMR)) { + compatibility_specification *C = ecd->found_as->copy->edition->compatibility; + if (Str::len(C->parsed_from) > 0) { @; key_vms = TRUE; } @@ -576,13 +576,9 @@ brackets, which the lexer will split off as distinct words, we can ignore the first and last word and just look at what is in between: @ = - WRITE(" "); + WRITE(" %S", C->parsed_from); #ifdef CORE_MODULE - wording W = Feeds::feed_stream(VMR); - VirtualMachines::write_icons(OUT, Wordings::trim_last_word(Wordings::trim_last_word(W))); - #endif - #ifndef CORE_MODULE - WRITE("%S", VMR); + VirtualMachines::write_icons(OUT, C); #endif @ = diff --git a/inbuild/inbuild-module/Chapter 4/Extension Services.w b/inbuild/inbuild-module/Chapter 4/Extension Services.w index d82c9404a..c9531fef3 100644 --- a/inbuild/inbuild-module/Chapter 4/Extension Services.w +++ b/inbuild/inbuild-module/Chapter 4/Extension Services.w @@ -16,7 +16,6 @@ typedef struct inform_extension { int standard; /* the (or perhaps just a) Standard Rules extension */ int authorial_modesty; /* Do not credit in the compiled game */ struct text_stream *rubric_as_lexed; /* brief description found in opening lines */ - struct text_stream *reqs_as_lexed; /* such as "(for Z-machine only)" */ struct text_stream *extra_credit_as_lexed; struct source_file *read_into_file; /* Which source file loaded this */ struct inbuild_requirement *must_satisfy; @@ -39,7 +38,6 @@ void Extensions::scan(inbuild_genre *G, inbuild_copy *C) { E->authorial_modesty = FALSE; E->read_into_file = NULL; E->rubric_as_lexed = Str::new(); - E->reqs_as_lexed = Str::new(); E->extra_credit_as_lexed = NULL; E->must_satisfy = NULL; #ifdef CORE_MODULE @@ -49,6 +47,7 @@ void Extensions::scan(inbuild_genre *G, inbuild_copy *C) { TEMPORARY_TEXT(claimed_author_name); TEMPORARY_TEXT(claimed_title); + TEMPORARY_TEXT(reqs); filename *F = C->location_if_file; semantic_version_number V = VersionNumbers::null(); @; @@ -61,12 +60,12 @@ void Extensions::scan(inbuild_genre *G, inbuild_copy *C) { Copies::attach(C, Copies::new_error_N(EXT_AUTHOR_TOO_LONG_CE, Str::len(claimed_author_name))); } C->edition = Editions::new(Works::new(extension_genre, claimed_title, claimed_author_name), V); - if (Str::len(E->reqs_as_lexed) > 0) { - compatibility_specification *CS = Compatibility::from_text(E->reqs_as_lexed); + if (Str::len(reqs) > 0) { + compatibility_specification *CS = Compatibility::from_text(reqs); if (CS) C->edition->compatibility = CS; else { TEMPORARY_TEXT(err); - WRITE_TO(err, "cannot read compatibility '%S'", E->reqs_as_lexed); + WRITE_TO(err, "cannot read compatibility '%S'", reqs); Copies::attach(C, Copies::new_error(EXT_MISWORDED_CE, err)); DISCARD_TEXT(err); } @@ -74,6 +73,7 @@ void Extensions::scan(inbuild_genre *G, inbuild_copy *C) { Works::add_to_database(C->edition->work, CLAIMED_WDBC); DISCARD_TEXT(claimed_author_name); DISCARD_TEXT(claimed_title); + DISCARD_TEXT(reqs); } @ The following scans a potential extension file. If it seems malformed, a @@ -197,7 +197,7 @@ this is unambiguous. @ = if (Regexp::match(&mr, claimed_title, L"(%c*?) *(%(%c*%))")) { Str::copy(claimed_title, mr.exp[0]); - Str::copy(E->reqs_as_lexed, mr.exp[1]); + Str::copy(reqs, mr.exp[1]); } @ = diff --git a/inbuild/inbuild-module/Chapter 4/Virtual Machine Grammar.w b/inbuild/inbuild-module/Chapter 4/Virtual Machine Grammar.w index 3721f55f9..2bf279ec5 100644 --- a/inbuild/inbuild-module/Chapter 4/Virtual Machine Grammar.w +++ b/inbuild/inbuild-module/Chapter 4/Virtual Machine Grammar.w @@ -8,7 +8,7 @@ arch module: for example, it matches |2.7.6| or |3/990505|. = internal 1 { TEMPORARY_TEXT(vtext); - WRITE_TO(vtext, "%W", Wordings::first_wn(W)); + WRITE_TO(vtext, "%W", W); semantic_version_number V = VersionNumbers::from_text(vtext); int result = FALSE; if (VersionNumbers::is_null(V) == FALSE) { @@ -21,14 +21,6 @@ arch module: for example, it matches |2.7.6| or |3/990505|. return result; } -@ - -= -int VM_matching_error_thrown = FALSE; /* an error occurred during parsing */ -text_stream *most_recent_VM_family_name = NULL; /* most recent major VM which matched, or null */ -int version_can_be_inferred; /* from earlier in the word range parsed */ -linked_list *VM_match_list = NULL; - @ The following nonterminal matches any valid description of a virtual machine, with result |TRUE| if the current target VM matches that description and |FALSE| if not. @@ -39,127 +31,4 @@ with result |TRUE| if the current target VM matches that description and compatibility_specification *C = Compatibility::from_text(vtext); if (C) { *XP = C; return TRUE; } *XP = NULL; return FALSE; - -/* VM_matching_error_thrown = FALSE; - most_recent_VM_family_name = NULL; - version_can_be_inferred = FALSE; - VM_match_list = NEW_LINKED_LIST(format_vm); - (W); - if (VM_matching_error_thrown) { *XP = NULL; *X = FALSE; } - else { *XP = (void *) VM_match_list; *X = TRUE; } - return TRUE; -*/ } - -@h Parsing VM restrictions. -Given a word range, we see what set of virtual machines it specifies. For example, -the result of calling - ->> for Z-machine version 5 or 8 only - -is a list of the v5 and v8 target VMs. The same result is produced by - ->> for Z-machine versions 5 and 8 only - -English being quirky that way. - -The words "Z-machine" and "Glulx" are hard-wired so that they can't be -altered using Preform. (The Spanish for "Glulx", say, is "Glulx".) Preform -grammar is used first to split the list: - -= - ::= - ... | ==> 0; return preform_lookahead_mode; /* match only when looking ahead */ - | ==> 0 - ==> 0 - - ::= - , _and/or | - _,/and/or - - ::= - ... ==> @ - -@ Preform doesn't parse the VM names themselves, but it does pick up the -optional part about version numbering: - -= - ::= - version/versions ==> 0; *XP = RP[1] - -@ = - semantic_version_number V = VersionNumbers::null(); - TEMPORARY_TEXT(name); - WRITE_TO(name, "%W", Wordings::first_word(W)); - target_vm *VM; - LOOP_OVER(VM, target_vm) - if (Str::eq_insensitive(name, VM->family_name)) { - most_recent_VM_family_name = Str::duplicate(VM->family_name); - W = Wordings::trim_first_word(W); - } - @; - if (Wordings::nonempty(W)) { - if ((W)) { - semantic_version_number_holder *H = (semantic_version_number_holder *) <>; - V = H->version; - version_can_be_inferred = TRUE; - } else if ((version_can_be_inferred) && ((W))) { - semantic_version_number_holder *H = (semantic_version_number_holder *) <>; - V = H->version; - } else { - VM_matching_error_thrown = TRUE; return TRUE; - } - @; - } else { - @; - } - DISCARD_TEXT(name); - -@ The word "version" is sometimes implicit, but not after a family name. -Thus "Glulx 3" is not allowed: it has to be "Glulx version 3". - -@ = - TEMPORARY_TEXT(name); - WRITE_TO(name, "%W", Wordings::first_wn(W)); - target_vm *VM; - LOOP_OVER(VM, target_vm) { - most_recent_VM_family_name = - if (Str::eq_insensitive(name, VM->family_name)) { - most_recent_VM_family_name = VM->family_name; - version_can_be_inferred = FALSE; - break; - } - } - -@ The variable |VM_matching_error_thrown| may have been set either on -this term or a previous one: for instance, if we are reading "Squirrel -versions 4 and 7" then at the second term, "7", no family is named -but the variable remains set from "Squirrel" having been parsed at the -first term. - -@ = - if (most_recent_VM_family_name == NULL) { - VM_matching_error_thrown = TRUE; return TRUE; - } - -@ We either make a run of matches: - -@ = - target_vm *VM; - LOOP_OVER(VM, target_vm) - if (Str::eq_insensitive(VM->family_name, most_recent_VM_family_name)) - ADD_TO_LINKED_LIST(VM, target_VM, VM_match_list); - -@ ...or else we make a single match, or even none at all. This would not be -an error: if the request was for "version 71 of Chipmunk", and we were -unable to compile to this VM (so that no such minor VM record appeared in -the table) then the situation might be that we are reading the requirements -of some extension used by other people, who have a later version of Inform -than us, and which does compile to that VM. - -@ = - target_vm *VM; - LOOP_OVER(VM, target_vm) - if ((Str::eq_insensitive(VM->family_name, most_recent_VM_family_name)) && - (VersionNumbers::eq(VM->version, V))) - ADD_TO_LINKED_LIST(VM, target_VM, VM_match_list); diff --git a/inform7/Tests/Extensions/Araminta Intest/Extmiswordedbeginshere Extension.i7x b/inform7/Tests/Extensions/Araminta Intest/Extmiswordedbeginshere Extension.i7x deleted file mode 100644 index 28711a6d8..000000000 --- a/inform7/Tests/Extensions/Araminta Intest/Extmiswordedbeginshere Extension.i7x +++ /dev/null @@ -1,5 +0,0 @@ -Extmiswordedbeginshere Extension [by Araminta Intest] begins here. - -Polynesia is a room. - -Extmiswordedbeginshere Extension ends here. diff --git a/inform7/Tests/Test Problems/PM_ExtMalformedVM.txt b/inform7/Tests/Test Problems/PM_ExtMalformedVM.txt deleted file mode 100644 index 82fcd32f3..000000000 --- a/inform7/Tests/Test Problems/PM_ExtMalformedVM.txt +++ /dev/null @@ -1,3 +0,0 @@ -Include ExtMalformedVM Extension by Araminta Intest. - -Clifftop is a room. diff --git a/inform7/Tests/Test Problems/PM_ExtMiswordedBeginsHere.txt b/inform7/Tests/Test Problems/PM_ExtMiswordedBeginsHere.txt deleted file mode 100644 index 245d1e7cf..000000000 --- a/inform7/Tests/Test Problems/PM_ExtMiswordedBeginsHere.txt +++ /dev/null @@ -1,3 +0,0 @@ -Include Extmiswordedbeginshere Extension by Araminta Intest. - -Xenon is a room. diff --git a/inform7/Tests/Test Problems/_Results_Ideal/PM_ExtInadequateVM.txt b/inform7/Tests/Test Problems/_Results_Ideal/PM_ExtInadequateVM.txt index 20f75cd29..72d00f65f 100644 --- a/inform7/Tests/Test Problems/_Results_Ideal/PM_ExtInadequateVM.txt +++ b/inform7/Tests/Test Problems/_Results_Ideal/PM_ExtInadequateVM.txt @@ -1,13 +1,14 @@ -Inform 7 build 6L26 has started. +Inform 7.10.1 build 6Q21 has started. I've now read your source text, which is 10 words long. -I've also read Standard Rules by Graham Nelson, which is 42597 words long. -I've also read English Language by Graham Nelson, which is 2288 words long. +I've also read Basic Inform by Graham Nelson, which is 7645 words long. +I've also read English Language by Graham Nelson, which is 2328 words long. +I've also read Standard Rules by Graham Nelson, which is 32123 words long. I've also read Extinadequatevm Extension by Araminta Intest, which is 14 words long. Problem__ PM_ExtInadequateVM >--> You wrote 'Include Extinadequatevm Extension by Araminta Intest' (source text, line 1): but my copy of Extinadequatevm Extension by Araminta Intest - stipulates that it is 'for Glulx only'. That means it can only be used with - certain of the possible compiled story file formats, and at the moment, we - don't fit the requirements. (You can change the format used for this - project on the Settings panel.) -Inform 7 has finished: 8 centiseconds used. + stipulates that it is '(For Glulx Only)'. That means it can only be used + with certain of the possible compiled story file formats, and at the + moment, we don't fit the requirements. (You can change the format used for + this project on the Settings panel.) +Inform 7 has finished: 12 centiseconds used. diff --git a/inform7/Tests/Test Problems/_Results_Ideal/PM_ExtMalformedVM.txt b/inform7/Tests/Test Problems/_Results_Ideal/PM_ExtMalformedVM.txt deleted file mode 100644 index dbb7ed1d7..000000000 --- a/inform7/Tests/Test Problems/_Results_Ideal/PM_ExtMalformedVM.txt +++ /dev/null @@ -1,13 +0,0 @@ -Inform 7.10.1 build 6Q21 has started. -I've now read your source text, which is 10 words long. -I've also read Basic Inform by Graham Nelson, which is 7645 words long. -I've also read English Language by Graham Nelson, which is 2328 words long. -I've also read Standard Rules by Graham Nelson, which is 32123 words long. -I've also read Extmalformedvm Extension by Araminta Intest, which is 15 words long. -Problem__ PM_ExtMalformedVM - >--> Your source text makes use of the extension Extmalformedvm Extension by - Araminta Intest: but my copy stipulates that it is 'for clockwork train - sets', which is a description of the required story file format which I - can't understand, and should be something like '(for Z-machine version 5 or - 8 only)'. -Inform 7 has finished: 12 centiseconds used. diff --git a/inform7/Tests/Test Problems/_Results_Ideal/PM_ExtMiswordedBeginsHere.txt b/inform7/Tests/Test Problems/_Results_Ideal/PM_ExtMiswordedBeginsHere.txt deleted file mode 100644 index 220fb51ee..000000000 --- a/inform7/Tests/Test Problems/_Results_Ideal/PM_ExtMiswordedBeginsHere.txt +++ /dev/null @@ -1,11 +0,0 @@ -Inform 7.10.1 build 6Q21 has started. -I've now read your source text, which is 10 words long. -I've also read Basic Inform by Graham Nelson, which is 7645 words long. -I've also read English Language by Graham Nelson, which is 2328 words long. -I've also read Standard Rules by Graham Nelson, which is 32123 words long. -Problem__ PM_ExtMiswordedBeginsHere - >--> The extension Extmiswordedbeginshere Extension by Araminta Intest, which - your source text makes use of, seems to be damaged or incorrect: its - identifying opening line is wrong. Specifically, the titling line does not - give both author and title. -Inform 7 has finished: 12 centiseconds used. diff --git a/inform7/core-module/Chapter 17/Responses.w b/inform7/core-module/Chapter 17/Responses.w index 1122d6099..a39d1e3d9 100644 --- a/inform7/core-module/Chapter 17/Responses.w +++ b/inform7/core-module/Chapter 17/Responses.w @@ -402,7 +402,7 @@ divided up by the extensions containing the rules which produce them. @ = if (contiguous_match == FALSE) { contiguous_match = TRUE; - if (no_cms++ == 0) { + if ((no_cms++ == 0) && (E)) { TEMPORARY_TEXT(QT); WRITE_TO(QT, "%as_copy->edition->work); Emit::array_text_entry(QT); diff --git a/inform7/core-module/Chapter 26/Virtual Machines.w b/inform7/core-module/Chapter 26/Virtual Machines.w index be550aac2..efbaa7a8d 100644 --- a/inform7/core-module/Chapter 26/Virtual Machines.w +++ b/inform7/core-module/Chapter 26/Virtual Machines.w @@ -30,11 +30,13 @@ void VirtualMachines::set_identifier(text_stream *text, int debugging) { current_target_VM = TargetVMs::find(text, debugging); } +int VirtualMachines::compatible_with(compatibility_specification *C) { + return Compatibility::with(C, current_target_VM); +} + internal { if ((W)) { - *X = FALSE; - compatibility_specification *C = (compatibility_specification *) <>; - *X = Compatibility::with(C, current_target_VM); + *X = VirtualMachines::compatible_with((compatibility_specification *) <>); return TRUE; } else { *X = FALSE; @@ -311,22 +313,19 @@ row of icons (but do not bother for the common case where some extension has no restriction on its use). = -void VirtualMachines::write_icons(OUTPUT_STREAM, wording W) { - if ((W)) { - compatibility_specification *C = (compatibility_specification *) <>; - int something = FALSE, everything = TRUE; - target_vm *VM; +void VirtualMachines::write_icons(OUTPUT_STREAM, compatibility_specification *C) { + int something = FALSE, everything = TRUE; + target_vm *VM; + LOOP_OVER(VM, target_vm) + if (Compatibility::with(C, VM)) + something = TRUE; + else + everything = FALSE; + if (something == FALSE) WRITE("none"); + if (everything == FALSE) LOOP_OVER(VM, target_vm) if (Compatibility::with(C, VM)) - something = TRUE; - else - everything = FALSE; - if (something == FALSE) WRITE("none"); - if (everything == FALSE) - LOOP_OVER(VM, target_vm) - if (Compatibility::with(C, VM)) - VirtualMachines::plot_icon(OUT, VM); - } + VirtualMachines::plot_icon(OUT, VM); } @ The following table in the index (on the Contents page) may be useful to a diff --git a/inform7/core-module/Chapter 8/Extension Documentation.w b/inform7/core-module/Chapter 8/Extension Documentation.w index 36baf361f..202bc44a0 100644 --- a/inform7/core-module/Chapter 8/Extension Documentation.w +++ b/inform7/core-module/Chapter 8/Extension Documentation.w @@ -182,10 +182,10 @@ different template: WRITE(" "); @ = - if (Wordings::nonempty(Extensions::get_VM_text(E))) { - WRITE("%+W", Extensions::get_VM_text(E)); - WRITE(" "); - VirtualMachines::write_icons(OUT, Extensions::get_VM_text(E)); + compatibility_specification *C = E->as_copy->edition->compatibility; + if (Str::len(C->parsed_from) > 0) { + WRITE("%S ", C->parsed_from); + VirtualMachines::write_icons(OUT, C); } @ = diff --git a/inform7/core-module/Chapter 8/Including Extensions.w b/inform7/core-module/Chapter 8/Including Extensions.w index 05408eed2..9bcd8a566 100644 --- a/inform7/core-module/Chapter 8/Including Extensions.w +++ b/inform7/core-module/Chapter 8/Including Extensions.w @@ -251,8 +251,9 @@ trap-door into Read Source Text, to seek and open the file. } @ = +int last_PM_ExtVersionMalformed_at = -1; semantic_version_number Extensions::Inclusion::parse_version(int vwn) { - semantic_version_number V = VersionNumbers::from_pair(1, 0); /* which equates to |1/000000| */ + semantic_version_number V = VersionNumbers::null(); wording W = Wordings::one_word(vwn); if ((W)) { semantic_version_number_holder *H = (semantic_version_number_holder *) <>; @@ -269,13 +270,15 @@ over and over. We do this by altering the text to |1|, the lowest well-formed version number text. @ = - LOG("Offending word number %d <%N>\n", vwn, vwn); - Problems::Issue::sentence_problem(_p_(PM_ExtVersionMalformed), - "a version number must have the form N/DDDDDD", - "as in the example '2/040426' for release 2 made on 26 April 2004. " - "(The DDDDDD part is optional, so '3' is a legal version number too. " - "N must be between 1 and 999: in particular, there is no version 0.)"); - Vocabulary::change_text_of_word(vwn, L"1"); + if (last_PM_ExtVersionMalformed_at != vwn) { + last_PM_ExtVersionMalformed_at = vwn; + LOG("Offending word number %d <%N>\n", vwn, vwn); + Problems::Issue::sentence_problem(_p_(PM_ExtVersionMalformed), + "a version number must have the form N/DDDDDD", + "as in the example '2/040426' for release 2 made on 26 April 2004. " + "(The DDDDDD part is optional, so '3' is a legal version number too. " + "N must be between 1 and 999: in particular, there is no version 0.)"); + } @h Checking the begins here and ends here sentences. When a newly loaded extension is being sentence-broken, problem messages @@ -325,8 +328,7 @@ void Extensions::Inclusion::check_begins_here(parse_node *PN, inform_extension * (ParseTree::get_text(PN)); Extensions::set_VM_text(E, Wordings::new(<>, <>)); - if (Wordings::nonempty(Extensions::get_VM_text(E))) - @; + @; } @ On the other hand, we do already know what virtual machine we are compiling @@ -334,26 +336,9 @@ for, so we can immediately object if the loaded extension cannot be used with our VM de jour. @ = - if ((Extensions::get_VM_text(E))) { - if (<> == PLATFORM_UNMET_HQ) - @; - } else { - @; - } - -@ See Virtual Machines for the grammar of what can be given as a VM -requirement. - -@ = - Problems::quote_extension(1, E); - Problems::quote_wording(2, Extensions::get_VM_text(E)); - Problems::Issue::handmade_problem(_p_(PM_ExtMalformedVM)); - Problems::issue_problem_segment( - "Your source text makes use of the extension %1: but my copy " - "stipulates that it is '%2', which is a description of the required " - "story file format which I can't understand, and should be " - "something like '(for Z-machine version 5 or 8 only)'."); - Problems::issue_problem_end(); + compatibility_specification *C = E->as_copy->edition->compatibility; + if (VirtualMachines::compatible_with(C) == FALSE) + @; @ Here the problem is not that the extension is broken in some way: it's just not what we can currently use. Therefore the correction should be a @@ -364,7 +349,7 @@ report this problem at the inclusion line. current_sentence = Extensions::get_inclusion_sentence(E); Problems::quote_source(1, current_sentence); Problems::quote_copy(2, E->as_copy); - Problems::quote_wording(3, Extensions::get_VM_text(E)); + Problems::quote_stream(3, C->parsed_from); Problems::Issue::handmade_problem(_p_(PM_ExtInadequateVM)); Problems::issue_problem_segment( "You wrote %1: but my copy of %2 stipulates that it " diff --git a/resources/Documentation/Writing with Inform.txt b/resources/Documentation/Writing with Inform.txt index 81441c4f5..05e3d40ab 100644 --- a/resources/Documentation/Writing with Inform.txt +++ b/resources/Documentation/Writing with Inform.txt @@ -582,7 +582,7 @@ To provide an example, ^{@Emily Short}'s useful extension "Locksmith" is one of Each time that Inform translates any source text, it performs a quick check of the extensions available, and updates its own internal records. A directory of the extensions currently installed can be found by clicking on "Installed Extensions" from the Extensions panel. This is also worth visiting in order to browse the Public Library, a selection of extensions contributed by Inform users. -[x] Including extensions {PM_IncludeExtQuoted} {PM_ExtVersionMalformed} {PM_ExtMiswordedBeginsHere} {PM_ExtMalformedVM} {PM_ExtInadequateVM} {PM_ExtMisidentifiedEnds} +[x] Including extensions {PM_IncludeExtQuoted} {PM_ExtVersionMalformed} {PM_ExtMiswordedBeginsHere} {PM_ExtInadequateVM} {PM_ExtMisidentifiedEnds} ^^{extensions: using} ^^{include (extension) by (extension author)+assert+}