From 35c3c337689ee792b9f708c5d3ace5d133736cf1 Mon Sep 17 00:00:00 2001 From: Jason Self Date: Sun, 2 Jun 2019 09:31:43 -0700 Subject: [PATCH] Add Verbs and Actions --- informqr/informqr.md | 59 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/informqr/informqr.md b/informqr/informqr.md index 40a9fad..490805c 100644 --- a/informqr/informqr.md +++ b/informqr/informqr.md @@ -520,4 +520,61 @@ To assign to one of 32 'low string' variables: string N "string"; Lowstring string_var "string"; - string N string_var; \ No newline at end of file + string N string_var; + +Verbs and Actions +----------------- + +To specify a new verb: + + Verb 'verb ' 'verb ' ... 'verb ' + * token token ... token -> action + * token token ... token -> action + ... + * token token ... token -> action; + +where instead "`Verb`" can be "`Verb meta`", "*action*" can be +"`action reverse`"; *tokens* are optional and each is one of: + + ----------------- ---------------------------------------------- + 'word' that literal word + 'w1'/'w2'/... any one of those literal words + attribute an object with that attribute + creature an object with `animate` attribute + held an object held by the player + noun an object in scope + noun=`routine` an object for which *routine* returns `true` + scope=`routine` an object in this re-definition of scope + multiheld one or more objects held by the player + multi one or more objects in scope + multiexcept as multi, omitting the specified object + multiinside as multi, omitting those in specified object + topic any text + number any number + routine a general parsing routine + ----------------- ---------------------------------------------- + +To add synonyms to an existing verb: + + Verb 'verb ' 'verb ' ... = 'existing_verb'; + +To modify an existing verb: + + Extend 'existing_verb ' last + * token token ... token –> action + * token token ... token –> action + ... + * token token ... token –> action ; + +where instead "`Extend`" can be "`Extend only`" and "`last`" can be +omitted, or changed to "`first`" or "`replace`" + +To explicitly trigger a defined action (both *noun* and *second* are +optional, depending on the action): + + ; + +To explicitly trigger a defined action, then return `true` from the +current routine: + + <>; \ No newline at end of file -- 2.31.1