diff --git a/inbuild/supervisor-module/Chapter 6/Inclusions.w b/inbuild/supervisor-module/Chapter 6/Inclusions.w index 5e4f93c03..1bdd61942 100644 --- a/inbuild/supervisor-module/Chapter 6/Inclusions.w +++ b/inbuild/supervisor-module/Chapter 6/Inclusions.w @@ -91,7 +91,7 @@ word "Include", which might e.g. be "Locksmith by Emily Short". ::= *** | ==> @ - ... ==> 0; <> = Wordings::first_wn(W); <> = Wordings::last_wn(W) + ... ==> { 0, -, <> = Wordings::first_wn(W), <> = Wordings::last_wn(W) } @ Quite a popular mistake, this: diff --git a/inbuild/supervisor-module/Chapter 6/Source Text.w b/inbuild/supervisor-module/Chapter 6/Source Text.w index d222e7047..573e7420c 100644 --- a/inbuild/supervisor-module/Chapter 6/Source Text.w +++ b/inbuild/supervisor-module/Chapter 6/Source Text.w @@ -247,8 +247,8 @@ and here goes: section ... ==> { 5, - } ::= - ... begin/begins here | ==> -1; @; - ... end/ends here ==> -2; @; + ... begin/begins here | ==> { -1, - }; @; + ... end/ends here ==> { -2, - }; @; @ Note that the extension end markers are only read in extensions, so they can never accidentally match in the main source text. @@ -271,16 +271,16 @@ never accidentally match in the main source text. = ::= - | ==> 0; sfsm->nt = BIBLIOGRAPHIC_NT; - ... | ==> 0; sfsm->nt = BIBLIOGRAPHIC_NT; + | ==> { 0, - }; sfsm->nt = BIBLIOGRAPHIC_NT; + ... | ==> { 0, - }; sfsm->nt = BIBLIOGRAPHIC_NT; | ==> { pass 1 } - * | ==> 0; sfsm->nt = TRACE_NT; - * | ==> 0; sfsm->nt = TRACE_NT; - table ... | ==> 0; sfsm->nt = TABLE_NT; - equation ... | ==> 0; sfsm->nt = EQUATION_NT; - include the ... by ... | ==> 0; sfsm->nt = INCLUDE_NT; - include ... by ... | ==> 0; sfsm->nt = INCLUDE_NT; - include (- ... ==> 0; sfsm->nt = INFORM6CODE_NT; + * | ==> { 0, - }; sfsm->nt = TRACE_NT; + * | ==> { 0, - }; sfsm->nt = TRACE_NT; + table ... | ==> { 0, - }; sfsm->nt = TABLE_NT; + equation ... | ==> { 0, - }; sfsm->nt = EQUATION_NT; + include the ... by ... | ==> { 0, - }; sfsm->nt = INCLUDE_NT; + include ... by ... | ==> { 0, - }; sfsm->nt = INCLUDE_NT; + include (- ... ==> { 0, - }; sfsm->nt = INFORM6CODE_NT; @ Rules are ordinarily detected by their colon, which divides the header from the rest: colons are not otherwise legal in Inform. But there's an exception. If the @@ -305,7 +305,7 @@ sentences. Whereas other nonstructural sentences can wait, these can't. = ::= - include (- ### in the preform grammar | ==> -2; sfsm->nt = INFORM6CODE_NT; + include (- ### in the preform grammar | ==> { -2, - }; sfsm->nt = INFORM6CODE_NT; use ... language element/elements ==> { -1, - } @ The following callback function is called by //syntax// when it breaks a diff --git a/inform7/Figures/memory-diagnostics.txt b/inform7/Figures/memory-diagnostics.txt index 4f091f19b..4e91b9711 100644 --- a/inform7/Figures/memory-diagnostics.txt +++ b/inform7/Figures/memory-diagnostics.txt @@ -1,6 +1,6 @@ Total memory consumption was 257150K = 251 MB -62.5% was used for 1344926 objects, in 273456 frames in 201 x 800K = 160800K = 157 MB: +62.5% was used for 1344930 objects, in 273460 frames in 201 x 800K = 160800K = 157 MB: 9.8% inter_tree_node_array 36 x 8192 = 294912 objects, 25953408 bytes 5.4% text_stream_array 2570 x 100 = 257000 objects, 14474240 bytes @@ -20,8 +20,8 @@ Total memory consumption was 257150K = 251 MB 0.3% excerpt_meaning 3102 objects, 967824 bytes 0.3% inter_name_array 20 x 1000 = 20000 objects, 960640 bytes 0.3% inter_package 13201 objects, 950472 bytes - 0.3% production 3899 objects, 904568 bytes - 0.3% ptoken 8420 objects, 875680 bytes + 0.3% production 3901 objects, 905032 bytes + 0.3% ptoken 8422 objects, 875888 bytes 0.3% grammatical_usage 3614 objects, 867360 bytes 0.3% individual_form 2564 objects, 861504 bytes 0.3% inter_symbols_table 13201 objects, 844864 bytes @@ -229,5 +229,5 @@ Total memory consumption was 257150K = 251 MB ---- emitter array storage 14368 bytes in 8 claims ---- code generation workspace for objects 9200 bytes in 9 claims -20.1% was overhead - 53146680 bytes = 51901K = 50 MB +20.1% was overhead - 53146008 bytes = 51900K = 50 MB diff --git a/inform7/Figures/timings-diagnostics.txt b/inform7/Figures/timings-diagnostics.txt index 6ff7f716e..ca96f5de9 100644 --- a/inform7/Figures/timings-diagnostics.txt +++ b/inform7/Figures/timings-diagnostics.txt @@ -1,14 +1,14 @@ 100.0% in inform7 run - 66.5% in compilation to Inter - 24.8% in //Phrases::Manager::compile_first_block// - 8.8% in //Phrases::Manager::compile_as_needed// - 7.3% in //Strings::compile_responses// + 66.8% in compilation to Inter + 25.0% in //Phrases::Manager::compile_first_block// + 8.9% in //Phrases::Manager::compile_as_needed// + 7.2% in //Strings::compile_responses// 6.5% in //World::Compile::compile// - 3.3% in //Assertions::Traverse::traverse1// + 3.4% in //Assertions::Traverse::traverse1// 3.3% in //Sentences::VPs::traverse// - 2.1% in //Phrases::Manager::RulePrintingRule_routine// - 2.1% in //Phrases::Manager::rulebooks_array// - 1.0% in //NewVerbs::ConjugateVerb// + 2.2% in //Phrases::Manager::RulePrintingRule_routine// + 1.9% in //Phrases::Manager::rulebooks_array// + 0.9% in //NewVerbs::ConjugateVerb// 0.8% in //Phrases::Manager::traverse// 0.5% in //Phrases::Manager::parse_rule_parameters// 0.4% in //Phrases::Manager::compile_rulebooks// @@ -25,11 +25,11 @@ 0.1% in //Sentences::Rearrangement::tidy_up_ofs_and_froms// 0.1% in //Sentences::RuleSubtrees::register_recently_lexed_phrases// 0.1% in //World::complete_additions// - 2.8% not specifically accounted for - 31.2% in running Inter pipeline + 2.9% not specifically accounted for + 30.9% in running Inter pipeline 10.6% in step preparation 10.2% in inter step 2/12: link - 7.6% in inter step 12/12: generate inform6 -> auto.inf + 7.1% in inter step 12/12: generate inform6 -> auto.inf 0.3% in inter step 9/12: make-identifiers-unique 0.2% in inter step 10/12: reconcile-verbs 0.2% in inter step 11/12: eliminate-redundant-labels @@ -39,6 +39,6 @@ 0.1% in inter step 4/12: parse-linked-matter 0.1% in inter step 5/12: resolve-conditional-compilation 0.1% in inter step 8/12: inspect-plugs - 1.0% not specifically accounted for + 1.2% not specifically accounted for 2.0% in supervisor - 0.3% not specifically accounted for + 0.2% not specifically accounted for diff --git a/inform7/core-module/Chapter 10/Conditions and Phrases.w b/inform7/core-module/Chapter 10/Conditions and Phrases.w index a3d1b1c87..0a853141d 100644 --- a/inform7/core-module/Chapter 10/Conditions and Phrases.w +++ b/inform7/core-module/Chapter 10/Conditions and Phrases.w @@ -19,8 +19,8 @@ only valid impure conditions are description noun phrases. = ::= - | ==> { pass 1 } - ==> { pass 1 } + | ==> { pass 1 } + ==> { pass 1 } @ Now for pure conditions. Note that logical "and" and "or" are implemented directly right here, rather than being phrases defined in the Standard Rules, @@ -28,13 +28,13 @@ and that they aren't the same as the "and" and "or" used a list dividers. = ::= - ( ) | ==> { pass 1 } - , and | ==> Conditions::new_LOGICAL_AND(RP[1], RP[2]) - and | ==> Conditions::new_LOGICAL_AND(RP[1], RP[2]) - , or | ==> Conditions::new_LOGICAL_OR(RP[1], RP[2]) - or | ==> Conditions::new_LOGICAL_OR(RP[1], RP[2]) - | ==> { pass 1 } - ==> { pass 1 } + ( ) | ==> { pass 1 } + , and | ==> { -, Conditions::new_LOGICAL_AND(RP[1], RP[2]) } + and | ==> { -, Conditions::new_LOGICAL_AND(RP[1], RP[2]) } + , or | ==> { -, Conditions::new_LOGICAL_OR(RP[1], RP[2]) } + or | ==> { -, Conditions::new_LOGICAL_OR(RP[1], RP[2]) } + | ==> { pass 1 } + ==> { pass 1 } @ Chronological restrictions include, for instance, @@ -102,15 +102,15 @@ to other languages may want to find more elegant solutions. = ::= - | ==> { pass 1 } - not | ==> Conditions::negate(RP[1]) - | ==> { pass 1 } - | ==> { pass 1 } - | ==> Conditions::negate(RP[1]) - | ==> { pass 1 } - | ==> Conditions::negate(RP[1]) - | ==> { pass 1 } - ==> { pass 1 } + | ==> { pass 1 } + not | ==> { -, Conditions::negate(RP[1]) } + | ==> { pass 1 } + | ==> { pass 1 } + | ==> { -, Conditions::negate(RP[1]) } + | ==> { pass 1 } + | ==> { -, Conditions::negate(RP[1]) } + | ==> { pass 1 } + ==> { pass 1 } @ As before, we try to get better sensitivity to ambiguities by dividing the test for a phrase-to-decide into two, so that the following is used at a @@ -122,14 +122,14 @@ testing the existence of something. = ::= - | ==> { fail } - | ==> { pass 1 } - not ==> Conditions::negate(RP[1]) + | ==> { fail } + | ==> { pass 1 } + not ==> { -, Conditions::negate(RP[1]) } ::= - ^ | ==> { fail } - | ==> { pass 1 } - not ==> Conditions::negate(RP[1]) + ^ | ==> { fail } + | ==> { pass 1 } + not ==> { -, Conditions::negate(RP[1]) } ::= is/are ... @@ -170,10 +170,10 @@ is handled. The following nonterminal exists to enter the AP to the meaning list = ::= - ==> Conditions::new_TEST_ACTION(RP[1], W); + ==> { -, Conditions::new_TEST_ACTION(RP[1], W) } ::= - ==> Conditions::new_TEST_ACTION(RP[1], W); + ==> { -, Conditions::new_TEST_ACTION(RP[1], W) } @ And similarly: @@ -216,22 +216,22 @@ typechecking to choose between much later on. = ::= - ( ) | ==> { pass 1 } - ==> { pass 1 } + ( ) | ==> { pass 1 } + ==> { pass 1 } ::= - ( ) | ==> { pass 1 } - | ==> { pass 1 } - ==> { pass 1 } + ( ) | ==> { pass 1 } + | ==> { pass 1 } + ==> { pass 1 } ::= - | ==> { fail } - verb | ==> ExParser::say_verb(RP[1], R[1], NULL, W) - adjective | ==> ExParser::say_adjective(RP[1], W) - | ==> ExParser::say_verb(RP[1], R[1], NULL, W) - verb | ==> @ - | ==> @ - ==> ExParser::say_adjective(RP[1], W) + | ==> { fail } + verb | ==> { -, ExParser::say_verb(RP[1], R[1], NULL, W) } + adjective | ==> { -, ExParser::say_adjective(RP[1], W) } + | ==> { -, ExParser::say_verb(RP[1], R[1], NULL, W) } + verb | ==> @ + | ==> @ + ==> { -, ExParser::say_adjective(RP[1], W) } @ "To..." phrases are easy, or at least, easy to delegate: diff --git a/inform7/core-module/Chapter 10/Constants and Descriptions.w b/inform7/core-module/Chapter 10/Constants and Descriptions.w index 5fd85f9ff..923a8114b 100644 --- a/inform7/core-module/Chapter 10/Constants and Descriptions.w +++ b/inform7/core-module/Chapter 10/Constants and Descriptions.w @@ -14,13 +14,13 @@ is on the table". For now, though, we treat it as a noun. = ::= - | ==> { pass 1 } - nothing | ==> Rvalues::new_nothing_object_constant(); - | ==> { pass 1 } - outcome | ==> { pass 1 } - option | ==> { pass 1 } - verb | ==> @ - response ( ) ==> @ + | ==> { pass 1 } + nothing | ==> { -, Rvalues::new_nothing_object_constant() } + | ==> { pass 1 } + outcome | ==> { pass 1 } + option | ==> { pass 1 } + verb | ==> @ + response ( ) ==> @ @ = verb_form *vf = (verb_form *) (RP[1]); @@ -172,7 +172,7 @@ is read as if it were "scenery thing". = ::= - ==> Node::AdjectiveLists::add_adjlist(Descriptions::from_proposition(NULL, W), RP[1]) + ==> { -, Node::AdjectiveLists::add_adjlist(Descriptions::from_proposition(NULL, W), RP[1]) } @ So now we test whether an excerpt is a list of adjectives; for example, this matches @@ -232,15 +232,15 @@ the chimp is either not hairy or not an animal. = ::= - not | ==> 0; *XP = Node::AdjectiveLists::make_adjlist(Node::AdjectiveLists::negate_adjlist(RP[2]), W) - | ==> 0; *XP = Node::AdjectiveLists::make_adjlist(RP[2], W) - ==> 0; *XP = Node::AdjectiveLists::make_adjlist(RP[1], W) + not | ==> { 0, Node::AdjectiveLists::make_adjlist(Node::AdjectiveLists::negate_adjlist(RP[2]), W) } + | ==> { 0, Node::AdjectiveLists::make_adjlist(RP[2], W) } + ==> { 0, Node::AdjectiveLists::make_adjlist(RP[1], W) } ::= - not | ==> 0; *XP = Node::AdjectiveLists::negate_adjlist(RP[1]) - | ==> { 0, RP[1] } - not | ==> 0; *XP = Node::AdjectiveLists::join_adjlist(Node::AdjectiveLists::negate_adjlist(RP[1]), RP[2]) - ==> 0; *XP = Node::AdjectiveLists::join_adjlist(RP[1], RP[2]) + not | ==> { 0, Node::AdjectiveLists::negate_adjlist(RP[1]) } + | ==> { 0, RP[1] } + not | ==> { 0, Node::AdjectiveLists::join_adjlist(Node::AdjectiveLists::negate_adjlist(RP[1]), RP[2]) } + ==> { 0, Node::AdjectiveLists::join_adjlist(RP[1], RP[2]) } @ That reduces us to an internal nonterminal, which matches the longest possible adjective name it can see. @@ -352,14 +352,14 @@ them with conditions like = ::= - | ==> Specifications::from_kind(RP[1]); s_adj_domain = RP[1]; - ==> RP[1]; s_adj_domain = NULL; + | ==> { -, Specifications::from_kind(RP[1]) }; s_adj_domain = RP[1]; + ==> { -, RP[1] }; s_adj_domain = NULL; ::= - ==> Specifications::from_kind(RP[1]); s_adj_domain = RP[1]; + ==> { -, Specifications::from_kind(RP[1]) }; s_adj_domain = RP[1]; ::= - ==> RP[1]; s_adj_domain = NULL; + ==> { -, RP[1] }; s_adj_domain = NULL; @ parses text exactly as if it were , but is just a little faster written as an internal like this. @@ -388,7 +388,7 @@ whereas "empty rulebook" will work. = ::= - ==> RP[1]; if ((s_adj_domain) && (Node::AdjectiveLists::adjlist_applies_to_kind(RP[1], s_adj_domain) == FALSE)) return FALSE; + ==> { -, RP[1] }; if ((s_adj_domain) && (Node::AdjectiveLists::adjlist_applies_to_kind(RP[1], s_adj_domain) == FALSE)) return FALSE; @h Descriptions. In most programming languages, commands are like imperative verbs, but their @@ -444,37 +444,38 @@ In the grammar for , the noun is compulsory. = ::= - | ==> { pass 1 } - ==> { pass 1 } + | ==> { pass 1 } + ==> { pass 1 } ::= - ==> { pass 1 } + ==> { pass 1 } ::= - ( called ) | ==> @ - ==> { pass 1 } + ( called ) | ==> @ + ==> { pass 1 } ::= - | ==> @ - | ==> { pass 1 } - | ==> Node::AdjectiveLists::add_adjlist_w(RP[1], RP[2]) - | ==> { pass 3 } - ^ ^ | ==> @ - | ==> { pass 2 } - | ==> { pass 2 } - ==> { pass 1 } + | ==> @ + | ==> { pass 1 } + | ==> { -, Node::AdjectiveLists::add_adjlist_w(RP[1], RP[2]) } + | ==> { pass 3 } + ^ ^ | ==> @ + | ==> { pass 2 } + | ==> { pass 2 } + ==> { pass 1 } ::= - | ==> { pass 1 } - ==> Node::AdjectiveLists::add_adjlist(RP[2], RP[1]) + | ==> { pass 1 } + ==> { -, Node::AdjectiveLists::add_adjlist(RP[2], RP[1]) } ::= - | ==> { pass 1 } - ==> Node::AdjectiveLists::add_adjlist(RP[2], RP[1]) + | ==> { pass 1 } + ==> { -, Node::AdjectiveLists::add_adjlist(RP[2], RP[1]) } ::= - | ==> { pass 1 } - ==> Node::AdjectiveLists::add_adjlist(RP[2], RP[1]) + | ==> { pass 1 } + ==> { -, Node::AdjectiveLists::add_adjlist(RP[2], RP[1]) } + internal 0 { #ifdef IF_MODULE @@ -493,27 +494,27 @@ except that the noun is optional. The only difference is right at the bottom. = ::= - | ==> { pass 1 } - ==> { pass 1 } + | ==> { pass 1 } + ==> { pass 1 } ::= - ( called ) | ==> @ - ==> { pass 1 } + ( called ) | ==> @ + ==> { pass 1 } ::= - | ==> @ - | ==> { pass 1 } - | ==> Node::AdjectiveLists::add_adjlist_w(RP[1], RP[2]) - | ==> { pass 3 } - ^ ^ | ==> @ - | ==> { pass 2 } - | ==> { pass 2 } - ==> { pass 1 } + | ==> @ + | ==> { pass 1 } + | ==> { -, Node::AdjectiveLists::add_adjlist_w(RP[1], RP[2]) } + | ==> { pass 3 } + ^ ^ | ==> @ + | ==> { pass 2 } + | ==> { pass 2 } + ==> { pass 1 } ::= - | ==> { pass 1 } - | ==> Node::AdjectiveLists::add_adjlist(RP[2], RP[1]) - ==> Node::AdjectiveLists::add_adjlist(Descriptions::from_proposition(NULL, W), RP[1]) + | ==> { pass 1 } + | ==> { -, Node::AdjectiveLists::add_adjlist(RP[2], RP[1]) } + ==> { -, Node::AdjectiveLists::add_adjlist(Descriptions::from_proposition(NULL, W), RP[1]) } @ = parse_node *p = RP[1]; @@ -590,8 +591,8 @@ context of a proper noun, as in "some tea", because it may be confusion of = ::= -
... | ==> Node::new_with_words(UNKNOWN_NT, WR[1]) - ... ==> Node::new_with_words(UNKNOWN_NT, WR[1]) +
... | ==> { -, Node::new_with_words(UNKNOWN_NT, WR[1]) } + ... ==> { -, Node::new_with_words(UNKNOWN_NT, WR[1]) } @ The following is written as an internal, voracious nonterminal for speed. It matches text like diff --git a/inform7/core-module/Chapter 10/Parse Literals.w b/inform7/core-module/Chapter 10/Parse Literals.w index 2a424844b..b95544a02 100644 --- a/inform7/core-module/Chapter 10/Parse Literals.w +++ b/inform7/core-module/Chapter 10/Parse Literals.w @@ -16,16 +16,16 @@ Note that ordinal numbers are not valid as literals: "2nd" is not a noun. = ::= - | ==> Rvalues::from_int(R[1], W) - minus | ==> Rvalues::from_int(-R[1], W) - ( ) | ==> Rvalues::from_wording(W) - | ==> Rvalues::from_wording(W) - | ==> { pass 1 } - | ==> { pass 1 } - | ==> { pass 1 } - unicode | ==> { pass 1 } - | ==> { pass 1 } - ==> { pass 1 } + | ==> { -, Rvalues::from_int(R[1], W) } + minus | ==> { -, Rvalues::from_int(-R[1], W) } + ( ) | ==> { -, Rvalues::from_wording(W) } + | ==> { -, Rvalues::from_wording(W) } + | ==> { pass 1 } + | ==> { pass 1 } + | ==> { pass 1 } + unicode | ==> { pass 1 } + | ==> { pass 1 } + ==> { pass 1 } internal { literal_pattern *lp; @@ -59,8 +59,8 @@ in principle be any number of people, colours, vehicles, and such. = ::= - false | ==> Rvalues::from_boolean(FALSE, W) - true ==> Rvalues::from_boolean(TRUE, W) + false | ==> { -, Rvalues::from_boolean(FALSE, W) } + true ==> { -, Rvalues::from_boolean(TRUE, W) } @ The problem message for engineering notation should only appear once: @@ -75,11 +75,11 @@ Still: = ::= - _ pi | ==> Rvalues::from_IEEE_754(0x40490FDB, W) - _ e | ==> Rvalues::from_IEEE_754(0x402DF854, W) - plus infinity | ==> Rvalues::from_IEEE_754(0x7F800000, W) - minus infinity | ==> Rvalues::from_IEEE_754(0xFF800000, W) - ==> Rvalues::from_IEEE_754((unsigned int) R[1], W) + _ pi | ==> { -, Rvalues::from_IEEE_754(0x40490FDB, W) } + _ e | ==> { -, Rvalues::from_IEEE_754(0x402DF854, W) } + plus infinity | ==> { -, Rvalues::from_IEEE_754(0x7F800000, W) } + minus infinity | ==> { -, Rvalues::from_IEEE_754(0xFF800000, W) } + ==> { -, Rvalues::from_IEEE_754((unsigned int) R[1], W) } internal { if ((Wordings::length(W) != 1) && (Wordings::length(W) != 3)) return FALSE; diff --git a/inform7/core-module/Chapter 10/Type Expressions and Values.w b/inform7/core-module/Chapter 10/Type Expressions and Values.w index a3d09c8f8..cb0ae8a55 100644 --- a/inform7/core-module/Chapter 10/Type Expressions and Values.w +++ b/inform7/core-module/Chapter 10/Type Expressions and Values.w @@ -54,18 +54,18 @@ type representing only its own value. = ::= -
| ==> { pass 2 } - ==> { pass 1 } +
| ==> { pass 2 } + ==> { pass 1 } ::= - variable/variables | ==> { pass 1 } - that/which vary/varies | ==> { pass 1 } - | ==> Specifications::from_kind(RP[1]) - | ==> { pass 1 } - | ==> { pass 1 } - | ==> { pass 1 } - | ==> { pass 1 } - ==> { pass 1 } + variable/variables | ==> { pass 1 } + that/which vary/varies | ==> { pass 1 } + | ==> { -, Specifications::from_kind(RP[1]) } + | ==> { pass 1 } + | ==> { pass 1 } + | ==> { pass 1 } + | ==> { pass 1 } + ==> { pass 1 } @ Note that a list of adjectives with no noun does not qualify as a type expression. It looks as if it never should, on the face of it -- "opaque" @@ -81,12 +81,12 @@ To allow this, we have a minor variation: = ::= -
| ==> { pass 2 } - ==> { pass 1 } +
| ==> { pass 2 } + ==> { pass 1 } ::= | ==> { pass 1 } - ==> { pass 1 } + ==> { pass 1 } @ And now we parse descriptions of variables such as the one appearing in @@ -102,16 +102,16 @@ higher up in Inform. Ultimately, the text must match in each case. = ::= - global | ==> Specifications::new_new_variable_like(NULL) - global | ==> { pass 1 } - ==> { pass 1 } + global | ==> { -, Specifications::new_new_variable_like(NULL) } + global | ==> { pass 1 } + ==> { pass 1 } ::= - | ==> Specifications::new_new_variable_like(RP[1]) - | ==> @ - | ==> @ - | ==> @ - ==> @ + | ==> { -, Specifications::new_new_variable_like(RP[1]) } + | ==> @ + | ==> @ + | ==> @ + ==> @ @ = Problems::quote_source(1, current_sentence); @@ -237,26 +237,26 @@ membership, which is to say, really just a syntactic difference. = ::= - ( ) | ==> { pass 1 } - | ==> ExParser::val(RP[1], W) - | ==> ExParser::val(RP[2], W) - | ==> ExParser::val(RP[2], W) - | ==> ExParser::val(RP[1], W) - | ==> { pass 1 } - | ==> ExParser::val(RP[1], W) - | ==> ExParser::val(RP[1], W) - | ==> ExParser::val(RP[1], W) - | ==> ExParser::val(RP[1], W) - | ==> ExParser::val(RP[1], W) - | ==> ExParser::val(RP[1], W) - member/members of | ==> ExParser::val(RP[1], W) - member/members of | ==> ExParser::val(RP[1], W) - of | ==> @ - | ==> @ - entry of/in/from | ==> @ - | ==> ExParser::val(RP[1], W) - | ==> ExParser::val(RP[1], W) - ==> ExParser::val(RP[1], W) + ( ) | ==> { pass 1 } + | ==> { -, ExParser::val(RP[1], W) } + | ==> { -, ExParser::val(RP[2], W) } + | ==> { -, ExParser::val(RP[2], W) } + | ==> { -, ExParser::val(RP[1], W) } + | ==> { pass 1 } + | ==> { -, ExParser::val(RP[1], W) } + | ==> { -, ExParser::val(RP[1], W) } + | ==> { -, ExParser::val(RP[1], W) } + | ==> { -, ExParser::val(RP[1], W) } + | ==> { -, ExParser::val(RP[1], W) } + | ==> { -, ExParser::val(RP[1], W) } + member/members of | ==> { -, ExParser::val(RP[1], W) } + member/members of | ==> { -, ExParser::val(RP[1], W) } + of | ==> @ + | ==> @ + entry of/in/from | ==> @ + | ==> { -, ExParser::val(RP[1], W) } + | ==> { -, ExParser::val(RP[1], W) } + ==> { -, ExParser::val(RP[1], W) } @ = parse_node *ExParser::val(parse_node *v, wording W) { @@ -266,9 +266,9 @@ parse_node *ExParser::val(parse_node *v, wording W) { @ = ::= - where | ==> @ - where | ==> @ - ==> @ + where | ==> @ + where | ==> @ + ==> @ @ = equation *eqn = Equations::new(Node::get_text((parse_node *) RP[2]), TRUE); @@ -341,18 +341,18 @@ the text "grand total" is parsed as the local. = ::= - | ==> { pass 2 } - | ==> { pass 1 } - | ==> { pass 1 } - ==> { pass 1 } + | ==> { pass 2 } + | ==> { pass 1 } + | ==> { pass 1 } + ==> { pass 1 } ::= - ( ) | ==> { pass 1 } - | ==> ExParser::val(RP[1], W) - ==> ExParser::val(RP[1], W) + ( ) | ==> { pass 1 } + | ==> { -, ExParser::val(RP[1], W) } + ==> { -, ExParser::val(RP[1], W) } ::= - ==> ExParser::val(RP[1], W) + ==> { -, ExParser::val(RP[1], W) } @ This requires three internals: diff --git a/inform7/core-module/Chapter 10/Verbal and Relative Clauses.w b/inform7/core-module/Chapter 10/Verbal and Relative Clauses.w index 76f9fe295..4ad648ca8 100644 --- a/inform7/core-module/Chapter 10/Verbal and Relative Clauses.w +++ b/inform7/core-module/Chapter 10/Verbal and Relative Clauses.w @@ -37,7 +37,7 @@ placeholder to stand for a missing noun phrase: ==> @; ::= - ==> ExParser::Subtrees::verb_marker(RP[1], NULL, RP[2]) + ==> { -, ExParser::Subtrees::verb_marker(RP[1], NULL, RP[2]) } @ = ExParser::Subtrees::correct_for_adjectives(RP[1], RP[2]); @@ -85,9 +85,9 @@ handle its extra object: see below. = ::= - | ==> ExParser::Subtrees::verb_marker(RP[1], NULL, RP[2]) - | ==> ExParser::Subtrees::verb_marker(RP[1], RP[2], RP[3]) - ==> ExParser::Subtrees::verb_marker(RP[1], NULL, RP[2]) + | ==> { -, ExParser::Subtrees::verb_marker(RP[1], NULL, RP[2]) } + | ==> { -, ExParser::Subtrees::verb_marker(RP[1], RP[2], RP[3]) } + ==> { -, ExParser::Subtrees::verb_marker(RP[1], NULL, RP[2]) } @ The verb marker is a temporary node used just to store the verb or preposition usage; it's attached to the tree only briefly before sentence conversion @@ -114,7 +114,7 @@ works. = ::= - to ==> ExParser::val(Rvalues::from_pair(RP[1], RP[2]), W) + to ==> { -, ExParser::val(Rvalues::from_pair(RP[1], RP[2]), W) } @ The following parses a noun phrase with a relative clause, which is syntactically very similar to the case of a sentence. Sometimes the verb is @@ -136,17 +136,17 @@ relevant noun subtree with a representation of the player-object for those. = ::= - | ==> @ - ==> @ + | ==> @ + ==> @ ::= - | ==> ExParser::Subtrees::verb_marker(regular_to_be, RP[1], RP[2]) - not ==> ExParser::Subtrees::verb_marker(negated_to_be, RP[1], RP[2]) + | ==> { -, ExParser::Subtrees::verb_marker(regular_to_be, RP[1], RP[2]) } + not ==> { -, ExParser::Subtrees::verb_marker(negated_to_be, RP[1], RP[2]) } ::= - | ==> ExParser::Subtrees::verb_marker(RP[2], NULL, RP[3]) - | ==> ExParser::Subtrees::verb_marker(RP[2], RP[3], RP[4]) - ==> ExParser::Subtrees::verb_marker(RP[2], NULL, RP[3]) + | ==> { -, ExParser::Subtrees::verb_marker(RP[2], NULL, RP[3]) } + | ==> { -, ExParser::Subtrees::verb_marker(RP[2], RP[3], RP[4]) } + ==> { -, ExParser::Subtrees::verb_marker(RP[2], NULL, RP[3]) } @ = LOGIF(MATCHING, "So uncorrectedly RP[1] = $T\n", RP[1]); diff --git a/inform7/core-module/Chapter 14/Dash.w b/inform7/core-module/Chapter 14/Dash.w index c77601eab..9f1ebd455 100644 --- a/inform7/core-module/Chapter 14/Dash.w +++ b/inform7/core-module/Chapter 14/Dash.w @@ -2396,19 +2396,19 @@ condition caused the trouble: = ::= - | ==> R[1] | R[2] - ==> { pass 1 } + | ==> { R[1] | R[2], - } + ==> { pass 1 } ::= - , and/or | ==> { pass 1 } - ,/and/or ==> { pass 1 } + , and/or | ==> { pass 1 } + ,/and/or ==> { pass 1 } ::= - | ==> 0; @; - | ==> INVALID_CP_BIT; @; - ... begins/ends | ==> WHENWHILE_CP_BIT+INVALID_CP_BIT; @; - when/while *** | ==> WHENWHILE_CP_BIT+INVALID_CP_BIT; @; - ... ==> INVALID_CP_BIT; @; + | ==> { 0, - }; @; + | ==> { INVALID_CP_BIT, - }; @; + ... begins/ends | ==> { WHENWHILE_CP_BIT+INVALID_CP_BIT, - }; @; + when/while *** | ==> { WHENWHILE_CP_BIT+INVALID_CP_BIT, - }; @; + ... ==> { INVALID_CP_BIT, - }; @; @ = if (preform_lookahead_mode == FALSE) { diff --git a/inform7/core-module/Chapter 18/List Constants.w b/inform7/core-module/Chapter 18/List Constants.w index 5bea08cf0..869879c03 100644 --- a/inform7/core-module/Chapter 18/List Constants.w +++ b/inform7/core-module/Chapter 18/List Constants.w @@ -52,16 +52,16 @@ isn't expressed in this grammar. = ::= - \{ \} | ==> Rvalues::from_wording_of_list(Lists::kind_of_ll(Lists::empty_literal_list(Wordings::last_word(W)), FALSE), W) - \{ \} ==> Rvalues::from_wording_of_list(Lists::kind_of_ll(RP[1], FALSE), W) + \{ \} | ==> { -, Rvalues::from_wording_of_list(Lists::kind_of_ll(Lists::empty_literal_list(Wordings::last_word(W)), FALSE), W) } + \{ \} ==> { -, Rvalues::from_wording_of_list(Lists::kind_of_ll(RP[1], FALSE), W) } ::= - , | ==> 0; *XP = Lists::add_to_ll(RP[1], RP[2], W, R[1]) - ==> 0; *XP = Lists::add_to_ll(RP[1], Lists::empty_literal_list(W), W, R[1]) + , | ==> { 0, Lists::add_to_ll(RP[1], RP[2], W, R[1]) } + ==> { 0, Lists::add_to_ll(RP[1], Lists::empty_literal_list(W), W, R[1]) } ::= - | ==> { FALSE, RP[1] } - ...... ==> TRUE; *XP = Specifications::new_UNKNOWN(W) + | ==> { FALSE, RP[1] } + ...... ==> { TRUE, Specifications::new_UNKNOWN(W) } @ The grammar above builds our list structures from the bottom up. They begin with a call to: diff --git a/inform7/core-module/Chapter 19/Table Columns.w b/inform7/core-module/Chapter 19/Table Columns.w index ddd8966a9..986cfd30f 100644 --- a/inform7/core-module/Chapter 19/Table Columns.w +++ b/inform7/core-module/Chapter 19/Table Columns.w @@ -229,18 +229,18 @@ what looks like text into grammar for parsing. = ::= - ( *** ) | ==> @ - ( ... ) | ==> { EXISTING_TC, RP[1] }; <> = Wordings::first_wn(WR[1]); <> = Wordings::last_wn(WR[1]); - ( ... ) | ==> R[1]; if (R[1] != NEW_TC_PROBLEM) *X = NEW_TC_WITH_KIND; <> = Wordings::first_wn(WR[1]); <> = Wordings::last_wn(WR[1]); - | ==> { EXISTING_TC, RP[1] }; <> = -1; <> = -1; - ==> { pass 1 } + ( *** ) | ==> @ + ( ... ) | ==> { EXISTING_TC, RP[1] }; <> = Wordings::first_wn(WR[1]); <> = Wordings::last_wn(WR[1]); + ( ... ) | ==> { R[1], - }; if (R[1] != NEW_TC_PROBLEM) *X = NEW_TC_WITH_KIND; <> = Wordings::first_wn(WR[1]); <> = Wordings::last_wn(WR[1]); + | ==> { EXISTING_TC, RP[1] }; <> = -1; <> = -1; + ==> { pass 1 } ::= -
| ==> @ - {topic} | ==> { NEW_TC_TOPIC, - } - {} | ==> { NEW_TC_WITHOUT_KIND, - } - {} | ==> @ - ... ==> { NEW_TC_WITHOUT_KIND, - } +
| ==> @ + {topic} | ==> { NEW_TC_TOPIC, - } + {} | ==> { NEW_TC_WITHOUT_KIND, - } + {} | ==> @ + ... ==> { NEW_TC_WITHOUT_KIND, - } @ = *X = NEW_TC_PROBLEM; diff --git a/inform7/core-module/Chapter 19/Tables.w b/inform7/core-module/Chapter 19/Tables.w index f037f42ed..5d2493021 100644 --- a/inform7/core-module/Chapter 19/Tables.w +++ b/inform7/core-module/Chapter 19/Tables.w @@ -248,16 +248,16 @@ two forms in any case. = ::= - ( continued ) | ==> TABLE_IS_CONTINUED; <> = R[1] - ( amended ) | ==> TABLE_IS_AMENDED; <> = R[1] - ( replaced ) | ==> TABLE_IS_REPLACED; <> = R[1] - ==> TABLE_IS_NEW; <> = R[1] + ( continued ) | ==> { TABLE_IS_CONTINUED, -, <> = R[1] } + ( amended ) | ==> { TABLE_IS_AMENDED, -, <> = R[1] } + ( replaced ) | ==> { TABLE_IS_REPLACED, -, <> = R[1] } + ==> { TABLE_IS_NEW, -, <> = R[1] } ::= - table ... - ... | ==> { TABLE_HAS_NUMBER_AND_NAME, - } - table ### | ==> { TABLE_HAS_ONLY_NUMBER, - } - table of ... | ==> { TABLE_HAS_ONLY_NAME, - } - table ... ==> @ + table ... - ... | ==> { TABLE_HAS_NUMBER_AND_NAME, - } + table ### | ==> { TABLE_HAS_ONLY_NUMBER, - } + table of ... | ==> { TABLE_HAS_ONLY_NAME, - } + table ... ==> @ @ = *X = TABLE_HAS_ONLY_NAME; /* for recovery */ @@ -284,9 +284,9 @@ Inform's run, when kinds haven't yet been created. = ::= - *** with blank row/rows | ==> R[1]; <> = FALSE - *** with ... blank row/rows | ==> 0; <> = NOT_APPLICABLE - *** with blank row/rows for each/every ... ==> 0; <> = TRUE + *** with blank row/rows | ==> { R[1], -, <> = FALSE } + *** with ... blank row/rows | ==> { 0, -, <> = NOT_APPLICABLE } + *** with blank row/rows for each/every ... ==> { 0, -, <> = TRUE } @ So, here goes. We first identify the top line of the table declaration (the "headline"), then set the current sentence to that, even though in @@ -849,33 +849,29 @@ us issue more contextual problem messages. = ::= - | ==> @ - | ==> @ - | ==> { NAMED_CONSTANT_ENTRY, RP[1] } - | ==> @ - | ==> { pass 1 } - | ==> @ - ... ==> @ + | ==> { BLANK_TABLE_ENTRY, Specifications::new_UNKNOWN(W) } + | ==> @ + | ==> { NAMED_CONSTANT_ENTRY, RP[1] } + | ==> @ + | ==> { pass 1 } + | ==> @ + ... ==> @ ::= -- ::= - the action of | ==> { ACTION_TABLE_ENTRY, RP[1] } - | ==> { ACTION_TABLE_ENTRY, RP[1] } - the action of | ==> @ - | ==> @ - | ==> INSTANCE_TABLE_ENTRY; *XP = Rvalues::from_instance(RP[1]) - ==> { SPEC_TABLE_ENTRY, RP[1] } + the action of | ==> { ACTION_TABLE_ENTRY, RP[1] } + | ==> { ACTION_TABLE_ENTRY, RP[1] } + the action of | ==> @ + | ==> @ + | ==> { INSTANCE_TABLE_ENTRY, Rvalues::from_instance(RP[1]) } + ==> { SPEC_TABLE_ENTRY, RP[1] } ::= or | -@ = - *X = BLANK_TABLE_ENTRY; - *XP = Specifications::new_UNKNOWN(W); - @ = *X = KIND_TABLE_ENTRY; parse_node *new = Specifications::from_kind(RP[1]); diff --git a/inform7/core-module/Chapter 20/Equations.w b/inform7/core-module/Chapter 20/Equations.w index 48aa71a2d..7e8cbf86a 100644 --- a/inform7/core-module/Chapter 20/Equations.w +++ b/inform7/core-module/Chapter 20/Equations.w @@ -380,7 +380,8 @@ mass, too. _,/and ==> { 0, - } ::= - ==> 0; if (!preform_lookahead_mode) Equations::eqn_dec_var(equation_being_declared, Wordings::one_word(eq_symbol_wn), R[1], RP[1]); + ... | ==> { lookahead } + ==> { -, - }; Equations::eqn_dec_var(equation_being_declared, Wordings::one_word(eq_symbol_wn), R[1], RP[1]); ::= is/are | ==> { EQW_IDENTIFIES_KIND, RP[2] }; eq_symbol_wn = R[1]; diff --git a/inform7/core-module/Chapter 21/Activities.w b/inform7/core-module/Chapter 21/Activities.w index c292c490b..3ff2b268d 100644 --- a/inform7/core-module/Chapter 21/Activities.w +++ b/inform7/core-module/Chapter 21/Activities.w @@ -122,19 +122,19 @@ something"): = ::= - ( ) | ==> R[1]; <> = R[2] - -- -- | ==> R[1]; <> = R[2] - ==> R[1]; <> = -1; + ( ) | ==> { R[1], -, <> = R[2] } + -- -- | ==> { R[1], -, <> = R[2] } + ==> { R[1], -, <> = -1 } ::= - ( future action ) | ==> TRUE; <> = TRUE - ( ... ) | ==> @ - ==> TRUE; <> = FALSE + ( future action ) | ==> { TRUE, -, <> = TRUE } + ( ... ) | ==> @ + ==> { TRUE, -, <> = FALSE } ::= - ... of/for something/anything | ==> 0; <> = TRUE - ... something/anything | ==> 0; <> = TRUE - ... ==> 0; <> = FALSE + ... of/for something/anything | ==> { 0, -, <> = TRUE } + ... something/anything | ==> { 0, -, <> = TRUE } + ... ==> { 0, -, <> = FALSE } @ Once a new activity has been created, the following is used to make a noun for it; for example, the "announcing activity". @@ -451,24 +451,24 @@ it mentions no activities. = ::= - not | ==> { 0, RP[1] }; @; - ==> { 0, RP[1] } + not | ==> { 0, RP[1] }; @; + ==> { 0, RP[1] } ::= - ... | ==> 0; return preform_lookahead_mode; /* match only when looking ahead */ - | ==> @; - ==> { 0, RP[1] } + ... | ==> { lookahead } + | ==> @; + ==> { 0, RP[1] } ::= - , _or | ==> { 0, RP[1] } - _,/or ==> { 0, RP[1] } + , _or | ==> { 0, RP[1] } + _,/or ==> { 0, RP[1] } ::= - | ==> @ - of/for | ==> @ - | ==> @ - ^ ... | ==> @ - ==> @ + | ==> @ + of/for | ==> @ + | ==> @ + ^ ... | ==> @ + ==> @ @ The optional operand handles "something" itself in productions (a) and (b) in order to prevent it from being read as a description at production (c). This @@ -480,9 +480,9 @@ values, of the kind to which the activity applies. = ::= - something/anything | ==> FALSE; *XP = Specifications::new_UNKNOWN(W); - something/anything else | ==> FALSE; *XP = Specifications::new_UNKNOWN(W); - ==> { TRUE, RP[1] } + something/anything | ==> { FALSE, Specifications::new_UNKNOWN(W) } + something/anything else | ==> { FALSE, Specifications::new_UNKNOWN(W) } + ==> { TRUE, RP[1] } @ = activity_list *al = *XP; diff --git a/inform7/core-module/Chapter 21/Focus and Outcome.w b/inform7/core-module/Chapter 21/Focus and Outcome.w index 20810cde1..ed9645422 100644 --- a/inform7/core-module/Chapter 21/Focus and Outcome.w +++ b/inform7/core-module/Chapter 21/Focus and Outcome.w @@ -134,23 +134,23 @@ The following parses a declaration of named outcomes. For example: = ::= - ... | ==> 0; return preform_lookahead_mode; /* match only when looking ahead */ - | ==> { 0, - } - ==> { 0, - } + ... | ==> { lookahead } + | ==> { 0, - } + ==> { 0, - } ::= - , _and/or | ==> { 0, - } - _,/and/or ==> { 0, - } + , _and/or | ==> { 0, - } + _,/and/or ==> { 0, - } ::= - ==> 0; if (!preform_lookahead_mode) @ + ==> {0, - }; if (!preform_lookahead_mode) @ ::= - ... ( - the default ) | ==> R[1]; default_rbno_flag = TRUE - ... ( - default ) | ==> R[1]; default_rbno_flag = TRUE - ... ( ) | ==> R[1]; default_rbno_flag = FALSE - ... ( ... ) | ==> @ - ... ==> SUCCESS_OUTCOME; default_rbno_flag = FALSE + ... ( - the default ) | ==> { R[1], -}; default_rbno_flag = TRUE + ... ( - default ) | ==> { R[1], -}; default_rbno_flag = TRUE + ... ( ) | ==> { R[1], -}; default_rbno_flag = FALSE + ... ( ... ) | ==> @ + ... ==> { SUCCESS_OUTCOME, -}; default_rbno_flag = FALSE ::= it is very likely | diff --git a/inform7/core-module/Chapter 21/Rule Placement Sentences.w b/inform7/core-module/Chapter 21/Rule Placement Sentences.w index dfef98845..705f28774 100644 --- a/inform7/core-module/Chapter 21/Rule Placement Sentences.w +++ b/inform7/core-module/Chapter 21/Rule Placement Sentences.w @@ -82,24 +82,24 @@ following won't pick up many false positives. = ::= - ... | ==> 0; *XP = NULL; return preform_lookahead_mode; /* match only when looking ahead */ - | ==> 0; *XP = Diagrams::new_AND(R[2], RP[1], RP[2]) - ==> { 0, RP[1] } + ... | ==> { lookahead } + | ==> { 0, Diagrams::new_AND(R[2], RP[1], RP[2]) } + ==> { 0, RP[1] } ::= - , {_and} | ==> Wordings::first_wn(W); *XP= RP[1] - {_,/and} ==> Wordings::first_wn(W); *XP= RP[1] + , {_and} | ==> { Wordings::first_wn(W), RP[1] } + {_,/and} ==> { Wordings::first_wn(W), RP[1] } ::= - ... rule ==> 0; *XP = Diagrams::new_UNPARSED_NOUN(W) + ... rule ==> { 0, Diagrams::new_UNPARSED_NOUN(W) } @ This handles the special meaning "X substitutes for Y". = ::= - | ==> { NOT_APPLICABLE, RP[1] } - if/when | ==> { TRUE, RP[1] }; ((parse_node *) RP[1])->next = RP[2]; - unless ==> { FALSE, RP[1] }; ((parse_node *) RP[1])->next = RP[2]; + | ==> { NOT_APPLICABLE, RP[1] } + if/when | ==> { TRUE, RP[1] }; ((parse_node *) RP[1])->next = RP[2]; + unless ==> { FALSE, RP[1] }; ((parse_node *) RP[1])->next = RP[2]; @ = int Rules::Placement::substitutes_for_SMF(int task, parse_node *V, wording *NPs) { @@ -285,33 +285,33 @@ The subject noun phrase is an articled list, each entry of which must match: = ::= | ==> { TRUE, RP[1] } - ... ==> FALSE; @ + ... ==> { FALSE, - }; @ @ The object NP is more flexible: = ::= - in any rulebook | ==> { ANY_RULE_PLACEMENT, - } - in | ==> MIDDLE_PLACEMENT + 1000*IN_SIDE; *XP = RP[1]; - first in | ==> FIRST_PLACEMENT + 1000*IN_SIDE; *XP = RP[1]; - last in | ==> LAST_PLACEMENT + 1000*IN_SIDE; *XP = RP[1]; - instead of in | ==> MIDDLE_PLACEMENT + 1000*INSTEAD_SIDE; relative_to_which = RP[1]; *XP = RP[2]; - instead of in ... | ==> @ - instead of ... in ... | ==> @ - before in | ==> MIDDLE_PLACEMENT + 1000*BEFORE_SIDE; relative_to_which = RP[1]; *XP = RP[2]; - before in ... | ==> @ - before ... in ... | ==> @ - after in | ==> MIDDLE_PLACEMENT + 1000*AFTER_SIDE; relative_to_which = RP[1]; *XP = RP[2]; - after in ... | ==> @ - after ... in ... | ==> @ - instead of ... | ==> @ - before ... | ==> @ - after ... | ==> @ - ... ==> @ + in any rulebook | ==> { ANY_RULE_PLACEMENT, - } + in | ==> { MIDDLE_PLACEMENT + 1000*IN_SIDE, RP[1] } + first in | ==> { FIRST_PLACEMENT + 1000*IN_SIDE, RP[1] } + last in | ==> { LAST_PLACEMENT + 1000*IN_SIDE, RP[1] } + instead of in | ==> { MIDDLE_PLACEMENT + 1000*INSTEAD_SIDE, RP[2] }; relative_to_which = RP[1]; + instead of in ... | ==> @ + instead of ... in ... | ==> @ + before in | ==> { MIDDLE_PLACEMENT + 1000*BEFORE_SIDE, RP[2] }; relative_to_which = RP[1]; + before in ... | ==> @ + before ... in ... | ==> @ + after in | ==> { MIDDLE_PLACEMENT + 1000*AFTER_SIDE, RP[2] }; relative_to_which = RP[1]; + after in ... | ==> @ + after ... in ... | ==> @ + instead of ... | ==> @ + before ... | ==> @ + after ... | ==> @ + ... ==> @ ::= - | ==> { 0, RP[1] } - ... ==> @ + | ==> { 0, RP[1] } + ... ==> @ @ diff --git a/inform7/core-module/Chapter 22/Describing Phrase Type Data.w b/inform7/core-module/Chapter 22/Describing Phrase Type Data.w index fed114352..ff228557b 100644 --- a/inform7/core-module/Chapter 22/Describing Phrase Type Data.w +++ b/inform7/core-module/Chapter 22/Describing Phrase Type Data.w @@ -448,21 +448,21 @@ word "to". = ::= - ( deprecated ) | ==> R[1]; <> = TRUE - | ==> SAY_ANN; <> = R[1] - ==> { pass 1 } + ( deprecated ) | ==> { R[1], -, <> = TRUE } + | ==> { SAY_ANN, -, <> = R[1] } + ==> { pass 1 } ::= - ( arithmetic operation ) | ==> R[1]; <> = R[2] - ( assignment operation ) | ==> R[1]; <> = TRUE - {let ... be given by ...} | ==> LET_ANN; <> = TRUE - {let ...} | ==> LET_ANN; <> = FALSE - ... -- end | ==> { BLOCK_ANN, - } - ... -- end conditional | ==> { CONDITIONAL_ANN, - } - ... -- end loop | ==> { LOOP_ANN, - } - ... -- in loop | ==> { IN_LOOP_ANN, - } - ... -- in ### | ==> { IN_ANN, - } - ... ==> NO_ANN + ( arithmetic operation ) | ==> { R[1], -, <> = R[2] } + ( assignment operation ) | ==> { R[1], -, <> = TRUE } + {let ... be given by ...} | ==> { LET_ANN, -, <> = TRUE } + {let ...} | ==> { LET_ANN, -, <> = FALSE } + ... -- end | ==> { BLOCK_ANN, - } + ... -- end conditional | ==> { CONDITIONAL_ANN, - } + ... -- end loop | ==> { LOOP_ANN, - } + ... -- in loop | ==> { IN_LOOP_ANN, - } + ... -- in ### | ==> { IN_ANN, - } + ... ==> { NO_ANN, - } @ The definition remaining after the preamble is removed is then vetted. This is a possibly controversial point, in fact, because the check in question @@ -472,7 +472,7 @@ messages. = ::= - ( ...... ) {} ( ...... ) ==> <> = Wordings::first_wn(WR[2]); <> = Wordings::last_wn(WR[2]); <> = RP[2]; @ + ( ...... ) {} ( ...... ) ==> { -, -, <> = Wordings::first_wn(WR[2]), <> = Wordings::last_wn(WR[2]), <> = RP[2] }; @ @ = preposition *prep = <>; @@ -498,16 +498,16 @@ the exception being the primordial phrase for saying text. = ::= - -- running on | ==> R[1]; <> = TRUE - {say otherwise/else} | ==> CONTROL_SANN; <> = OTHERWISE_SAY_CS - {say otherwise/else if/unless ...} | ==> CONTROL_SANN; <> = OTHERWISE_IF_SAY_CS - {say if/unless ...} | ==> CONTROL_SANN; <> = IF_SAY_CS - {say end if/unless} | ==> CONTROL_SANN; <> = END_IF_SAY_CS - {say ...} -- beginning ### | ==> { BEGIN_SANN, - } - {say ...} -- continuing ### | ==> { CONTINUE_SANN, - } - {say ...} -- ending ### with marker ### | ==> { ENDM_SANN, - } - {say ...} -- ending ### | ==> { END_SANN, - } - {say ...} ==> { NO_SANN, - } + -- running on | ==> { R[1], -, <> = TRUE } + {say otherwise/else} | ==> { CONTROL_SANN, -, <> = OTHERWISE_SAY_CS } + {say otherwise/else if/unless ...} | ==> { CONTROL_SANN, -, <> = OTHERWISE_IF_SAY_CS } + {say if/unless ...} | ==> { CONTROL_SANN, -, <> = IF_SAY_CS } + {say end if/unless} | ==> { CONTROL_SANN, -, <> = END_IF_SAY_CS } + {say ...} -- beginning ### | ==> { BEGIN_SANN, - } + {say ...} -- continuing ### | ==> { CONTINUE_SANN, - } + {say ...} -- ending ### with marker ### | ==> { ENDM_SANN, - } + {say ...} -- ending ### | ==> { END_SANN, - } + {say ...} ==> { NO_SANN, - } @ The following is used on the same text as , but later on, for timing reasons. @@ -647,11 +647,11 @@ give problems for misuse of brackets. = ::= - ( ) *** | ==> @ - ( ) *** | ==> TRUE; <> = R[1]; *XP = RP[1] - ( *** | ==> @ - ) *** | ==> @ - ### *** ==> { FALSE, - } + ( ) *** | ==> @ + ( ) *** | ==> { TRUE, RP[1], <> = R[1] } + ( *** | ==> @ + ) *** | ==> @ + ### *** ==> { FALSE, - } @ Phrase token declarations allow a variety of non-standard constructs. @@ -660,31 +660,31 @@ the hyphen, and this is sorely needed with complicated functional kinds. = ::= - *** ( *** - ...... | ==> @ - ...... - a nonexisting variable | ==> TRUE; *XP = Specifications::from_kind(K_value); <> = NEW_LOCAL_PT_CONSTRUCT - ...... - a nonexisting variable | ==> TRUE; *XP = Specifications::from_kind(RP[1]); <> = NEW_LOCAL_PT_CONSTRUCT - ...... - a nonexisting that/which varies | ==> TRUE; *XP = Specifications::from_kind(RP[1]); <> = NEW_LOCAL_PT_CONSTRUCT - ...... - nonexisting variable | ==> TRUE; *XP = Specifications::from_kind(K_value); <> = NEW_LOCAL_PT_CONSTRUCT - ...... - nonexisting variable | ==> TRUE; *XP = Specifications::from_kind(RP[1]); <> = NEW_LOCAL_PT_CONSTRUCT - ...... - nonexisting that/which varies | ==> TRUE; *XP = Specifications::from_kind(RP[1]); <> = NEW_LOCAL_PT_CONSTRUCT - ...... - {an existing variable} | ==> TRUE; *XP = Specifications::from_kind(K_value); Node::set_text(*XP, WR[2]); <> = EXISTING_LOCAL_PT_CONSTRUCT - ...... - {an existing variable} | ==> TRUE; *XP = Specifications::from_kind(RP[1]); Node::set_text(*XP, WR[2]); <> = EXISTING_LOCAL_PT_CONSTRUCT - ...... - {an existing that/which varies} | ==> TRUE; *XP = Specifications::from_kind(RP[1]); Node::set_text(*XP, WR[2]); <> = EXISTING_LOCAL_PT_CONSTRUCT - ...... - {existing variable} | ==> TRUE; *XP = Specifications::from_kind(K_value); Node::set_text(*XP, WR[2]); <> = EXISTING_LOCAL_PT_CONSTRUCT - ...... - {existing variable} | ==> TRUE; *XP = Specifications::from_kind(RP[1]); Node::set_text(*XP, WR[2]); <> = EXISTING_LOCAL_PT_CONSTRUCT - ...... - {existing that/which varies} | ==> TRUE; *XP = Specifications::from_kind(RP[1]); Node::set_text(*XP, WR[2]); <> = EXISTING_LOCAL_PT_CONSTRUCT - ...... - a condition | ==> TRUE; *XP = NULL; <> = CONDITION_PT_CONSTRUCT - ...... - condition | ==> TRUE; *XP = NULL; <> = CONDITION_PT_CONSTRUCT - ...... - a phrase | ==> TRUE; *XP = NULL; <> = VOID_PT_CONSTRUCT - ...... - phrase | ==> TRUE; *XP = NULL; <> = VOID_PT_CONSTRUCT - ...... - storage | ==> TRUE; *XP = Specifications::from_kind(K_value); Node::set_text(*XP, WR[2]); <> = STORAGE_PT_CONSTRUCT - ...... - a table-reference | ==> TRUE; *XP = Specifications::from_kind(K_value); Node::set_text(*XP, WR[2]); <> = TABLE_REFERENCE_PT_CONSTRUCT - ...... - table-reference | ==> TRUE; *XP = Specifications::from_kind(K_value); Node::set_text(*XP, WR[2]); <> = TABLE_REFERENCE_PT_CONSTRUCT - ...... - | ==> { TRUE, RP[1], <> = STANDARD_PT_CONSTRUCT } - ...... - | ==> { TRUE, RP[1], <> = KIND_NAME_PT_CONSTRUCT } - ...... - ...... | ==> @ - | ==> { FALSE, RP[1], <> = KIND_NAME_PT_CONSTRUCT } - ...... ==> @ + *** ( *** - ...... | ==> @ + ...... - a nonexisting variable | ==> { TRUE, Specifications::from_kind(K_value), <> = NEW_LOCAL_PT_CONSTRUCT } + ...... - a nonexisting variable | ==> { TRUE, Specifications::from_kind(RP[1]), <> = NEW_LOCAL_PT_CONSTRUCT } + ...... - a nonexisting that/which varies | ==> { TRUE, Specifications::from_kind(RP[1]), <> = NEW_LOCAL_PT_CONSTRUCT } + ...... - nonexisting variable | ==> { TRUE, Specifications::from_kind(K_value), <> = NEW_LOCAL_PT_CONSTRUCT } + ...... - nonexisting variable | ==> { TRUE, Specifications::from_kind(RP[1]), <> = NEW_LOCAL_PT_CONSTRUCT } + ...... - nonexisting that/which varies | ==> { TRUE, Specifications::from_kind(RP[1]), <> = NEW_LOCAL_PT_CONSTRUCT } + ...... - {an existing variable} | ==> { TRUE, Specifications::from_kind(K_value), <> = EXISTING_LOCAL_PT_CONSTRUCT }; Node::set_text(*XP, WR[2]); + ...... - {an existing variable} | ==> { TRUE, Specifications::from_kind(RP[1]), <> = EXISTING_LOCAL_PT_CONSTRUCT }; Node::set_text(*XP, WR[2]); + ...... - {an existing that/which varies} | ==> { TRUE, Specifications::from_kind(RP[1]), <> = EXISTING_LOCAL_PT_CONSTRUCT }; Node::set_text(*XP, WR[2]); + ...... - {existing variable} | ==> { TRUE, Specifications::from_kind(K_value), <> = EXISTING_LOCAL_PT_CONSTRUCT }; Node::set_text(*XP, WR[2]); + ...... - {existing variable} | ==> { TRUE, Specifications::from_kind(RP[1]), <> = EXISTING_LOCAL_PT_CONSTRUCT }; Node::set_text(*XP, WR[2]); + ...... - {existing that/which varies} | ==> { TRUE, Specifications::from_kind(RP[1]), <> = EXISTING_LOCAL_PT_CONSTRUCT }; Node::set_text(*XP, WR[2]); + ...... - a condition | ==> { TRUE, NULL, <> = CONDITION_PT_CONSTRUCT } + ...... - condition | ==> { TRUE, NULL, <> = CONDITION_PT_CONSTRUCT } + ...... - a phrase | ==> { TRUE, NULL, <> = VOID_PT_CONSTRUCT } + ...... - phrase | ==> { TRUE, NULL, <> = VOID_PT_CONSTRUCT } + ...... - storage | ==> { TRUE, Specifications::from_kind(K_value), <> = STORAGE_PT_CONSTRUCT }; Node::set_text(*XP, WR[2]); + ...... - a table-reference | ==> { TRUE, Specifications::from_kind(K_value), <> = TABLE_REFERENCE_PT_CONSTRUCT }; Node::set_text(*XP, WR[2]); + ...... - table-reference | ==> { TRUE, Specifications::from_kind(K_value), <> = TABLE_REFERENCE_PT_CONSTRUCT }; Node::set_text(*XP, WR[2]); + ...... - | ==> { TRUE, RP[1], <> = STANDARD_PT_CONSTRUCT } + ...... - | ==> { TRUE, RP[1], <> = KIND_NAME_PT_CONSTRUCT } + ...... - ...... | ==> @ + | ==> { FALSE, RP[1], <> = KIND_NAME_PT_CONSTRUCT } + ...... ==> @ @ = *X = NOT_APPLICABLE; diff --git a/inform7/core-module/Chapter 22/Phrase Options.w b/inform7/core-module/Chapter 22/Phrase Options.w index b48f44b89..b20466343 100644 --- a/inform7/core-module/Chapter 22/Phrase Options.w +++ b/inform7/core-module/Chapter 22/Phrase Options.w @@ -128,7 +128,7 @@ and creates two options with . = ::= - ... | ==> FALSE; return preform_lookahead_mode; /* match only when looking ahead */ + ... | ==> { lookahead } | ==> { pass 2 } ==> { FALSE, - } @@ -139,7 +139,12 @@ and creates two options with . \and/or ==> { TRUE, - } ::= - ... ==> FALSE; if (!preform_lookahead_mode) Phrases::Options::phod_add_phrase_option(phod_being_parsed, W); + ... | ==> { lookahead } + ... ==> @; + +@ = + Phrases::Options::phod_add_phrase_option(phod_being_parsed, W); + ==> { FALSE, - }; @ = int too_many_POs_error = FALSE; diff --git a/inform7/core-module/Chapter 22/Phrase Usage.w b/inform7/core-module/Chapter 22/Phrase Usage.w index 79fd12363..8f443723e 100644 --- a/inform7/core-module/Chapter 22/Phrase Usage.w +++ b/inform7/core-module/Chapter 22/Phrase Usage.w @@ -132,23 +132,23 @@ just enough from the wording to tell what sort of rule/phrase is to follow. = ::= - definition | ==> { DEFINITIONAL_PHRASE_EFF, - } - this is the {... rule} | ==> RULE_NOT_IN_RULEBOOK_EFF; <> = NOT_AN_EVENT; <> = FALSE; - this is the rule | ==> @ - this is ... rule | ==> @ - this is ... rules | ==> @ - | ==> RULE_NOT_IN_RULEBOOK_EFF; <> = R[1] - to | ==> @ - to ... ( called ... ) | ==> @ - {to ...} ( this is the {### function} inverse to ### ) | ==> TO_PHRASE_EFF; <> = TRUE; <> = TRUE; <> = TRUE; - {to ...} ( this is the {### function} ) | ==> TO_PHRASE_EFF; <> = TRUE; <> = TRUE; <> = FALSE; - {to ...} ( this is ... ) | ==> TO_PHRASE_EFF; <> = TRUE; <> = FALSE; - to ... | ==> TO_PHRASE_EFF; <> = FALSE - ... ( this is the {... rule} ) | ==> RULE_IN_RULEBOOK_EFF; <> = TRUE; <> = FALSE; - ... ( this is the rule ) | ==> @ - ... ( this is ... rule ) | ==> @ - ... ( this is ... rules ) | ==> @ - ... ==> RULE_IN_RULEBOOK_EFF; <> = FALSE + definition | ==> { DEFINITIONAL_PHRASE_EFF, - } + this is the {... rule} | ==> { RULE_NOT_IN_RULEBOOK_EFF, -, <> = NOT_AN_EVENT, <> = FALSE } + this is the rule | ==> @ + this is ... rule | ==> @ + this is ... rules | ==> @ + | ==> { RULE_NOT_IN_RULEBOOK_EFF, -, <> = R[1] } + to | ==> @ + to ... ( called ... ) | ==> @ + {to ...} ( this is the {### function} inverse to ### ) | ==> { TO_PHRASE_EFF, -, <> = TRUE, <> = TRUE, <> = TRUE } + {to ...} ( this is the {### function} ) | ==> { TO_PHRASE_EFF, -, <> = TRUE, <> = TRUE, <> = FALSE } + {to ...} ( this is ... ) | ==> { TO_PHRASE_EFF, -, <> = TRUE, <> = FALSE } + to ... | ==> { TO_PHRASE_EFF, -, <> = FALSE } + ... ( this is the {... rule} ) | ==> { RULE_IN_RULEBOOK_EFF, -, <> = TRUE, <> = FALSE } + ... ( this is the rule ) | ==> @ + ... ( this is ... rule ) | ==> @ + ... ( this is ... rules ) | ==> @ + ... ==> { RULE_IN_RULEBOOK_EFF, -, <> = FALSE } @ = StandardProblems::sentence_problem(Task::syntax_tree(), _p_(PM_NamelessRule), @@ -203,25 +203,25 @@ following grammar. (Parsing this is "fine mode".) = ::= - during | ==> R[1]; <> = RP[2] - ==> R[1]; <> = NULL + during | ==> { R[1], -, <> = RP[2] } + ==> { R[1], -, <> = NULL } ::= - {} {when/while ...} | ==> { TRUE, - } - {} | ==> { FALSE, - } - ... ==> { NOT_APPLICABLE, - } + {} {when/while ...} | ==> { TRUE, - } + {} | ==> { FALSE, - } + ... ==> { NOT_APPLICABLE, - } ::= - *** | ==> 0; <> = Wordings::first_wn(WR[1]); <> = Wordings::last_wn(WR[1]) -
rule for *** | ==> 0; <> = Wordings::first_wn(WR[1]); <> = Wordings::last_wn(WR[1]) -
rule *** | ==> 0; <> = Wordings::first_wn(WR[1]); <> = Wordings::last_wn(WR[1]) - rule for *** | ==> 0; <> = Wordings::first_wn(WR[1]); <> = Wordings::last_wn(WR[1]) - rule *** ==> 0; <> = Wordings::first_wn(WR[1]); <> = Wordings::last_wn(WR[1]) + *** | ==> { 0, -, <> = Wordings::first_wn(WR[1]), <> = Wordings::last_wn(WR[1]) } +
rule for *** | ==> { 0, -, <> = Wordings::first_wn(WR[1]), <> = Wordings::last_wn(WR[1]) } +
rule *** | ==> { 0, -, <> = Wordings::first_wn(WR[1]), <> = Wordings::last_wn(WR[1]) } + rule for *** | ==> { 0, -, <> = Wordings::first_wn(WR[1]), <> = Wordings::last_wn(WR[1]) } + rule *** ==> { 0, -, <> = Wordings::first_wn(WR[1]), <> = Wordings::last_wn(WR[1]) } ::= - of/for ... | ==> { TRUE, - } - rule about/for/on ... | ==> { TRUE, - } - rule ==> { FALSE, - } + of/for ... | ==> { TRUE, - } + rule about/for/on ... | ==> { TRUE, - } + rule ==> { FALSE, - } @ The following turns the preamble text into a PHUD. It can be used as often as necessary in "coarse mode", but should be run once and once only on any @@ -970,11 +970,11 @@ might have gone wrong. = ::= - ... called ... {when/while ...} | ==> 1; <> = Wordings::first_wn(WR[3]); <> = Wordings::last_wn(WR[3]) - ... {when/while *** nothing ***} | ==> 2; <> = Wordings::first_wn(WR[2]); <> = Wordings::last_wn(WR[2]) - ... {when/while *** nowhere ***} | ==> 3; <> = Wordings::first_wn(WR[2]); <> = Wordings::last_wn(WR[2]) - ... and {when/while ...} | ==> 4; <> = Wordings::first_wn(WR[2]); <> = Wordings::last_wn(WR[2]) - ... {when/while ...} ==> 5; <> = Wordings::first_wn(WR[2]); <> = Wordings::last_wn(WR[2]) + ... called ... {when/while ...} | ==> { 1, -, <> = Wordings::first_wn(WR[3]), <> = Wordings::last_wn(WR[3]) } + ... {when/while *** nothing ***} | ==> { 2, -, <> = Wordings::first_wn(WR[2]), <> = Wordings::last_wn(WR[2]) } + ... {when/while *** nowhere ***} | ==> { 3, -, <> = Wordings::first_wn(WR[2]), <> = Wordings::last_wn(WR[2]) } + ... and {when/while ...} | ==> { 4, -, <> = Wordings::first_wn(WR[2]), <> = Wordings::last_wn(WR[2]) } + ... {when/while ...} ==> { 5, -, <> = Wordings::first_wn(WR[2]), <> = Wordings::last_wn(WR[2]) } @ = ::= @@ -982,7 +982,7 @@ might have gone wrong. ==> { pass 1 } ::= - | ==> { R[1]+R[2], - } + | ==> { R[1] + R[2], - } ==> { pass 1 } ::= diff --git a/inform7/core-module/Chapter 22/Phrases.w b/inform7/core-module/Chapter 22/Phrases.w index 88386006c..9d047f4ad 100644 --- a/inform7/core-module/Chapter 22/Phrases.w +++ b/inform7/core-module/Chapter 22/Phrases.w @@ -274,11 +274,11 @@ what number is...", for instance. = ::= - (- ### - in to only | ==> DECIDES_NOTHING_MOR; <> = Wordings::first_wn(WR[1]) - (- ### - in to decide if only | ==> DECIDES_CONDITION_MOR; <> = Wordings::first_wn(WR[1]) - (- ### - in to decide only | ==> DECIDES_VALUE_MOR; <> = Wordings::first_wn(WR[1]) - (- ### | ==> DONT_KNOW_MOR; <> = Wordings::first_wn(WR[1]) - (- ### ... ==> DONT_KNOW_MOR; <> = Wordings::first_wn(WR[1]); @ + (- ### - in to only | ==> { DECIDES_NOTHING_MOR, -, <> = Wordings::first_wn(WR[1]) } + (- ### - in to decide if only | ==> { DECIDES_CONDITION_MOR, -, <> = Wordings::first_wn(WR[1]) } + (- ### - in to decide only | ==> { DECIDES_VALUE_MOR, -, <> = Wordings::first_wn(WR[1]) } + (- ### | ==> { DONT_KNOW_MOR, -, <> = Wordings::first_wn(WR[1]) } + (- ### ... ==> { DONT_KNOW_MOR, -, <> = Wordings::first_wn(WR[1]) }; @ @ = *X = DONT_KNOW_MOR; diff --git a/inform7/core-module/Chapter 23/Adjectival Definitions.w b/inform7/core-module/Chapter 23/Adjectival Definitions.w index 6dc71b5ba..5b74b67d8 100644 --- a/inform7/core-module/Chapter 23/Adjectival Definitions.w +++ b/inform7/core-module/Chapter 23/Adjectival Definitions.w @@ -81,13 +81,13 @@ the doubled use of colons is unfortunate.) is/are ==> { DEFINED_PHRASALLY, - } ::= - ... ( called the ... ) | ==> 0; <> = TRUE - ... ( called ... ) | ==> 0; <> = TRUE - ... ==> 0; <> = FALSE + ... ( called the ... ) | ==> { 0, -, <> = TRUE } + ... ( called ... ) | ==> { 0, -, <> = TRUE } + ... ==> { 0, -, <> = FALSE } ::= - ... rather than ... | ==> 0; <> = TRUE - ... ==> 0; <> = FALSE + ... rather than ... | ==> { 0, -, <> = TRUE } + ... ==> { 0, -, <> = FALSE } @ And here is the supporting code: diff --git a/inform7/core-module/Chapter 25/Compile Invocations Inline.w b/inform7/core-module/Chapter 25/Compile Invocations Inline.w index 6e41b1b87..9da668090 100644 --- a/inform7/core-module/Chapter 25/Compile Invocations Inline.w +++ b/inform7/core-module/Chapter 25/Compile Invocations Inline.w @@ -194,10 +194,10 @@ the fixed text "phrase options" expands to the whole bitmap. = ::= - phrase options | ==> { OPTS_INSUB, - } - | ==> OPT_INSUB; <> = R[1] - | ==> LOCAL_INSUB; <> = RP[1] - ... ==> @ + phrase options | ==> { OPTS_INSUB, - } + | ==> { OPT_INSUB, -, <> = R[1] } + | ==> { LOCAL_INSUB, -, <> = RP[1] } + ... ==> @ @ This matches one of the token names in the preamble to the inline definition. @@ -215,7 +215,6 @@ the fixed text "phrase options" expands to the whole bitmap. charlatans" and what they "deserve". I'm a better person now. @ = - *X = PROBLEM_INSUB; Problems::quote_source(1, current_sentence); Problems::quote_wording(2, W); StandardProblems::handmade_problem(Task::syntax_tree(), _p_(PM_BadInlineExpansion)); @@ -229,6 +228,7 @@ charlatans" and what they "deserve". I'm a better person now. "extensions. A good rule of thumb is: if you can define a phrase without " "using I6 insertions, do."); Problems::issue_problem_end(); + ==> { PROBLEM_INSUB, - }; @ Acting on that: diff --git a/inform7/core-module/Chapter 26/Inform 6 Inclusions.w b/inform7/core-module/Chapter 26/Inform 6 Inclusions.w index f2abe259a..1b7a2f5e5 100644 --- a/inform7/core-module/Chapter 26/Inform 6 Inclusions.w +++ b/inform7/core-module/Chapter 26/Inform 6 Inclusions.w @@ -45,12 +45,12 @@ and the following grammar defines the "when defining a thing" end. = ::= - {} | ==> @ - {} in {} | ==> @ - when defining | ==> WHEN_DEFINING_INC; <> = RP[1] - when defining ... | ==> @ - before the library | ==> @ - in the preform grammar ==> { AS_PREFORM_INC, - } + {} | ==> @ + {} in {} | ==> @ + when defining | ==> { WHEN_DEFINING_INC, -, <> = RP[1] } + when defining ... | ==> @ + before the library | ==> @ + in the preform grammar ==> { AS_PREFORM_INC, - } ::= before | ==> { BEFORE_LINK_STAGE, - } diff --git a/inform7/core-module/Chapter 26/Plugins.w b/inform7/core-module/Chapter 26/Plugins.w index 3ef5e384f..edbb82be9 100644 --- a/inform7/core-module/Chapter 26/Plugins.w +++ b/inform7/core-module/Chapter 26/Plugins.w @@ -88,7 +88,15 @@ present. = ::= - ==> TRUE; if ((registered_plugins[R[1]] == NULL) || (registered_plugins[R[1]]->now_plugged_in == FALSE)) *X = FALSE; + ==> @; + +@ = + if ((registered_plugins[R[1]] == NULL) || + (registered_plugins[R[1]]->now_plugged_in == FALSE)) { + ==> { FALSE, - }; + } else { + ==> { TRUE, - }; + } @ = word_assemblage Plugins::Manage::wording(int N) { diff --git a/inform7/core-module/Chapter 26/Test Scripts.w b/inform7/core-module/Chapter 26/Test Scripts.w index 68a07d2ac..c3bc15586 100644 --- a/inform7/core-module/Chapter 26/Test Scripts.w +++ b/inform7/core-module/Chapter 26/Test Scripts.w @@ -99,21 +99,21 @@ test_scenario *ts_being_parsed = NULL; = ::= - | ==> TRUE; @ - | ==> TRUE; @ - ... ==> @ + | ==> { TRUE, - }; @ + | ==> { TRUE, - }; @ + ... ==> @ ::= - ... | ==> 0; return preform_lookahead_mode; - | ==> { 0, - } - ==> { 0, - } + ... | ==> { lookahead } + | ==> { 0, - } + ==> { 0, - } ::= - in | ==> @ - holding/and/, | ==> @ - in ... | ==> @ - holding/and/, ... | ==> @ - with ... ==> @ + in | ==> @ + holding/and/, | ==> @ + in ... | ==> @ + holding/and/, ... | ==> @ + with ... ==> @ @ = int i, x1 = R[1]; diff --git a/inform7/core-module/Chapter 26/Translate to Identifiers.w b/inform7/core-module/Chapter 26/Translate to Identifiers.w index 422e2f653..004b94dd1 100644 --- a/inform7/core-module/Chapter 26/Translate to Identifiers.w +++ b/inform7/core-module/Chapter 26/Translate to Identifiers.w @@ -122,7 +122,7 @@ traversing the parse tree to look for translation sentences of the right sort. = ::= - ( ) ==> R[2]; + ( ) ==> { pass 2 } @ = void IdentifierTranslations::plus_responses(parse_node *p, rule *R) { diff --git a/inform7/core-module/Chapter 26/Use Options.w b/inform7/core-module/Chapter 26/Use Options.w index e1d5a8d3f..0e848e7d2 100644 --- a/inform7/core-module/Chapter 26/Use Options.w +++ b/inform7/core-module/Chapter 26/Use Options.w @@ -323,16 +323,16 @@ those which need immediate action. = ::= - ... | ==> TRUE; return preform_lookahead_mode; /* match only when looking ahead */ - | ==> { TRUE, - } - ==> { TRUE, - } + ... | ==> { lookahead } + | + ::= , _and | _,/and ::= - | ==> @ + | ==> @ ...... @ = diff --git a/inform7/core-module/Chapter 5/Literal Patterns.w b/inform7/core-module/Chapter 5/Literal Patterns.w index 87a4fa78d..91d9bc3e2 100644 --- a/inform7/core-module/Chapter 5/Literal Patterns.w +++ b/inform7/core-module/Chapter 5/Literal Patterns.w @@ -2496,7 +2496,7 @@ of alternatives each of which matches the following: = ::= ... ( {} ) | ==> { pass 1 } - times | ==> TIMES_LPN; LP_left_kind = RP[1]; LP_right_kind = RP[2]; + times | ==> { TIMES_LPN, - }; LP_left_kind = RP[1]; LP_right_kind = RP[2]; times | ==> @ ... ==> { 0, NULL } @@ -2567,17 +2567,17 @@ can't set both scaling and an equivalent, for instance. ::= with parts | ==> { PARTS_LPC, RP[1] } | ==> { SCALING_LPC, - } - offset by | ==> SCALING_LPC; LP_real_offset = latest_constructed_real; LP_offset_value = RP[2]; - offset by | ==> OFFSET_LPC; LP_real_offset = latest_constructed_real; LP_offset_value = RP[1]; - equivalent to ==> EQUIVALENT_LPC; LP_real_equivalent = latest_constructed_real; LP_equivalent_value = RP[1]; + offset by | ==> { SCALING_LPC, - }; LP_real_offset = latest_constructed_real; LP_offset_value = RP[2]; + offset by | ==> { OFFSET_LPC, - }; LP_real_offset = latest_constructed_real; LP_offset_value = RP[1]; + equivalent to ==> { EQUIVALENT_LPC, - }; LP_real_equivalent = latest_constructed_real; LP_equivalent_value = RP[1]; ::= - scaled up by | ==> SCALING_LPC; LP_scaling = LP_SCALED_UP; LP_scaling_amount = R[1]; LP_real_scaling_amount = (double) LP_scaling_amount; - scaled up by | ==> SCALING_LPC; LP_scaling = LP_SCALED_UP; LP_scaling_amount = 1; LP_real_scaling_amount = latest_constructed_real; LP_to_real = TRUE; - scaled down by | ==> SCALING_LPC; LP_scaling = LP_SCALED_DOWN; LP_scaling_amount = R[1]; LP_real_scaling_amount = (double) LP_scaling_amount; - scaled down by | ==> SCALING_LPC; LP_scaling = LP_SCALED_DOWN; LP_scaling_amount = 1; LP_real_scaling_amount = latest_constructed_real; LP_to_real = TRUE; - scaled at | ==> SCALING_LPC; LP_scaling = LP_SCALED_AT; LP_scaling_amount = R[1]; LP_real_scaling_amount = (double) LP_scaling_amount; - scaled at ==> SCALING_LPC; LP_scaling = LP_SCALED_AT; LP_scaling_amount = 1; LP_real_scaling_amount = latest_constructed_real; LP_to_real = TRUE; + scaled up by | ==> { SCALING_LPC, - }; LP_scaling = LP_SCALED_UP; LP_scaling_amount = R[1]; LP_real_scaling_amount = (double) LP_scaling_amount; + scaled up by | ==> { SCALING_LPC, - }; LP_scaling = LP_SCALED_UP; LP_scaling_amount = 1; LP_real_scaling_amount = latest_constructed_real; LP_to_real = TRUE; + scaled down by | ==> { SCALING_LPC, - }; LP_scaling = LP_SCALED_DOWN; LP_scaling_amount = R[1]; LP_real_scaling_amount = (double) LP_scaling_amount; + scaled down by | ==> { SCALING_LPC, - }; LP_scaling = LP_SCALED_DOWN; LP_scaling_amount = 1; LP_real_scaling_amount = latest_constructed_real; LP_to_real = TRUE; + scaled at | ==> { SCALING_LPC, - }; LP_scaling = LP_SCALED_AT; LP_scaling_amount = R[1]; LP_real_scaling_amount = (double) LP_scaling_amount; + scaled at ==> { SCALING_LPC, - }; LP_scaling = LP_SCALED_AT; LP_scaling_amount = 1; LP_real_scaling_amount = latest_constructed_real; LP_to_real = TRUE; @ = if (preform_lookahead_mode == FALSE) { @@ -2596,28 +2596,28 @@ by a bracketed list of up to three options in any order. = ::= - , and | ==> { 0, RP[1] }; if (RP[1]) ((parse_node *) RP[1])->next = RP[2]; - , | ==> { 0, RP[1] }; if (RP[1]) ((parse_node *) RP[1])->next = RP[2]; + , and | ==> { 0, RP[1] }; if (RP[1]) ((parse_node *) RP[1])->next = RP[2]; + , | ==> { 0, RP[1] }; if (RP[1]) ((parse_node *) RP[1])->next = RP[2]; and | ==> { 0, RP[1] }; if (RP[1]) ((parse_node *) RP[1])->next = RP[2]; - ==> { 0, RP[1] } + ==> { 0, RP[1] } ::= - ( ) | ==> { 0, RP[1] }; if (RP[1]) Annotations::write_int(*XP, lpe_options_ANNOT, R[2]); - ==> { 0, RP[1] } + ( ) | ==> { 0, RP[1] }; if (RP[1]) Annotations::write_int(*XP, lpe_options_ANNOT, R[2]); + ==> { 0, RP[1] } ::= - | ==> R[1] | R[2] - ==> { pass 1 } + | ==> { R[1] | R[2], - } + ==> { pass 1 } ::= - , and | ==> { pass 1 } - ,/and ==> { pass 1 } + , and | ==> { pass 1 } + ,/and ==> { pass 1 } ::= - optional | ==> { OPTIONAL_LSO, - } - preamble optional | ==> { PREAMBLE_OPTIONAL_LSO, - } - without leading zeros | ==> { WITHOUT_LEADING_ZEROS_LSO, - } - ...... ==> @ + optional | ==> { OPTIONAL_LSO, - } + preamble optional | ==> { PREAMBLE_OPTIONAL_LSO, - } + without leading zeros | ==> { WITHOUT_LEADING_ZEROS_LSO, - } + ...... ==> @ @ = *X = 0; diff --git a/inform7/core-module/Chapter 5/Times of Day.w b/inform7/core-module/Chapter 5/Times of Day.w index ae12658ff..9cdbc8035 100644 --- a/inform7/core-module/Chapter 5/Times of Day.w +++ b/inform7/core-module/Chapter 5/Times of Day.w @@ -61,18 +61,18 @@ linguistically the same thing at all. = ::= - minus | ==> Rvalues::from_time(-R[1], W) - | ==> Rvalues::from_time(R[1], W) - ==> Rvalues::from_time(R[1], W) + minus | ==> { -, Rvalues::from_time(-R[1], W) } + | ==> { -, Rvalues::from_time(R[1], W) } + ==> { -, Rvalues::from_time(R[1], W) } ::= - hour/hours | ==> 60*R[1] - minute/minutes | ==> R[1] - hour/hours minute/minutes ==> 60*R[1]+R[2] + hour/hours | ==> { 60*R[1], - } + minute/minutes | ==> { pass 1 } + hour/hours minute/minutes ==> { 60*R[1]+R[2], - } ::= | ==> @ - ==> @ + ==> @ ::= am | diff --git a/inform7/core-module/Chapter 5/Unicode Translations.w b/inform7/core-module/Chapter 5/Unicode Translations.w index ec6f05ac2..bcb9f8f83 100644 --- a/inform7/core-module/Chapter 5/Unicode Translations.w +++ b/inform7/core-module/Chapter 5/Unicode Translations.w @@ -66,8 +66,8 @@ the player types either of these: = ::= - | ==> Rvalues::from_Unicode_point(R[1], W); if (!(UnicodeTranslations::char_in_range(R[1]))) return FALSE; - ==> Rvalues::from_Unicode_point(R[1], W) + | ==> { -, Rvalues::from_Unicode_point(R[1], W) }; if (!(UnicodeTranslations::char_in_range(R[1]))) return FALSE; + ==> { -, Rvalues::from_Unicode_point(R[1], W) } internal { parse_node *p = Lexicon::retrieve(MISCELLANEOUS_MC, W); diff --git a/inform7/core-module/Chapter 6/New Verbs.w b/inform7/core-module/Chapter 6/New Verbs.w index 284eff4a6..174603c30 100644 --- a/inform7/core-module/Chapter 6/New Verbs.w +++ b/inform7/core-module/Chapter 6/New Verbs.w @@ -136,19 +136,19 @@ as the object. = ::= - in | ==> R[2]; <> = (inform_language *) (RP[1]); - ==> R[1]; <> = DefaultLanguage::get(NULL); + in | ==> { R[2], -, <> = RP[1] } + ==> { R[1], -, <> = DefaultLanguage::get(NULL) } ::= - to ( ... ) | ==> R[1]; <> = TRUE - to | ==> R[1]; <> = FALSE - ( ... ) | ==> R[1]; <> = TRUE - ==> R[1]; <> = FALSE + to ( ... ) | ==> { R[1], -, <> = TRUE } + to | ==> { R[1], -, <> = FALSE } + ( ... ) | ==> { R[1], -, <> = TRUE } + ==> { R[1], -, <> = FALSE } ::= - {be able to ...} | ==> { TRUE, - } - {be able to} | ==> { TRUE, - } - ... ==> { FALSE, - } + {be able to ...} | ==> { TRUE, - } + {be able to} | ==> { TRUE, - } + ... ==> { FALSE, - } @ The text in brackets, if given, is a comma-separated list of conjugations of the verb. Each one is matched against this: @@ -184,14 +184,14 @@ now absolutely any non-empty word range is accepted as the property name. = ::= - reversed relation | ==> REL_VERBM; *XP = BinaryPredicates::get_reversal(RP[1]) - relation | ==> { REL_VERBM, RP[1] } - to | ==> @ - ... property | ==> { PROP_VERBM, - } - built-in ... meaning | ==> { BUILTIN_VERBM, - } - ... relation | ==> @ - {relation} | ==> @ - ... ==> @ + reversed relation | ==> { REL_VERBM, BinaryPredicates::get_reversal(RP[1]) } + relation | ==> { REL_VERBM, RP[1] } + to | ==> @ + ... property | ==> { PROP_VERBM, - } + built-in ... meaning | ==> { BUILTIN_VERBM, - } + ... relation | ==> @ + {relation} | ==> @ + ... ==> @ @ = *X = NONE_VERBM; @@ -233,13 +233,13 @@ now absolutely any non-empty word range is accepted as the property name. = ::= - | ==> { pass 2 } - ==> { pass 1 } + | ==> { pass 2 } + ==> { pass 1 } ::= - verb | ==> TRUE; *XP = NULL; - verb implying/meaning nounphrase-unparsed> | ==> { TRUE, RP[2] } - verb implying/meaning ==> { TRUE, RP[1] } + verb | ==> { TRUE, NULL } + verb implying/meaning nounphrase-unparsed> | ==> { TRUE, RP[2] } + verb implying/meaning ==> { TRUE, RP[1] } @ = int NewVerbs::new_verb_SMF(int task, parse_node *V, wording *NPs) { @@ -266,13 +266,13 @@ int NewVerbs::new_verb_SMF(int task, parse_node *V, wording *NPs) { = ::= - | ==> { pass 2 } - ==> { pass 1 } + | ==> { pass 2 } + ==> { pass 1 } ::= - verb to | ==> { fail } - verb in the imperative | ==> { TRUE, RP[1] } - verb ==> { FALSE, RP[1] } + verb to | ==> { fail } + verb in the imperative | ==> { TRUE, RP[1] } + verb ==> { FALSE, RP[1] } @ = int NewVerbs::verb_means_SMF(int task, parse_node *V, wording *NPs) { @@ -1121,13 +1121,13 @@ int NewVerbs::takes_contraction_form(word_assemblage *wa) { = ::= - | ==> { pass 2 } - ==> { pass 1 } + | ==> { pass 2 } + ==> { pass 1 } ::= - adjective | ==> TRUE; *XP = NULL - adjective implying/meaning | ==> { TRUE, RP[2] } - adjective implying/meaning ==> { TRUE, RP[1] } + adjective | ==> { TRUE, NULL } + adjective implying/meaning | ==> { TRUE, RP[2] } + adjective implying/meaning ==> { TRUE, RP[1] } @ = int NewVerbs::new_adjective_SMF(int task, parse_node *V, wording *NPs) { diff --git a/inform7/core-module/Chapter 6/Relations.w b/inform7/core-module/Chapter 6/Relations.w index 7c5435e80..7e7dbd216 100644 --- a/inform7/core-module/Chapter 6/Relations.w +++ b/inform7/core-module/Chapter 6/Relations.w @@ -304,28 +304,28 @@ to be the name of a kind, possibly in the plural. = ::= - ( called ... ) | ==> R[1] | CALLED_RBIT - ==> { pass 1 } + ( called ... ) | ==> { R[1] | CALLED_RBIT, - } + ==> { pass 1 } ::= - with fast route-finding | ==> R[1] | FRF_RBIT - when ... | ==> R[1] | WHEN_RBIT - ==> { pass 1 } + with fast route-finding | ==> { R[1] | FRF_RBIT, - } + when ... | ==> { R[1] | WHEN_RBIT, - } + ==> { pass 1 } ::= - ( called ... ) | ==> R[1] | CALLED_RBIT - ==> { pass 1 } + ( called ... ) | ==> { R[1] | CALLED_RBIT, - } + ==> { pass 1 } ::= - {another} | ==> { ANOTHER_RBIT, - } - {each other} | ==> { EACHOTHER_RBIT, - } - {each other in groups} | ==> { GROUPS_RBIT, - } - ==> { pass 1 } + {another} | ==> { ANOTHER_RBIT, - } + {each other} | ==> { EACHOTHER_RBIT, - } + {each other in groups} | ==> { GROUPS_RBIT, - } + ==> { pass 1 } ::= - one ... | ==> { ONE_RBIT, - } - various ... | ==> { VAR_RBIT, - } - ... ==> { 0, - } + one ... | ==> { ONE_RBIT, - } + various ... | ==> { VAR_RBIT, - } + ... ==> { 0, - } @h The parsing phase. Our aims here are: diff --git a/inform7/core-module/Chapter 7/Nonstructural Sentences.w b/inform7/core-module/Chapter 7/Nonstructural Sentences.w index ce0146e75..3343e1b99 100644 --- a/inform7/core-module/Chapter 7/Nonstructural Sentences.w +++ b/inform7/core-module/Chapter 7/Nonstructural Sentences.w @@ -203,14 +203,14 @@ void Sentences::VPs::switch_dl_mode(parse_node *PN, int sense) { @ = ::= - only | ==> R[1] | ONLY_DLR; *XP = RP[1] - ==> { pass 1 } + only | ==> { R[1] | ONLY_DLR, RP[1] } + ==> { pass 1 } ::= - everything | ==> { EVERYTHING_DLR, - } - nothing | ==> { NOTHING_DLR, - } - | ==> { PREFORM_DLR, RP[1] } - ... ==> { SOMETHING_DLR, - } + everything | ==> { EVERYTHING_DLR, NULL } + nothing | ==> { NOTHING_DLR, NULL } + | ==> { PREFORM_DLR, RP[1] } + ... ==> { SOMETHING_DLR, NULL } = void Sentences::VPs::set_aspect_from_text(wording W, int new_state) { @@ -401,16 +401,16 @@ new action. = ::= - figure ... ==> 0; *XP = Diagrams::new_UNPARSED_NOUN(W) + figure ... ==> { 0, Diagrams::new_UNPARSED_NOUN(W) } ::= - sound ... ==> 0; *XP = Diagrams::new_UNPARSED_NOUN(W) + sound ... ==> { 0, Diagrams::new_UNPARSED_NOUN(W) } ::= - ==> 0; *XP = Diagrams::new_UNPARSED_NOUN(W) + ==> { 0, Diagrams::new_UNPARSED_NOUN(W) } ::= - ^ ==> 0; *XP = Diagrams::new_UNPARSED_NOUN(W) + ^ ==> { 0, Diagrams::new_UNPARSED_NOUN(W) } ::= *** that/which vary/varies | @@ -420,11 +420,11 @@ new action. = ::= - unicode ==> TRUE; *XP = NULL; + unicode ==> { TRUE, NULL } ::= - i6 | ==> TRUE; *XP = NULL; - inform 6 ==> TRUE; *XP = NULL; + i6 | ==> { TRUE, NULL } + inform 6 ==> { TRUE, NULL } ::= ==> { TRUE, RP[1] } diff --git a/inform7/core-module/Chapter 7/Of and From.w b/inform7/core-module/Chapter 7/Of and From.w index 0a09b5bd4..7072471dd 100644 --- a/inform7/core-module/Chapter 7/Of and From.w +++ b/inform7/core-module/Chapter 7/Of and From.w @@ -217,8 +217,8 @@ property names before they can do any damage.) {_,/and} ::= - | ==> { 0, - } - ... ==> 0; Properties::Valued::obtain(W); + | ==> { 0, - } + ... ==> { 0, Properties::Valued::obtain(W) } ::=
| ==> @ diff --git a/inform7/if-module/Chapter 2/Bibliographic Data.w b/inform7/if-module/Chapter 2/Bibliographic Data.w index 6f7866cdb..c6832a1de 100644 --- a/inform7/if-module/Chapter 2/Bibliographic Data.w +++ b/inform7/if-module/Chapter 2/Bibliographic Data.w @@ -151,8 +151,8 @@ which must match: story ::= - episode of | ==> R[1]; <> = R[2]; - episode ... ==> @; + episode of | ==> { R[1], -, <> = R[2] } + episode ... ==> @; @ = *X = -1; diff --git a/inform7/if-module/Chapter 2/Release Instructions.w b/inform7/if-module/Chapter 2/Release Instructions.w index 361ce5daf..4af1b9fe5 100644 --- a/inform7/if-module/Chapter 2/Release Instructions.w +++ b/inform7/if-module/Chapter 2/Release Instructions.w @@ -56,26 +56,26 @@ The object noun phrase is an articled list, and each entry must match this. = ::= - | ==> R[2]; <> = R[1] - ... | ==> @ - | ==> R[1]; <> = NOT_APPLICABLE - cover art ( ) | ==> COVER_ART_PAYLOAD; <> = R[1]; - cover art | ==> COVER_ART_PAYLOAD; <> = -1; - existing story file | ==> { EXISTING_STORY_FILE_PAYLOAD, - } - existing story file called {} | ==> { NAMED_EXISTING_STORY_FILE_PAYLOAD, - } - file of {} called {} | ==> { AUXILIARY_FILE_PAYLOAD, - } - file {} in {} | ==> { HIDDEN_FILE_IN_PAYLOAD, - } - file {} | ==> { HIDDEN_FILE_PAYLOAD, - } - style sheet {} | ==> { CSS_PAYLOAD, - } - javascript {} | ==> { JAVASCRIPT_PAYLOAD, - } - introductory booklet | ==> { BOOKLET_PAYLOAD, - } - introductory postcard | ==> { POSTCARD_PAYLOAD, - } - website | ==> { WEBSITE_PAYLOAD, - } - separate figures | ==> { SEPARATE_FIGURES_PAYLOAD, - } - separate sounds | ==> { SEPARATE_SOUNDS_PAYLOAD, - } - {} website | ==> { THEMED_WEBSITE_PAYLOAD, - } - interpreter | ==> { INTERPRETER_PAYLOAD, - } - {} interpreter ==> { THEMED_INTERPRETER_PAYLOAD, - } + | ==> { R[2], -, <> = R[1] } + ... | ==> @ + | ==> { R[1], -, <> = NOT_APPLICABLE } + cover art ( ) | ==> { COVER_ART_PAYLOAD, -, <> = R[1] } + cover art | ==> { COVER_ART_PAYLOAD, -, <> = -1 } + existing story file | ==> { EXISTING_STORY_FILE_PAYLOAD, - } + existing story file called {} | ==> { NAMED_EXISTING_STORY_FILE_PAYLOAD, - } + file of {} called {} | ==> { AUXILIARY_FILE_PAYLOAD, - } + file {} in {} | ==> { HIDDEN_FILE_IN_PAYLOAD, - } + file {} | ==> { HIDDEN_FILE_PAYLOAD, - } + style sheet {} | ==> { CSS_PAYLOAD, - } + javascript {} | ==> { JAVASCRIPT_PAYLOAD, - } + introductory booklet | ==> { BOOKLET_PAYLOAD, - } + introductory postcard | ==> { POSTCARD_PAYLOAD, - } + website | ==> { WEBSITE_PAYLOAD, - } + separate figures | ==> { SEPARATE_FIGURES_PAYLOAD, - } + separate sounds | ==> { SEPARATE_SOUNDS_PAYLOAD, - } + {} website | ==> { THEMED_WEBSITE_PAYLOAD, - } + interpreter | ==> { INTERPRETER_PAYLOAD, - } + {} interpreter ==> { THEMED_INTERPRETER_PAYLOAD, - } @ = *X = BOOKLET_PAYLOAD; /* to recover harmlessly */ diff --git a/inform7/if-module/Chapter 3/EPS Map.w b/inform7/if-module/Chapter 3/EPS Map.w index 66278c17c..0d2c16cf9 100644 --- a/inform7/if-module/Chapter 3/EPS Map.w +++ b/inform7/if-module/Chapter 3/EPS Map.w @@ -342,21 +342,21 @@ itself. = ::= - eps file | ==> { EPSFILE_IMW, - } - mapped as | ==> MAPPED_AS_IMW; <> = RP[1]; <> = RP[2]; - ... mapped as ... | ==> @ - mapped | ==> MAPPED_IMW; <> = RP[1]; <> = RP[2]; - ... mapped ... | ==> @ - set to | ==> SETTING_IMW; <> = R[1]; if (R[1] == NO_IMW) *X = NO_IMW; <> = R[2] - set to ... | ==> @ - ... set to ... | ==> @ - rubric {} *** | ==> { RUBRIC_IMW, - } - ... ==> @ + eps file | ==> { EPSFILE_IMW, - } + mapped as | ==> { MAPPED_AS_IMW, -, <> = RP[1], <> = RP[2] } + ... mapped as ... | ==> @ + mapped | ==> { MAPPED_IMW, -, <> = RP[1], <> = RP[2] } + ... mapped ... | ==> @ + set to | ==> { SETTING_IMW, -, <> = R[1], <> = R[2] }; if (R[1] == NO_IMW) *X = NO_IMW; + set to ... | ==> @ + ... set to ... | ==> @ + rubric {} *** | ==> { RUBRIC_IMW, - } + ... ==> @ ::= - of/from | ==> TRUE; <> = RP[1]; *XP = RP[2] - above | ==> TRUE; <> = I_up; *XP = RP[1] - below ==> TRUE; <> = I_down; *XP = RP[1] + of/from | ==> { TRUE, RP[2], <> = RP[1] } + above | ==> { TRUE, RP[1], <> = I_up } + below ==> { TRUE, RP[1], <> = I_down } @ = *X = NO_IMW; @@ -404,19 +404,19 @@ itself. = ::= - of | ==> R[2]; <> = RP[1]; <> = R[1] - | ==> ENTIRE_MAP_SCOPE; <> = RP[1]; <> = R[1] - ... of ==> @ + of | ==> { R[2], -, <> = RP[1], <> = R[1] } + | ==> { ENTIRE_MAP_SCOPE, -, <> = RP[1], <> = R[1] } + ... of ==> @ ::= - | ==> { pass 2 } - ==> { pass 1 } + | ==> { pass 2 } + ==> { pass 1 } ::= - first room | ==> { FIRST_ROOM_MAP_SCOPE, - } - level | ==> LEVEL_MAP_SCOPE; <> = R[1] - | ==> KIND_MAP_SCOPE; <> = RP[1] - ==> INSTANCE_MAP_SCOPE; <> = RP[1] + first room | ==> { FIRST_ROOM_MAP_SCOPE, - } + level | ==> { LEVEL_MAP_SCOPE, -, <> = R[1] } + | ==> { KIND_MAP_SCOPE, -, <> = RP[1] } + ==> { INSTANCE_MAP_SCOPE, -, <> = RP[1] } @ The map parameters all have one-word, sometimes hyphenated, names, such as the following: @@ -454,15 +454,15 @@ Never mind. = ::= - | ==> INT_MDT; <> = R[1]; <> = Wordings::first_wn(W); - | ==> TEXT_MDT; <> = R[1]; <> = Wordings::first_wn(W); - | ==> BOOL_MDT; <> = R[1]; <> = Wordings::first_wn(W); - | ==> OFF_MDT; <> = R[1]; <> = Wordings::first_wn(W); if (R[1] == ERRONEOUS_OFFSET_VALUE) return FALSE; - ### ==> -1; <> = Wordings::first_wn(W); /* leads to a problem message later */ + | ==> { INT_MDT, -, <> = R[1], <> = Wordings::first_wn(W) } + | ==> { TEXT_MDT, -, <> = R[1], <> = Wordings::first_wn(W) } + | ==> { BOOL_MDT, -, <> = R[1], <> = Wordings::first_wn(W) } + | ==> { OFF_MDT, -, <> = R[1], <> = Wordings::first_wn(W) }; if (R[1] == ERRONEOUS_OFFSET_VALUE) return FALSE; + ### ==> { -1, -, <> = Wordings::first_wn(W) } /* leads to a problem message later */ ::= - on | ==> { TRUE, - } - off ==> { FALSE, - } + on | ==> { TRUE, - } + off ==> { FALSE, - } @ Map offsets have a cutesy notation: |10&-30|, for example, written as a single word. The following nonterminal actually matches any single word @@ -481,11 +481,11 @@ the following: = ::= - size *** | ==> RUBRIC_SIZE; <> = R[1]; <> = Wordings::first_wn(WR[1]) - font {} *** | ==> RUBRIC_FONT; <> = R[1]; <> = Wordings::first_wn(WR[2]) - colour {} *** | ==> RUBRIC_COLOUR; <> = R[1]; <> = Wordings::first_wn(WR[2]) - at from ... | ==> RUBRIC_OFFSET; <> = R[1]; <> = Wordings::first_wn(WR[1]) - at *** ==> RUBRIC_POSITION; <> = R[1]; <> = Wordings::first_wn(WR[1]) + size *** | ==> { RUBRIC_SIZE, -, <> = R[1], <> = Wordings::first_wn(WR[1]) } + font {} *** | ==> { RUBRIC_FONT, -, <> = R[1], <> = Wordings::first_wn(WR[2]) } + colour {} *** | ==> { RUBRIC_COLOUR, -, <> = R[1], <> = Wordings::first_wn(WR[2]) } + at from ... | ==> { RUBRIC_OFFSET, -, <> = R[1], <> = Wordings::first_wn(WR[1]) } + at *** ==> { RUBRIC_POSITION, -, <> = R[1], <> = Wordings::first_wn(WR[1]) } @ diff --git a/inform7/if-module/Chapter 3/Scenes.w b/inform7/if-module/Chapter 3/Scenes.w index ebd1bf6f3..672cb162a 100644 --- a/inform7/if-module/Chapter 3/Scenes.w +++ b/inform7/if-module/Chapter 3/Scenes.w @@ -389,14 +389,14 @@ in a different context, for instance, and could still be valid in that case. = ::= - | ==> @ - play begins | ==> { -1, - } - play ends | ==> @ - begins | ==> 0; <> = RP[1] - ends | ==> 1; <> = RP[1] - ends | ==> R[2]; <> = RP[1] + | ==> @ + play begins | ==> { -1, - } + play ends | ==> @ + begins | ==> { 0, -, <> = RP[1] } + ends | ==> { 1, -, <> = RP[1] } + ends | ==> { R[2], -, <> = RP[1] } ends ... | ==> @ - ==> -2; <> = RP[1] + ==> { -2, -, <> = RP[1] } @ = *X = -1; diff --git a/inform7/if-module/Chapter 4/Action Patterns.w b/inform7/if-module/Chapter 4/Action Patterns.w index d52e2f9bf..e4241eb75 100644 --- a/inform7/if-module/Chapter 4/Action Patterns.w +++ b/inform7/if-module/Chapter 4/Action Patterns.w @@ -695,10 +695,10 @@ a condition attached with "when": = ::= - when/while | ==> { 0, RP[1] }; action_pattern *ap = *XP; ap->when = RP[2]; if (pap_failure_reason == MISC_PAPF) pap_failure_reason = WHENOKAY_PAPF; - | ==> { 0, RP[1] }; - ... when/while | ==> 0; pap_failure_reason = WHENOKAY_PAPF; return FALSE; /* used only to diagnose problems */ - ... when/while ... ==> 0; if (pap_failure_reason != WHENOKAY_PAPF) pap_failure_reason = WHEN_PAPF; return FALSE; /* used only to diagnose problems */ + when/while | ==> { 0, RP[1] }; action_pattern *ap = *XP; ap->when = RP[2]; if (pap_failure_reason == MISC_PAPF) pap_failure_reason = WHENOKAY_PAPF; + | ==> { 0, RP[1] }; + ... when/while | ==> { 0, NULL }; pap_failure_reason = WHENOKAY_PAPF; return FALSE; /* used only to diagnose problems */ + ... when/while ... ==> { 0, NULL }; if (pap_failure_reason != WHENOKAY_PAPF) pap_failure_reason = WHEN_PAPF; return FALSE; /* used only to diagnose problems */ @ is really just in disguise -- i.e., it matches a standard Inform condition -- but it's implemented as an internal diff --git a/inform7/if-module/Chapter 4/Actions.w b/inform7/if-module/Chapter 4/Actions.w index d2b5f0161..97ed98dc7 100644 --- a/inform7/if-module/Chapter 4/Actions.w +++ b/inform7/if-module/Chapter 4/Actions.w @@ -767,8 +767,8 @@ action to be created. = ::= - | ==> @ - ... ==> 0; *XP = PL::Actions::act_new(W, TRUE); + | ==> @ + ... ==> { 0, PL::Actions::act_new(W, TRUE) } @ = *XP = NULL; @@ -793,50 +793,50 @@ It's convenient to define a single action clause first: = ::= - out of world | ==> { OOW_ACT_CLAUSE, - } - abbreviable | ==> { ABBREV_ACT_CLAUSE, - } - with past participle ... | ==> { PP_ACT_CLAUSE, - } - applying to | ==> APPLYING_ACT_CLAUSE; <> = R[1] - requiring light ==> { LIGHT_ACT_CLAUSE, - } + out of world | ==> { OOW_ACT_CLAUSE, - } + abbreviable | ==> { ABBREV_ACT_CLAUSE, - } + with past participle ... | ==> { PP_ACT_CLAUSE, - } + applying to | ==> { APPLYING_ACT_CLAUSE, -, <> = R[1] } + requiring light ==> { LIGHT_ACT_CLAUSE, - } ::= - nothing | ==> { 0, - } - one and one | ==> 2; <> = RP[1]; <> = R[1]; <> = RP[2]; <> = R[2] - one and | ==> 2; <> = RP[1]; <> = R[1]; <> = RP[2]; <> = R[2] - and one | ==> 2; <> = RP[1]; <> = R[1]; <> = RP[2]; <> = R[2] - and | ==> 2; <> = RP[1]; <> = R[1]; <> = RP[2]; <> = R[2] - nothing or one | ==> -1; <> = RP[1]; <> = R[1] - one | ==> 1; <> = RP[1]; <> = R[1] - two | ==> 2; <> = RP[1]; <> = R[1]; <> = RP[1]; <> = R[1] - | ==> 1; <> = RP[1]; <> = R[1] - ... ==> @; + nothing | ==> { 0, - } + one and one | ==> { 2, -, <> = RP[1], <> = R[1], <> = RP[2], <> = R[2] } + one and | ==> { 2, -, <> = RP[1], <> = R[1], <> = RP[2], <> = R[2] } + and one | ==> { 2, -, <> = RP[1], <> = R[1], <> = RP[2], <> = R[2] } + and | ==> { 2, -, <> = RP[1], <> = R[1], <> = RP[2], <> = R[2] } + nothing or one | ==> { -1, -, <> = RP[1], <> = R[1] } + one | ==> { 1, -, <> = RP[1], <> = R[1] } + two | ==> { 2, -, <> = RP[1], <> = R[1], <> = RP[1], <> = R[1] } + | ==> { 1, -, <> = RP[1], <> = R[1] } + ... ==> @; ::= - | ==> { R[1], RP[2] }; @; - ==> { UNRESTRICTED_ACCESS, RP[1] }; @; + | ==> { R[1], RP[2] }; @; + ==> { UNRESTRICTED_ACCESS, RP[1] }; @; ::= - visible | ==> { DOESNT_REQUIRE_ACCESS, - } - touchable | ==> { REQUIRES_ACCESS, - } - carried ==> { REQUIRES_POSSESSION, - } + visible | ==> { DOESNT_REQUIRE_ACCESS, - } + touchable | ==> { REQUIRES_ACCESS, - } + carried ==> { REQUIRES_POSSESSION, - } @ We are now able to define this peculiar form of list of action clauses: = ::= - | ==> { 0, - } - ... ==> @ + | ==> { 0, - } + ... ==> @ ::= - ... | ==> 0; return preform_lookahead_mode; /* match only on lookahead */ - | ==> R[2]; @ - ==> R[1]; @ + ... | ==> { lookahead } + | ==> { R[2], - }; @ + ==> { R[1], - }; @ ::= - , and | ==> { pass 1 } - and | ==> { pass 1 } - , | ==> { pass 1 } - ==> { pass 1 } + , and | ==> { pass 1 } + and | ==> { pass 1 } + , | ==> { pass 1 } + ==> { pass 1 } @ = StandardProblems::sentence_problem(Task::syntax_tree(), _p_(PM_ActionClauseUnknown), diff --git a/inform7/if-module/Chapter 5/Grammar Lines.w b/inform7/if-module/Chapter 5/Grammar Lines.w index 4ed511ca4..ff6ccaecf 100644 --- a/inform7/if-module/Chapter 5/Grammar Lines.w +++ b/inform7/if-module/Chapter 5/Grammar Lines.w @@ -179,9 +179,9 @@ known what the action will be. = ::= - | ==> 0; <> = RP[1]; - | ==> @ - ... ==> @; + | ==> { 0, -, <> = RP[1] } + | ==> @ + ... ==> @; @ = StandardProblems::sentence_problem(Task::syntax_tree(), _p_(PM_WhenAction), diff --git a/inform7/if-module/Chapter 5/Grammar Properties.w b/inform7/if-module/Chapter 5/Grammar Properties.w index 47a4c2f72..4790c32d5 100644 --- a/inform7/if-module/Chapter 5/Grammar Properties.w +++ b/inform7/if-module/Chapter 5/Grammar Properties.w @@ -83,13 +83,13 @@ the Standard Rules or, in the case of "the X understood", by Inform itself. = ::= - understood | ==> 0; <> = RP[1] - noun | ==> { 1, - } - location | ==> { 2, - } - actor-location | ==> { 3, - } - second noun | ==> { 4, - } - person asked | ==> { 5, - } - maximum score ==> { 6, - } + understood | ==> { 0, -, <> = RP[1] } + noun | ==> { 1, - } + location | ==> { 2, - } + actor-location | ==> { 3, - } + second noun | ==> { 4, - } + person asked | ==> { 5, - } + maximum score ==> { 6, - } @ = int PL::Parsing::Visibility::parsing_new_variable_notify(nonlocal_variable *var) { diff --git a/inform7/if-module/Chapter 5/Grammar Tokens.w b/inform7/if-module/Chapter 5/Grammar Tokens.w index 4c639a52f..a514d9d43 100644 --- a/inform7/if-module/Chapter 5/Grammar Tokens.w +++ b/inform7/if-module/Chapter 5/Grammar Tokens.w @@ -219,38 +219,38 @@ kind *PL::Parsing::Tokens::kind_for_special_token(int gtc) { = ::= - | ==> NAMED_TOKEN_GTC; <> = RP[1] - any things | ==> ANY_THINGS_GTC; <> = Specifications::from_kind(K_thing); - any | ==> ANY_STUFF_GTC; <> = RP[1] - anything | ==> ANY_STUFF_GTC; <> = Specifications::from_kind(K_thing); - anybody | ==> ANY_STUFF_GTC; <> = Specifications::from_kind(K_person); - anyone | ==> ANY_STUFF_GTC; <> = Specifications::from_kind(K_person); - anywhere | ==> ANY_STUFF_GTC; <> = Specifications::from_kind(K_room); - something related by reversed | ==> RELATED_GTC; *XP = BinaryPredicates::get_reversal(RP[1]) - something related by | ==> { RELATED_GTC, RP[1] } - something related by ... | ==> @ - | ==> R[1] - | ==> STUFF_GTC; <> = Specifications::from_kind(RP[2]) - | ==> STUFF_GTC; <> = RP[1] - | ==> @ - ... ==> @ + | ==> { NAMED_TOKEN_GTC, -, <> = RP[1] } + any things | ==> { ANY_THINGS_GTC, -, <> = Specifications::from_kind(K_thing) } + any | ==> { ANY_STUFF_GTC, -, <> = RP[1] } + anything | ==> { ANY_STUFF_GTC, -, <> = Specifications::from_kind(K_thing) } + anybody | ==> { ANY_STUFF_GTC, -, <> = Specifications::from_kind(K_person) } + anyone | ==> { ANY_STUFF_GTC, -, <> = Specifications::from_kind(K_person) } + anywhere | ==> { ANY_STUFF_GTC, -, <> = Specifications::from_kind(K_room) } + something related by reversed | ==> { RELATED_GTC, BinaryPredicates::get_reversal(RP[1]) } + something related by | ==> { RELATED_GTC, RP[1] } + something related by ... | ==> @ + | ==> { R[1], NULL } + | ==> { STUFF_GTC, -, <> = Specifications::from_kind(RP[2]) } + | ==> { STUFF_GTC, -, <> = RP[1] } + | ==> @ + ... ==> @ ::= - something | ==> { NOUN_TOKEN_GTC, - } - things | ==> { MULTI_TOKEN_GTC, - } - things inside | ==> { MULTIINSIDE_TOKEN_GTC, - } - things preferably held | ==> { MULTIHELD_TOKEN_GTC, - } - something preferably held | ==> { HELD_TOKEN_GTC, - } - other things | ==> { MULTIEXCEPT_TOKEN_GTC, - } - someone | ==> { CREATURE_TOKEN_GTC, - } - somebody | ==> { CREATURE_TOKEN_GTC, - } - text | ==> { TOPIC_TOKEN_GTC, - } - topic | ==> @ - a topic | ==> @ - object | ==> @ - an object | ==> @ - something held | ==> @ - things held ==> @ + something | ==> { NOUN_TOKEN_GTC, - } + things | ==> { MULTI_TOKEN_GTC, - } + things inside | ==> { MULTIINSIDE_TOKEN_GTC, - } + things preferably held | ==> { MULTIHELD_TOKEN_GTC, - } + something preferably held | ==> { HELD_TOKEN_GTC, - } + other things | ==> { MULTIEXCEPT_TOKEN_GTC, - } + someone | ==> { CREATURE_TOKEN_GTC, - } + somebody | ==> { CREATURE_TOKEN_GTC, - } + text | ==> { TOPIC_TOKEN_GTC, - } + topic | ==> @ + a topic | ==> @ + object | ==> @ + an object | ==> @ + something held | ==> @ + things held ==> @ internal { grammar_verb *gv = PL::Parsing::Verbs::named_token_by_name(W); diff --git a/inform7/if-module/Chapter 5/Traverse for Grammar.w b/inform7/if-module/Chapter 5/Traverse for Grammar.w index 00754a6bf..58019561f 100644 --- a/inform7/if-module/Chapter 5/Traverse for Grammar.w +++ b/inform7/if-module/Chapter 5/Traverse for Grammar.w @@ -140,11 +140,11 @@ As examples: = ::= - nothing | ==> NOTHING_UNDERSTAND_FORM; *XP = NULL - | ==> { PROPERTY_UNDERSTAND_FORM, RP[1] } - the command/commands | ==> { COMMAND_UNDERSTAND_FORM, RP[1] } - the verb/verbs ... | ==> @ - ==> { GRAMMAR_UNDERSTAND_FORM, RP[1] } + nothing | ==> { NOTHING_UNDERSTAND_FORM, NULL } + | ==> { PROPERTY_UNDERSTAND_FORM, RP[1] } + the command/commands | ==> { COMMAND_UNDERSTAND_FORM, RP[1] } + the verb/verbs ... | ==> @ + ==> { GRAMMAR_UNDERSTAND_FORM, RP[1] } @ = *X = NO_UNDERSTAND_FORM; @@ -160,33 +160,33 @@ As examples: = ::= - ... | ==> 0; *XP = NULL; return preform_lookahead_mode; /* match only when looking ahead */ - | ==> @ - ==> { 0, RP[1] }; + ... | ==> { lookahead } + | ==> @ + ==> { 0, RP[1] } ::= - , _and/or | ==> { 0, RP[1] }; - _,/and/or ==> { 0, RP[1] }; + , _and/or | ==> { 0, RP[1] } + _,/and/or ==> { 0, RP[1] } ::= - ... ==> @ + ... ==> @ @ In the third case, the subject NP is a list of property names written in the formal way (with "property"). = ::= - ... | ==> 0; *XP = NULL; return preform_lookahead_mode; /* match only when looking ahead */ - | ==> @ - ==> { 0, RP[1] }; + ... | ==> { lookahead } + | ==> @ + ==> { 0, RP[1] } ::= - , _and/or | ==> { 0, RP[1] }; - _,/and/or ==> { 0, RP[1] }; + , _and/or | ==> { 0, RP[1] } + _,/and/or ==> { 0, RP[1] } ::= - property | ==> @ - ... property ==> @ + property | ==> @ + ... property ==> @ @ = if (!preform_lookahead_mode) @@ -239,20 +239,20 @@ It's not widely known, but the object phrase here can be a list. = ::= - when/while ... | ==> { 2, RP[1] } - ==> { 1, RP[1] } + when/while ... | ==> { 2, RP[1] } + ==> { 1, RP[1] } ::= - ... | ==> 0; return preform_lookahead_mode; /* match only when looking ahead */ - | ==> @ - ==> { 0, RP[1] } + ... | ==> { lookahead } + | ==> @ + ==> { 0, RP[1] } ::= - , _and/or | ==> { 0, RP[1] } - _,/and/or ==> { 0, RP[1] } + , _and/or | ==> { 0, RP[1] } + _,/and/or ==> { 0, RP[1] } ::= - ==> 0; if (!preform_lookahead_mode) @; + ==> { 0, - }; if (!preform_lookahead_mode) @; @ = understanding_reference *ui1 = RP[1]; @@ -277,21 +277,21 @@ It's not widely known, but the object phrase here can be a list. = ::= - ... | ==> 0; @; return preform_lookahead_mode; /* match only when looking ahead */ - a mistake | ==> 0; ur_being_parsed.gv_result = GV_IS_COMMAND; ur_being_parsed.mistaken = TRUE; - a mistake ( ) | ==> 0; ur_being_parsed.gv_result = GV_IS_COMMAND; ur_being_parsed.mistaken = TRUE; ur_being_parsed.mword = R[1] - a mistake ... | ==> @ - the plural of | ==> R[1]; ur_being_parsed.pluralised_reference = TRUE; - plural of | ==> R[1]; ur_being_parsed.pluralised_reference = TRUE; - | ==> 0; ur_being_parsed.gv_result = GV_IS_TOKEN; - ( with nouns reversed ) | ==> R[1]; ur_being_parsed.reversed_reference = TRUE; - ==> { pass 1 } + ... | ==> { 0, - }; @; return preform_lookahead_mode; /* match only when looking ahead */ + a mistake | ==> { 0, - }; ur_being_parsed.gv_result = GV_IS_COMMAND; ur_being_parsed.mistaken = TRUE; + a mistake ( ) | ==> { 0, - }; ur_being_parsed.gv_result = GV_IS_COMMAND; ur_being_parsed.mistaken = TRUE; ur_being_parsed.mword = R[1] + a mistake ... | ==> @ + the plural of | ==> { R[1], - }; ur_being_parsed.pluralised_reference = TRUE; + plural of | ==> { R[1], - }; ur_being_parsed.pluralised_reference = TRUE; + | ==> { 0, - }; ur_being_parsed.gv_result = GV_IS_TOKEN; + ( with nouns reversed ) | ==> { R[1], - }; ur_being_parsed.reversed_reference = TRUE; + ==> { pass 1 } ::= - | ==> 0; ur_being_parsed.an_reference = RP[1]; - | ==> 0; ur_being_parsed.spec_reference = RP[1]; - | ==> @ - ... ==> @ + | ==> { 0, - }; ur_being_parsed.an_reference = RP[1]; + | ==> { 0, - }; ur_being_parsed.spec_reference = RP[1]; + | ==> @ + ... ==> @ @ = ur_being_parsed.reference_text = W; @@ -350,10 +350,10 @@ Here the grammar is very simple, and the object can't be a list. = ::= - ... when/while ... | ==> @ - something new | ==> { 0, - } - | ==> Wordings::first_wn(W) - ... ==> @ + ... when/while ... | ==> @ + something new | ==> { 0, - } + | ==> { Wordings::first_wn(W), - } + ... ==> @ @ = *X = -1; @@ -375,18 +375,18 @@ to or described can be of any kind, but in fact we restrict to kinds of object. = ::= - when/while ... | ==> { 2, RP[1] }; <> = R[1] - ==> { 1, RP[1] }; <> = R[1] + when/while ... | ==> { 2, RP[1], <> = R[1] } + ==> { 1, RP[1], <> = R[1] } ::= - referring to | ==> { 1, RP[1] } + referring to | ==> { 1, RP[1] } describing | ==> { 2, RP[1] } ... ==> @ ::= - | ==> @ - | ==> 0; *XP = Instances::as_subject(RP[1]); - ... ==> @ + | ==> @ + | ==> { 0, Instances::as_subject(RP[1]) } + ... ==> @ @ = kind *K = RP[1]; diff --git a/inform7/multimedia-module/Chapter 2/External Files.w b/inform7/multimedia-module/Chapter 2/External Files.w index 258368cf3..5d2a83d6d 100644 --- a/inform7/multimedia-module/Chapter 2/External Files.w +++ b/inform7/multimedia-module/Chapter 2/External Files.w @@ -76,19 +76,19 @@ Here is the subject: = ::= - | ==> { pass 2 } - text | ==> FALSE; <> = R[1] - binary | ==> TRUE; <> = R[1] - ==> FALSE; <> = R[1] + | ==> { pass 2 } + text | ==> { FALSE, -, <> = R[1] } + binary | ==> { TRUE, -, <> = R[1] } + ==> { FALSE, -, <> = R[1] } ::= - {file ...} ( owned by ) | ==> { pass 1 } - {file ...} ==> { NOT_APPLICABLE, - } + {file ...} ( owned by ) | ==> { pass 1 } + {file ...} ==> { NOT_APPLICABLE, - } ::= - another project | ==> { FALSE, - } - project {} | ==> { TRUE, - } - ... ==> @ + another project | ==> { FALSE, - } + project {} | ==> { TRUE, - } + ... ==> @ @ = *X = NOT_APPLICABLE; @@ -110,8 +110,8 @@ letters or digits, with the first being a letter. = ::= - | ==> { pass 1 } - ... ==> @ + | ==> { pass 1 } + ... ==> @ @ = *X = -1; @@ -123,11 +123,11 @@ letters or digits, with the first being a letter. = ::= - | ==> { pass 2 } - ==> { pass 1 } + | ==> { pass 2 } + ==> { pass 1 } ::= - called ==> { TRUE, RP[1] } + called ==> { TRUE, RP[1] } @ = int PL::Files::new_file_SMF(int task, parse_node *V, wording *NPs) { diff --git a/inform7/multimedia-module/Chapter 2/Figures.w b/inform7/multimedia-module/Chapter 2/Figures.w index 4e2bb6043..27f6b092d 100644 --- a/inform7/multimedia-module/Chapter 2/Figures.w +++ b/inform7/multimedia-module/Chapter 2/Figures.w @@ -109,13 +109,13 @@ int PL::Figures::new_figure_SMF(int task, parse_node *V, wording *NPs) { @ = ::= - ( ) | ==> R[1]; <> = R[2]; - ==> { pass 1 } + ( ) | ==> { R[1], -, <> = R[2] } + ==> { pass 1 } ::= - of cover art | ==> { -1, - } - | ==> { pass 1 } - ... ==> @; + of cover art | ==> { -1, - } + | ==> { pass 1 } + ... ==> @; @ = StandardProblems::sentence_problem(Task::syntax_tree(), _p_(PM_PictureNotTextual), diff --git a/inform7/multimedia-module/Chapter 2/Sound Effects.w b/inform7/multimedia-module/Chapter 2/Sound Effects.w index b560835d7..c86be984d 100644 --- a/inform7/multimedia-module/Chapter 2/Sound Effects.w +++ b/inform7/multimedia-module/Chapter 2/Sound Effects.w @@ -103,7 +103,7 @@ int PL::Sounds::new_sound_SMF(int task, parse_node *V, wording *NPs) { = ::= - ( ) | ==> R[1]; <> = R[2]; + ( ) | ==> { R[1], -, <> = R[2] } ==> { pass 1 } ::=