1
0
Fork 0
mirror of https://github.com/ganelson/inform.git synced 2024-06-26 04:00:43 +03:00

Further work on new-style RTP issuance

This commit is contained in:
Graham Nelson 2023-08-26 19:41:13 +01:00
parent 10d3da6a3e
commit 46b767232b
37 changed files with 221 additions and 82 deletions

View file

@ -22,7 +22,7 @@
set: $I6OPTIONS = -kE2~S~Dwv8
set: $BLORBEXT = zblorb
endif
set: $I7OPTIONS = -fixtime -release -format=$FORMAT -no-progress -no-index -rng -sigils -log nothing -external inblorb/Tests -transient $WORK/Transient -internal $INTERNAL
set: $I7OPTIONS = -fixtime -release -format=$FORMAT -no-progress -no-index -rng -sigils -log nothing -external inblorb/Tests -internal $INTERNAL
set: $CBLORBOPTIONS = -fixtime
mkdir: $WORK/Transient

View file

@ -226,6 +226,8 @@ inbuild_copy *ExtensionBundleManager::claim_folder_as_copy(pathname *P, inbuild_
@<Police Materials contents@>;
} else if (Str::eq(subdir, I"Documentation")) {
@<Police Documentation contents@>;
} else if (Str::eq(subdir, I"RTPs")) {
@<Police RTPs contents@>;
} else {
TEMPORARY_TEXT(error_text)
WRITE_TO(error_text,
@ -367,6 +369,9 @@ inbuild_copy *ExtensionBundleManager::claim_folder_as_copy(pathname *P, inbuild_
DISCARD_TEXT(error_text)
}
@<Police RTPs contents@> =
;
@h Searching.
Here we look through a nest to find all extension bundles:

View file

@ -808,6 +808,11 @@ To next -- in loop
(documented at ph_next):
(- continue; -).
Section 5 - Run-Time Problems
To issue the run-time problem (pcode - text):
(- IssueRTP({-rtp-code: pcode}, -1, {-rtp-location: pcode}); -).
Chapter 4 - Values
Section 1 - Enumerations

View file

@ -22,7 +22,7 @@ original source text (though in fact I7 does not use this at present).
Array RTP_Buffer --> (-1) 0 0 0 0 0 0 0 0;
[ IssueRTP n desc set par1 par2 par3 ln file;
if ((n ofclass String) &&
((desc ofclass String) || (desc ofclass Routine)) &&
((desc ofclass String) || (desc ofclass Routine) || (desc == -1)) &&
(set ofclass String)) {
if (RTP_Buffer-->0 == -1) {
RTP_Buffer-->0 = n;
@ -81,11 +81,12 @@ Array RTP_Buffer --> (-1) 0 0 0 0 0 0 0 0;
#ifdef DEBUG;
if (RTP_Buffer-->8) { print ": ", (string) RTP_Buffer-->8; }
#endif;
print "^*** ";
desc = RTP_Buffer-->7;
print "^";
if (desc ~= -1) print "*** ";
if (desc ofclass String) print (string) desc, "^";
else if (desc ofclass Routine) desc(par1, par2, par3);
else {
else if (desc ~= -1) {
switch(n) {
RTP_IMPREL:
print "Tried to access an inappropriate relation for ", (the) par1,
@ -201,8 +202,8 @@ Array RTP_Buffer --> (-1) 0 0 0 0 0 0 0 0;
(string) RlnGetF(par3, RR_DESCRIPTION), "'.^";
}
RunTimeProblemShowWM(n, par1, par2, par3);
print "^";
}
print "^";
];
@h Low-Level Errors.

View file

@ -9,7 +9,8 @@
These, however, should fail as being out of range.
*** Couldn't write to list entry 0 of a list which has entries numbered from 1 to 6 ***
*** Run-time problem P50: Attempt to use list item which does not exist.
*** Run-time problem P50
*** Attempt to use list item which does not exist.
*** Couldn't write to list entry 7 of a list which has entries numbered from 1 to 6 ***
L now contains two instances of 208: {1, 7, 208, 5, -6, 6, 208}.

View file

@ -9,7 +9,8 @@ After changing the two end entries, L is now {1, 7, 208, 5, -6, 6}.
These, however, should fail as being out of range.
*** Couldn't write to list entry 0 of a list which has entries numbered from 1 to 6 ***
*** Run-time problem P50: Attempt to use list item which does not exist.
*** Run-time problem indefinite article
*** Attempt to use list item which does not exist.
*** Couldn't write to list entry 7 of a list which has entries numbered from 1 to 6 ***
L now contains two instances of 208: {1, 7, 208, 5, -6, 6, 208}.

View file

@ -9,7 +9,8 @@ After changing the two end entries, L is now {1, 7, 208, 5, -6, 6}.
These, however, should fail as being out of range.
*** Couldn't write to list entry 0 of a list which has entries numbered from 1 to 6 ***
*** Run-time problem P50: Attempt to use list item which does not exist.
*** Run-time problem P50
*** Attempt to use list item which does not exist.
*** Couldn't write to list entry 7 of a list which has entries numbered from 1 to 6 ***
L now contains two instances of 208: {1, 7, 208, 5, -6, 6, 208}.

View file

@ -78,7 +78,8 @@
test 77: matching a<b-> in a- case sensitive --> <0> a-
test 78: compiling a<b-a> to error Invalid <> range "b-a" --> *** Regular expression error: Invalid {} range ***
*** Run-time problem P51: Syntax error in regular expression.
*** Run-time problem P51
*** Syntax error in regular expression.
test 79: compiling a<>b to error Unmatched < --> *** Regular expression error: Character range never ends ***
test 80: compiling a< to error Unmatched < --> *** Regular expression error: Character range never ends ***

View file

@ -78,7 +78,8 @@ test 76: matching a<-b> in a- case sensitive --> <0> a-
test 77: matching a<b-> in a- case sensitive --> <0> a-
test 78: compiling a<b-a> to error Invalid <> range "b-a" --> *** Regular expression error: Invalid {} range ***
*** Run-time problem P51: Syntax error in regular expression.
*** Run-time problem <nameless>
*** Syntax error in regular expression.
test 79: compiling a<>b to error Unmatched < --> *** Regular expression error: Character range never ends ***
test 80: compiling a< to error Unmatched < --> *** Regular expression error: Character range never ends ***

View file

@ -78,7 +78,8 @@ test 76: matching a<-b> in a- case sensitive --> <0> a-
test 77: matching a<b-> in a- case sensitive --> <0> a-
test 78: compiling a<b-a> to error Invalid <> range "b-a" --> *** Regular expression error: Invalid {} range ***
*** Run-time problem P51: Syntax error in regular expression.
*** Run-time problem P51
*** Syntax error in regular expression.
test 79: compiling a<>b to error Unmatched < --> *** Regular expression error: Character range never ends ***
test 80: compiling a< to error Unmatched < --> *** Regular expression error: Character range never ends ***

View file

@ -14,7 +14,8 @@
test 13: matching a<b-> in A- case insensitive --> <0> A-
test 14: compiling a<b-a> to error Invalid <> range "b-a" --> *** Regular expression error: Invalid {} range ***
*** Run-time problem P51: Syntax error in regular expression.
*** Run-time problem P51
*** Syntax error in regular expression.
test 15: compiling a<>b to error Unmatched < --> *** Regular expression error: Character range never ends ***
test 16: compiling a< to error Unmatched < --> *** Regular expression error: Character range never ends ***
@ -236,8 +237,8 @@
test 232: matching <a<:>b<:c> in abc case sensitive --> <0> abc
test 233: matching <a<:>b<:c> in abc case sensitive --> <0> abc
test 234: matching ((?>a+)b) in aaab case sensitive --> <1> aaab
test 235: matching (?>(a+))b in aaab case sensitive --> <1> aaab
test 221: matching (a*)b+ in caab case sensitive --> <2> aab
test 235: matching (?>(a+))b in aaab case sensitive --> <1> aaab
test 236: matching ((?><^()>+)|\(<^()>*\))+ in ((abc(ade)ufh()()x case sensitive --> <21> abc(ade)ufh()()x
test 237: compiling (?<=x+)y to error Variable length lookbehind not implemented --> *** Regular expression error: variable length lookbehind not implemented ***
test 238: compiling a{37,17} to error Can't do {n,m} with n > m --> *** Regular expression error: {x,y} with x greater than y ***

View file

@ -8,7 +8,8 @@
test 7: matching ()ef in def case sensitive --> <0> ef
test 8: compiling *a to error Quantifier follows nothing --> *** Regular expression error: quantifier misplaced ***
*** Run-time problem P51: Syntax error in regular expression.
*** Run-time problem P51
*** Syntax error in regular expression.
test 9: compiling (*)b to error Quantifier follows nothing --> *** Regular expression error: quantifier misplaced ***
test 10: matching $b in b case sensitive --> <2> --

View file

@ -1,9 +1,10 @@
Foo
*** Run-time problem P67: This operation can't be done with the relation 'is'.
*** Run-time problem P67
*** This operation can't be done with the relation 'is'.
Welcome
An Interactive Fiction
Release 1 / Serial number 150701 / Inform 7 build 6M44 (I6/v6.33 lib 6/12N) SD
Release 1 / Serial number 160428 / Inform 7 v10.2.0 / D
Foo

View file

@ -3,7 +3,7 @@
Chapter 11: The Midas Touch
An Interactive Fiction by Emily Short
Release 1 / Serial number 150512 / Inform 7 build 6M22 (I6/v6.33 lib 6/12N) SD
Release 1 / Serial number 160428 / Inform 7 v10.2.0 / D
Fitting Room
You can see a round door, Florence, a silver handbag (made of silk) (empty) and a pearl brooch (made of silk) here.
@ -86,7 +86,8 @@
> > Candy Room 10/14
** touch me
You drop the rubber chicken. The lavender suit (made of sow ear) wind up on the floor also.
*** Run-time problem P43: Attempt to remove the player from play.
*** Run-time problem P43
*** Attempt to remove the player from play.
You vanish!

View file

@ -1,7 +1,7 @@
Kitchen
Welcome
An Interactive Fiction
Release 1 / Serial number 150512 / Inform 7 build 6M22 (I6/v6.33 lib 6/12N) SD
Release 1 / Serial number 160428 / Inform 7 v10.2.0 / D
Kitchen
@ -10,13 +10,15 @@
>[1] x banana
Banana size A:
*** Run-time problem P10: Since the banana is not allowed the property "size", it is against the rules to try to use it.
*** Run-time problem P10
*** Since the banana is not allowed the property "size", it is against the rules to try to use it.
0.
>[2] touch banana
Banana size B:
*** Run-time problem P10: Since the banana is not allowed the property "size", it is against the rules to try to use it.
*** Run-time problem P10
*** Since the banana is not allowed the property "size", it is against the rules to try to use it.
0.

View file

@ -1,7 +1,7 @@
Testing
Welcome
An Interactive Fiction
Release 1 / Serial number 150512 / Inform 7 build 6M22 (I6/v6.33 lib 6/12N) SD
Release 1 / Serial number 160428 / Inform 7 v10.2.0 / D
Testing
You can see an umbrella and a pear here.
@ -11,7 +11,8 @@
>[1] put umbrella in pear
*** Run-time problem P62: Tried to change a relation for objects with the wrong kinds: Blorbing relates various devices to one thing, but you tried to relate (or unrelate) the umbrella to the pear.
*** Run-time problem P62
*** Tried to change a relation for objects with the wrong kinds: Blorbing relates various devices to one thing, but you tried to relate (or unrelate) the umbrella to the pear.
> >

View file

@ -13,7 +13,8 @@
These, however, should fail as being out of range.
*** Couldn't write to list entry 0 of a list which has entries numbered from 1 to 6 ***
*** Run-time problem P50: Attempt to use list item which does not exist.
*** Run-time problem P50
*** Attempt to use list item which does not exist.
*** Couldn't write to list entry 7 of a list which has entries numbered from 1 to 6 ***
L now contains two instances of 208: {1, 11, 208, 5, 0, 6, 208}.
@ -29,7 +30,7 @@
Welcome
An Interactive Fiction
Release 1 / Serial number 150512 / Inform 7 build 6M22 (I6/v6.33 lib 6/12N) SD
Release 1 / Serial number 160428 / Inform 7 v10.2.0 / D
Brahms Conservatoire

View file

@ -13,7 +13,8 @@
These, however, should fail as being out of range.
*** Couldn't write to list entry 0 of a list which has entries numbered from 1 to 6 ***
*** Run-time problem P50: Attempt to use list item which does not exist.
*** Run-time problem P50
*** Attempt to use list item which does not exist.
*** Couldn't write to list entry 7 of a list which has entries numbered from 1 to 6 ***
L now contains two instances of 208: {1, 11, 208, 5, 0, 6, 208}.
@ -29,7 +30,7 @@
Welcome
An Interactive Fiction
Release 1 / Serial number 150512 / Inform 7 build 6M22 (I6/v6.33 lib 6/12N) SD
Release 1 / Serial number 160428 / Inform 7 v10.2.0 / D
Brahms Conservatoire

View file

@ -1,13 +1,14 @@
Home
Today's prime is *** Couldn't read from entry -35 of a list which has entries numbered from 1 to 5 ***
*** Run-time problem P50: Attempt to use list item which does not exist.
*** Run-time problem P50
*** Attempt to use list item which does not exist.
2.
Welcome
An Interactive Fiction
Release 1 / Serial number 150512 / Inform 7 build 6M22 (I6/v6.33 lib 6/12N) SD
Release 1 / Serial number 160428 / Inform 7 v10.2.0 / D
Home

View file

@ -1,9 +1,10 @@
Foo
*** Run-time problem P68: Attempt to resize list to -2 entries - there must always be 0 or more.
*** Run-time problem P68
*** Attempt to resize list to -2 entries - there must always be 0 or more.
Welcome
An Interactive Fiction
Release 1 / Serial number 150829 / Inform 7 build 6M52 (I6/v6.33 lib 6/12N) SD
Release 1 / Serial number 160428 / Inform 7 v10.2.0 / D
Foo

View file

@ -4,7 +4,8 @@
S is now {2, 4, 3, 8, 16, 32, 64, 2}.
*** Couldn't add at entry 0 in the list {2, 4, 3, 8, 16, 32, 64, 2}, which has entries in the range 1 to 8 ***
*** Run-time problem P50: Attempt to use list item which does not exist.
*** Run-time problem P50
*** Attempt to use list item which does not exist.
*** Couldn't add at entry 10 in the list {2, 4, 3, 8, 16, 32, 64, 2}, which has entries in the range 1 to 8 ***
S is now {2, 4, 2, 4, 6, 10, 3, 8, 16, 32, 64, 2}.
@ -15,7 +16,7 @@
Welcome
An Interactive Fiction
Release 1 / Serial number 150512 / Inform 7 build 6M22 (I6/v6.33 lib 6/12N) SD
Release 1 / Serial number 160428 / Inform 7 v10.2.0 / D
Brahms Conservatoire

View file

@ -1,12 +1,13 @@
Foo
Clomp!
*** Run-time problem P47 (at paragraph 8 in the source text): Phrase applied to an incompatible kind of value.
*** Run-time problem P47
*** Phrase applied to an incompatible kind of value.
Welcome
An Interactive Fiction
Release 1 / Serial number 160428 / Inform 7 v10.1.0 / D
Release 1 / Serial number 160428 / Inform 7 v10.2.0 / D
Foo

View file

@ -1,7 +1,7 @@
Cave
Welcome
An Interactive Fiction
Release 1 / Serial number 150512 / Inform 7 build 6M22 (I6/v6.33 lib 6/12N) SD
Release 1 / Serial number 160428 / Inform 7 v10.2.0 / D
Cave
You can see a jelly monster here.
@ -11,12 +11,14 @@
>[1] e
*** Run-time problem P63: Tried to make the player part of something: the jelly monster.
*** Run-time problem P63
*** Tried to make the player part of something: the jelly monster.
>[2] w
*** Run-time problem P63: Tried to make the player part of something: the parasitic cream blob.
*** Run-time problem P63
*** Tried to make the player part of something: the parasitic cream blob.
> >

View file

@ -1,5 +1,5 @@
Hey, there's no problem here.
"1 divided by 0" = number:
*** Run-time problem P17: You can't divide by zero.
*** Run-time problem DividedByZero: INTERNAL/Inter/BasicInformKit/RTPs
*** You can't divide by zero.
0

View file

@ -1,7 +1,7 @@
Arena
Welcome
An Interactive Fiction
Release 1 / Serial number 150512 / Inform 7 build 6M22 (I6/v6.33 lib 6/12N) SD
Release 1 / Serial number 160428 / Inform 7 v10.2.0 / D
Arena
You can see Fred, Daphne and Felix here.
@ -21,7 +21,8 @@
>[3] kiss felix
*** Run-time problem P47 (at paragraph 5 in the source text): Phrase applied to an incompatible kind of value.
*** Run-time problem P47
*** Phrase applied to an incompatible kind of value.
Felix might not like that.

View file

@ -172,11 +172,12 @@
*** Run-time problem P53: Only backdrops can be moved to multiple places.
*** Run-time problem P53
*** Only backdrops can be moved to multiple places.
Welcome
An Interactive Fiction
Release 1 / Serial number 150512 / Inform 7 build 6M22 (I6/v6.33 lib 6/12N) SD
Release 1 / Serial number 160428 / Inform 7 v10.2.0 / D
Aleph

View file

@ -943,6 +943,17 @@ To next -- in loop
(documented at ph_next):
(- continue; -).
@ The following innocent-looking definition throws a problem message if the
RTP label is not (a) literal text and (b) the leafname of a Markdown file
(once |.md| has been added) in the |RTPs| subdirectory of the current
extension directory: it can only be used from with a directory-format extension.
=
Section 5 - Run-Time Problems
To issue the run-time problem (pcode - text):
(- IssueRTP({-rtp-code: pcode}, -1, {-rtp-location: pcode}); -).
@h Values.
Some of the things we can do with enumerations, others being listed under
randomness below.

View file

@ -382,10 +382,8 @@ These all modify the way a token is compiled.
if (C == box_quotation_text_ISINC) @<Inline annotation "box-quotation-text"@>;
#ifdef IF_MODULE
if (C == try_action_ISINC) @<Inline annotation "try-action"@>;
if (C == try_action_silently_ISINC) @<Inline annotation "try-action-silently"@>;
#endif
if (C == return_value_ISINC) @<Inline annotation "return-value"@>;
if (C == return_value_from_rule_ISINC) @<Inline annotation "return-value-from-rule"@>;
@ -393,6 +391,9 @@ These all modify the way a token is compiled.
if (C == property_holds_block_value_ISINC) @<Inline annotation "property-holds-block-value"@>;
if (C == mark_event_used_ISINC) @<Inline annotation "mark-event-used"@>;
if (C == rtp_code_ISINC) @<Inline annotation "rtp-code"@>;
if (C == rtp_location_ISINC) @<Inline annotation "rtp-location"@>;
if ((C != no_ISINC) && (valid_annotation == FALSE))
@<Throw a problem message for an invalid inline annotation@>;
@ -603,6 +604,96 @@ that would be "property name". Instead:
PluginCalls::nonstandard_inline_annotation(ist->inline_command, supplied);
valid_annotation = TRUE;
@<Inline annotation "rtp-code"@> =
if (Rvalues::is_CONSTANT_of_kind(supplied, K_text) == FALSE) {
@<Throw PM_NonConstantRTPCode@>;
} else {
wording SW = Node::get_text(supplied);
if (Wordings::length(SW) == 1) {
int w1 = Wordings::first_wn(SW);
inform_extension *E = Extensions::corresponding_to(Lexer::file_of_origin(w1));
if ((E == NULL) || (E->as_copy->location_if_path == NULL))
@<Throw PM_RTPOnlyInExtensions@>
else {
wchar_t *p = Lexer::word_text(w1);
TEMPORARY_TEXT(pcode)
for (; *p; p++) if (*p != '"') PUT_TO(pcode, *p);
EmitCode::val_text(pcode);
pathname *P = Pathnames::down(E->as_copy->location_if_path, I"RTPs");
WRITE_TO(pcode, ".md");
filename *F = Filenames::in(P, pcode);
if (TextFiles::exists(F) == FALSE) {
LOG("Looked for RTP text at: %f\n", F);
@<Throw PM_UnrecognisedRTPCode@>;
}
DISCARD_TEXT(pcode)
}
} else @<Throw PM_UnrecognisedRTPCode@>;
}
return;
@<Inline annotation "rtp-location"@> =
if (Rvalues::is_CONSTANT_of_kind(supplied, K_text) == FALSE) {
@<Throw PM_NonConstantRTPCode@>;
} else {
wording SW = Node::get_text(supplied);
if (Wordings::length(SW) == 1) {
int w1 = Wordings::first_wn(SW);
inform_extension *E = Extensions::corresponding_to(Lexer::file_of_origin(w1));
if ((E == NULL) || (E->as_copy->location_if_path == NULL))
@<Throw PM_RTPOnlyInExtensions@>
else {
wchar_t *p = Lexer::word_text(w1);
TEMPORARY_TEXT(pcode)
for (; *p; p++) if (*p != '"') PUT_TO(pcode, *p);
pathname *P = Pathnames::down(E->as_copy->location_if_path, I"RTPs");
WRITE_TO(pcode, ".md");
filename *F = Filenames::in(P, pcode);
if (TextFiles::exists(F) == FALSE) {
LOG("Looked for RTP text at: %f\n", F);
@<Throw PM_UnrecognisedRTPCode@>;
} else {
Str::clear(pcode);
CompletionModule::write_RTP_path(pcode, P);
EmitCode::val_text(pcode);
}
DISCARD_TEXT(pcode)
}
} else @<Throw PM_UnrecognisedRTPCode@>;
}
return;
@<Throw PM_NonConstantRTPCode@> =
Problems::quote_source(1, current_sentence);
Problems::quote_spec(2, supplied);
StandardProblems::handmade_problem(Task::syntax_tree(), _p_(PM_NonConstantRTPCode));
Problems::issue_problem_segment(
"In %1, a run-time problem must be identified by a literal code in double-quotation "
"marks: other forms of text, such as '%2', do not count.");
Problems::issue_problem_end();
return;
@<Throw PM_UnrecognisedRTPCode@> =
Problems::quote_source(1, current_sentence);
Problems::quote_spec(2, supplied);
StandardProblems::handmade_problem(Task::syntax_tree(), _p_(PM_UnrecognisedRTPCode));
Problems::issue_problem_segment(
"In %1, a run-time problem must be identified by a literal code in double-quotation "
"marks: but '%2' does not seem to be one of the RTPs for the current extension.");
Problems::issue_problem_end();
return;
@<Throw PM_RTPOnlyInExtensions@> =
Problems::quote_source(1, current_sentence);
Problems::quote_spec(2, supplied);
StandardProblems::handmade_problem(Task::syntax_tree(), _p_(PM_RTPOnlyInExtensions));
Problems::issue_problem_segment(
"You wrote %1, but run-time problems can only be issued from extensions which "
"are stored in directory form, not from the main source text of a project or "
"from an extension stored in a single .i7x file.");
Problems::issue_problem_end();
return;
@<Throw a problem message for an invalid inline annotation@> =
Problems::quote_source(1, current_sentence);
Problems::quote_stream(2, ist->command);

View file

@ -92,27 +92,13 @@ void CompletionModule::compile(void) {
inform_project *proj = Task::project();
kit_dependency *kd;
LOOP_OVER_LINKED_LIST(kd, kit_dependency, proj->kits_to_include) {
pathname *P = kd->kit->as_copy->location_if_path;
pathname *P = Pathnames::down(kd->kit->as_copy->location_if_path, I"RTPs");
text_stream *name = kd->kit->as_copy->edition->work->title;
TEMPORARY_TEXT(identifier)
WRITE_TO(identifier, "%SRTPs", name);
@<Define an RTP location for P with this name@>;
DISCARD_TEXT(identifier)
}
inform_extension *E;
LOOP_OVER_LINKED_LIST(E, inform_extension, proj->extensions_included) {
pathname *P = E->as_copy->location_if_path;
if (P) {
text_stream *name = E->as_copy->edition->work->title;
TEMPORARY_TEXT(identifier)
LOOP_THROUGH_TEXT(pos, name)
if (Str::get(pos) != ' ')
PUT_TO(identifier, Str::get(pos));
WRITE_TO(identifier, "RTPs");
@<Define an RTP location for P with this name@>;
DISCARD_TEXT(identifier)
}
}
@<Define an RTP location for P with this name@> =
TEMPORARY_TEXT(at)
@ -123,18 +109,7 @@ void CompletionModule::compile(void) {
TEMPORARY_TEXT(I_text)
if (Supervisor::installed_files())
WRITE_TO(I_text, "%p", Supervisor::installed_files());
if (Str::begins_with(P_text, M_text)) {
WRITE_TO(at, "MATERIALS/");
Pathnames::to_text_relative(at, Projects::materials_path(proj), P);
} else if ((Str::len(I_text) > 0) && (Str::begins_with(P_text, I_text))) {
WRITE_TO(at, "INTERNAL/");
Pathnames::to_text_relative(at, Supervisor::installed_files(), P);
} else {
WRITE_TO(at, "%S", P_text);
}
LOG("DEFINE %S = %S.\n", identifier, at);
CompletionModule::write_RTP_path(at, P);
package_request *pack = Hierarchy::completion_package(RTPS_HAP);
inter_name *iname = Hierarchy::make_iname_in(RTP_SOURCE_HL, pack);
InterNames::set_translation(iname, identifier);
@ -142,9 +117,6 @@ void CompletionModule::compile(void) {
Emit::text_constant(iname, at);
Hierarchy::make_available(iname);
DISCARD_TEXT(at)
DISCARD_TEXT(P_text)
DISCARD_TEXT(M_text)
DISCARD_TEXT(I_text)
@<Debugging log aspects@> =
for (int i=0; i<NO_DEFINED_DA_VALUES; i++) {
@ -158,6 +130,31 @@ void CompletionModule::compile(void) {
}
}
@ =
void CompletionModule::write_RTP_path(OUTPUT_STREAM, pathname *P) {
inform_project *proj = Task::project();
TEMPORARY_TEXT(P_text)
WRITE_TO(P_text, "%p", P);
TEMPORARY_TEXT(M_text)
WRITE_TO(M_text, "%p", Projects::materials_path(proj));
TEMPORARY_TEXT(I_text)
if (Supervisor::installed_files())
WRITE_TO(I_text, "%p", Supervisor::installed_files());
if (Str::begins_with(P_text, M_text)) {
WRITE("MATERIALS/");
Pathnames::to_text_relative(OUT, Projects::materials_path(proj), P);
} else if ((Str::len(I_text) > 0) && (Str::begins_with(P_text, I_text))) {
WRITE("INTERNAL/");
Pathnames::to_text_relative(OUT, Supervisor::installed_files(), P);
} else {
WRITE("%S", P_text);
}
DISCARD_TEXT(P_text)
DISCARD_TEXT(M_text)
DISCARD_TEXT(I_text)
}
@ =
typedef struct heading_compilation_data {
struct package_request *heading_package;

View file

@ -11,7 +11,7 @@ Constant Budger = 32738;
Constant Danza = (2 + 34);
Constant Sahara = (Danza + Bidger + 1);
#Ifdef TARGET_ZCODE;
#OrigSource "inter/final-module/Chapter 4/Final Inform 6.w" 155;
#OrigSource "inter/final-module/Chapter 4/Final Inform 6.w" 162;
Global max_z_object;
#Ifdef Z__Region;
[ OC__Cl obj cla j a n objflag;

View file

@ -22,7 +22,7 @@ Class K_mica
class K_stone
;
#Ifdef TARGET_ZCODE;
#OrigSource "inter/final-module/Chapter 4/Final Inform 6.w" 155;
#OrigSource "inter/final-module/Chapter 4/Final Inform 6.w" 162;
Global max_z_object;
#Ifdef Z__Region;
[ OC__Cl obj cla j a n objflag;

View file

@ -7,7 +7,7 @@ Global or_tmp_var;
Constant Banana = 2;
Constant Peach = Banana;
#Ifdef TARGET_ZCODE;
#OrigSource "inter/final-module/Chapter 4/Final Inform 6.w" 155;
#OrigSource "inter/final-module/Chapter 4/Final Inform 6.w" 162;
Global max_z_object;
#Ifdef Z__Region;
[ OC__Cl obj cla j a n objflag;

View file

@ -5,7 +5,7 @@ Constant Grammar__Version 2;
Global debug_flag;
Global or_tmp_var;
#Ifdef TARGET_ZCODE;
#OrigSource "inter/final-module/Chapter 4/Final Inform 6.w" 155;
#OrigSource "inter/final-module/Chapter 4/Final Inform 6.w" 162;
Global max_z_object;
#Ifdef Z__Region;
[ OC__Cl obj cla j a n objflag;

View file

@ -7,7 +7,7 @@ Global or_tmp_var;
Constant I_green = 1;
Constant I_red = 17;
#Ifdef TARGET_ZCODE;
#OrigSource "inter/final-module/Chapter 4/Final Inform 6.w" 155;
#OrigSource "inter/final-module/Chapter 4/Final Inform 6.w" 162;
Global max_z_object;
#Ifdef Z__Region;
[ OC__Cl obj cla j a n objflag;

View file

@ -5,7 +5,7 @@ Constant Grammar__Version 2;
Global debug_flag;
Global or_tmp_var;
#Ifdef TARGET_ZCODE;
#OrigSource "inter/final-module/Chapter 4/Final Inform 6.w" 155;
#OrigSource "inter/final-module/Chapter 4/Final Inform 6.w" 162;
Global max_z_object;
#Ifdef Z__Region;
[ OC__Cl obj cla j a n objflag;

View file

@ -351,6 +351,8 @@ inter_schema_token *InterSchemas::new_token(int type, text_stream *material,
@e return_value_from_rule_ISINC
@e property_holds_block_value_ISINC
@e mark_event_used_ISINC
@e rtp_code_ISINC
@e rtp_location_ISINC
@e my_ISINC
@e unprotect_ISINC
@e copy_ISINC

View file

@ -301,6 +301,10 @@ a bracing.
c = property_holds_block_value_ISINC;
} else if (Str::eq_wide_string(t->command, L"mark-event-used")) {
c = mark_event_used_ISINC;
} else if (Str::eq_wide_string(t->command, L"rtp-code")) {
c = rtp_code_ISINC;
} else if (Str::eq_wide_string(t->command, L"rtp-location")) {
c = rtp_location_ISINC;
} else if (Str::eq_wide_string(t->command, L"my")) {
c = my_ISINC;
} else if (Str::eq_wide_string(t->command, L"unprotect")) {