directive: be consistent about arg vs param

This commit is contained in:
Branden J Brown 2024-10-12 08:13:33 -04:00
parent e72763c418
commit 9b880a2b8f
2 changed files with 18 additions and 21 deletions

View File

@ -65,19 +65,19 @@
"name": "set static text", "name": "set static text",
"doc": "Set the current page's text.\nNormally not used directly; script speech lines call this directive implicitly.", "doc": "Set the current page's text.\nNormally not used directly; script speech lines call this directive implicitly.",
"prefix": "set static text", "prefix": "set static text",
"prefix_arg": "speech" "prefix_param": "speech"
}, },
{ {
"name": "set static speaker", "name": "set static speaker",
"doc": "Set the current page's speaker.\nNormally not used directly; script speech lines call this directive implicitly.", "doc": "Set the current page's speaker.\nNormally not used directly; script speech lines call this directive implicitly.",
"prefix": "set static speaker", "prefix": "set static speaker",
"prefix_arg": "character" "prefix_param": "character"
}, },
{ {
"name": "characters", "name": "characters",
"doc": "Set the names of characters in the current scene.", "doc": "Set the names of characters in the current scene.",
"prefix": "characters", "prefix": "characters",
"list_arg": "text" "list_param": "text"
}, },
{ {
"name": "scene", "name": "scene",
@ -88,27 +88,27 @@
"name": "background", "name": "background",
"doc": "Set the background image.", "doc": "Set the background image.",
"prefix": "background", "prefix": "background",
"prefix_arg": "background" "prefix_param": "background"
}, },
{ {
"name": "enter _ stage _", "name": "enter _ stage _",
"doc": "Bring a character onto the stage at a given position.", "doc": "Bring a character onto the stage at a given position.",
"prefix": "enter", "prefix": "enter",
"prefix_arg": "character", "prefix_param": "character",
"infix": "stage", "suffix": "stage",
"infix_arg": "stage position" "suffix_param": "stage position"
}, },
{ {
"name": "enter _", "name": "enter _",
"doc": "Bring a character onto the stage at a default position.", "doc": "Bring a character onto the stage at a default position.",
"prefix": "enter", "prefix": "enter",
"prefix_arg": "character" "prefix_param": "character"
}, },
{ {
"name": "exit _", "name": "exit _",
"doc": "Remove a character from the stage.", "doc": "Remove a character from the stage.",
"prefix": "exit", "prefix": "exit",
"prefix_arg": "character" "prefix_param": "character"
}, },
{ {
"name": "exeunt", "name": "exeunt",

View File

@ -8,24 +8,21 @@ pub struct Directive {
doc: String, doc: String,
/// Fixed prefix term. /// Fixed prefix term.
prefix: String, prefix: String,
/// The type of the prefix argument, if there is one. /// The type of the prefix parameter, if there is one.
prefix_arg: Option<Param>, prefix_param: Option<Param>,
/// Fixed infix term. /// Fixed infix term.
/// Can only be present if the prefix argument exists. /// Can only be present if the prefix parameter exists.
infix: Option<String>, infix: Option<String>,
/// The type of the infix argument. /// The type of the infix parameter.
/// Can only be present if the infix term exists. /// Can only be present if the infix term exists.
infix_arg: Option<Param>, infix_param: Option<Param>,
/// Fixed suffix term. /// Fixed suffix term.
/// Can only be present if the infix argument exists.
/// Note that this implies directives which have two terms have a prefix
/// and an infix, not a prefix and a suffix.
suffix: Option<String>, suffix: Option<String>,
/// The type of the suffix argument. /// The type of the suffix parameter.
/// Can only be present if the suffix exists. /// Can only be present if the suffix exists.
suffix_arg: Option<Param>, suffix_param: Option<Param>,
/// The type of the elements of the list argument, if supported. /// The type of the elements of the list parameter, if supported.
list_arg: Option<Param>, list_param: Option<Param>,
// TODO(zeph): macro expansion? // TODO(zeph): macro expansion?
} }