From 4a252c10cca3344602ec6a608ceb0f58aebd3733 Mon Sep 17 00:00:00 2001
From: Graham Nelson Resources
Repository
Related Projects
@@ -3375,13 +3377,16 @@ code above.
-[ TestScope obj act a al sr x y; +[ TestScope obj act a al sr ss st x y; x = parser_one; y = parser_two; parser_one = obj; parser_two = 0; a = actor; al = actors_location; + ss = scope_stage; st = scope_token; + scope_stage = 0; scope_token = 0; sr = scope_reason; scope_reason = TESTSCOPE_REASON; if (act == 0) actor = player; else actor = act; actors_location = ScopeCeiling(actor); SearchScope(actors_location, actor, 0); scope_reason = sr; actor = a; + scope_stage = ss; scope_token = st; actors_location = al; parser_one = x; x = parser_two; parser_two = y; return x; ]; diff --git a/docs/CommandParserKit/S-tkn.html b/docs/CommandParserKit/S-tkn.html index 498e66e47..d9a69c06a 100644 --- a/docs/CommandParserKit/S-tkn.html +++ b/docs/CommandParserKit/S-tkn.html @@ -47,7 +47,9 @@ MathJax = {
After that, there are two cases: existential sentences (such as "there are -two cases") and all others (such as "regular meaning are more subtle"). +two cases") and all others (such as "regular meanings are more subtle"). +
+ +The trickiest form is "There is a container with carrying capacity 30", say, +which equates DEFECTIVE_NOUN_NT with WITH_NT. This is somehow both cases +at once, and we have to perform both an existential assertion and a coupling.
Act on regular meaning3.1.2.3 = @@ -300,7 +305,14 @@ two cases") and all others (such as "regular meaning are more subtle"). (Refiner::refine_coupling(px, py, FALSE))) { if (Node::get_type(px) == DEFECTIVE_NOUN_NT) { Assertions::make_existential(py); - Anaphora::change_discussion_from_coupling(py, py); + if (Node::get_type(py) == WITH_NT) { + px = py->down; + py = py->down->next; + Assertions::make_coupling(px, py); + Anaphora::change_discussion_from_coupling(px, py); + } else { + Anaphora::change_discussion_from_coupling(py, py); + } } else { Assertions::make_coupling(px, py); Anaphora::change_discussion_from_coupling(px, py); diff --git a/docs/assertions-module/5-rf.html b/docs/assertions-module/5-rf.html index d05d1fcbc..f298f8a51 100644 --- a/docs/assertions-module/5-rf.html +++ b/docs/assertions-module/5-rf.html @@ -743,7 +743,8 @@ parser, recording how it most recently failed. "is '%2'. %3 did not make sense as a description of an action."); See if it starts with a valid action name, at least11.1.1.5.1; See if this might be a when-for confusion11.1.1.5.2; - Break down the action list and say which are okay11.1.1.5.3; + See if this might be an it-something confusion11.1.1.5.3; + Break down the action list and say which are okay11.1.1.5.4; Problems::issue_problem_segment( " I am unable to place this rule into any rulebook."); Problems::issue_problem_end(); @@ -783,14 +784,35 @@ parser, recording how it most recently failed. }
§11.1.1.5.3. If the action pattern contains what looks like a list of action names, as for example +
§11.1.1.5.3. See if this might be an it-something confusion11.1.1.5.3 = +
+ ++ action_name *an; + LOOP_OVER(an, action_name) { + wording N = ActionNameNames::tensed(an, IS_TENSE); + if ((ActionSemantics::max_parameters(an) > 1) && + ((Wordings::length(rfd->applicability) >= Wordings::length(N)) && + (Wordings::match(N, + Wordings::truncate(rfd->applicability, Wordings::length(N)))))) { + Problems::quote_wording(3, ActionNameNames::tensed(an, IS_TENSE)); + Problems::issue_problem_segment( + " (I notice that there's an action called '%3': the 'it' in the name " + "is meant to be where something is specified about the first thing " + "it acts on. Try using 'something' rather than 'it'?)"); + break; + } + } ++
§11.1.1.5.4. If the action pattern contains what looks like a list of action names, as for example "Instead of taking or dropping the magnet: ..." then the <anl-diagnosis> grammar will parse this and return N equal to 2, the apparent number of action names. We then run the grammar again, but this time allowing it to print comments on each apparent action name it sees.
-Break down the action list and say which are okay11.1.1.5.3 = +
Break down the action list and say which are okay11.1.1.5.4 =
diff --git a/docs/if-module/2-tbf.html b/docs/if-module/2-tbf.html index 9b5c81107..6b5cafd21 100644 --- a/docs/if-module/2-tbf.html +++ b/docs/if-module/2-tbf.html @@ -268,6 +268,7 @@ own credits.diff --git a/docs/inblorb/3-laaf.html b/docs/inblorb/3-laaf.html index b7fd955ca..5b7118a9d 100644 --- a/docs/inblorb/3-laaf.html +++ b/docs/inblorb/3-laaf.html @@ -219,8 +219,8 @@ will not work.auxiliary_file *af; LOOP_OVER(af, auxiliary_file) { + LOG("afftrt %p, trp %p\n", af->folder_to_release_to, Task::release_path()); TEMPORARY_TEXT(rel) Pathnames::to_text_relative(rel, af->folder_to_release_to, Task::release_path()); WRITE("auxiliary \"%f\" \"%S\" \"%S\"\n", diff --git a/docs/if-module/5-us.html b/docs/if-module/5-us.html index 89b8d4cc8..36f73b34d 100644 --- a/docs/if-module/5-us.html +++ b/docs/if-module/5-us.html @@ -781,15 +781,24 @@ it, one at a time, by previous Understand sentences. (Str::len(RTKindConstructors::get_recognition_only_GPR(ValueProperties::kind(pr))) == 0) && ((Kinds::Behaviour::is_object(ValueProperties::kind(pr))) || (RTKindConstructors::request_I6_GPR(ValueProperties::kind(pr)) == FALSE))) { - StandardProblems::sentence_problem(Task::syntax_tree(), - _p_(PM_BadReferringProperty), - "that property is of a kind which I can't recognise in " - "typed commands", - "so that it cannot be understand as describing or referring to " - "something. I can understand either/or properties, properties " - "with a limited list of named possible values, numbers, times " - "of day, or units; but certain built-into-Inform kinds of value " - "(like snippet or rulebook, for instance) I can't use."); + if (Kinds::Behaviour::is_object(ValueProperties::kind(pr))) + StandardProblems::sentence_problem(Task::syntax_tree(), + _p_(PM_ThingReferringProperty), + "the value of that property is itself a kind of object", + "so that it cannot be understand as describing or referring to " + "something. I can understand either/or properties, properties " + "with a limited list of named possible values, numbers, times " + "of day, or units."); + else + StandardProblems::sentence_problem(Task::syntax_tree(), + _p_(PM_BadReferringProperty), + "that property is of a kind which I can't recognise in " + "typed commands", + "so that it cannot be understand as describing or referring to " + "something. I can understand either/or properties, properties " + "with a limited list of named possible values, numbers, times " + "of day, or units; but certain built-into-Inform kinds of value " + "(like snippet or rulebook, for instance) I can't use."); } if (Visibility::set(pr, subj, level, WHENW) == FALSE) { StandardProblems::sentence_problem(Task::syntax_tree(), diff --git a/docs/imperative-module/3-cb.html b/docs/imperative-module/3-cb.html index aef0fe315..fd233bb18 100644 --- a/docs/imperative-module/3-cb.html +++ b/docs/imperative-module/3-cb.html @@ -203,7 +203,7 @@ for the loop hasn't been compiled yet.) CodeBlocks::pop_stack(); } CodeBlocks::prepush_stack(); - Construct the next phrase block9.1; + if (block_being_opened) Construct the next phrase block9.1; }§9.1. In the case of a repeat through a Table, we need to create two loop @@ -228,12 +228,16 @@ the loop begins, and pull them again when it finishes.
-void CodeBlocks::attach_back_schema(inter_schema *I, csi_state CSIS) { - block_being_opened->switch_val = NULL; - if (Invocations::get_no_tokens(CSIS.inv) > 0) - block_being_opened->switch_val = CSIS.tokens->token_vals[0]; - block_being_opened->tail_schema = I; - block_being_opened->compilation_state = CSIS; +int CodeBlocks::attach_back_schema(inter_schema *I, csi_state CSIS) { + if (block_being_opened) { + block_being_opened->switch_val = NULL; + if (Invocations::get_no_tokens(CSIS.inv) > 0) + block_being_opened->switch_val = CSIS.tokens->token_vals[0]; + block_being_opened->tail_schema = I; + block_being_opened->compilation_state = CSIS; + return TRUE; + } + return FALSE; }§11. At this next stage, the preliminary code for the loop (if it's a loop) diff --git a/docs/imperative-module/5-cii.html b/docs/imperative-module/5-cii.html index 00b3bb673..bfa64843a 100644 --- a/docs/imperative-module/5-cii.html +++ b/docs/imperative-module/5-cii.html @@ -141,10 +141,17 @@ the code block in question. Create any new local variables explicitly called for3.2; CSIInline::from_schema(idb->head_of_defn->at, CompileImperativeDefn::get_front_schema(idb), &CSIS); - if (IDTypeData::block_follows(idb)) - CodeBlocks::attach_back_schema(CompileImperativeDefn::get_back_schema(idb), CSIS); - else + if (IDTypeData::block_follows(idb)) { + if (CodeBlocks::attach_back_schema( + CompileImperativeDefn::get_back_schema(idb), CSIS) == FALSE) { + StandardProblems::sentence_problem(Task::syntax_tree(), + _p_(PM_LoopWithoutBody), + "there doesn't seem to be any body to this phrase", + "in the way that a 'repeat', 'if' or 'while' is expected to have."); + } + } else { Release any my-variables created inline3.3; + } return idb->compilation_data.inline_mor; }
void Links::request_copy_of_auxiliaries(void) { auxiliary_file *aux; - LOOP_OVER(aux, auxiliary_file) - if (Str::eq(aux->format, I"link")) { + LOOP_OVER(aux, auxiliary_file) { + if (Str::ne(aux->format, I"link")) { if (verbose_mode) PRINT("! COPY <%f> as <%S>\n", aux->full_filename, aux->aux_leafname); TEMPORARY_TEXT(as_text) @@ -228,6 +228,7 @@ will not work. Requests::request_copy(as_text, aux->aux_leafname, aux->aux_subfolder); DISCARD_TEXT(as_text) } + } }