1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
//! Constant markers used when parsing `Ink` lines.
/************************
* Line content markers *
************************/
/// Marker for a non-sticky choice, which can only ever be followed once in the story.
pub const CHOICE_MARKER: char = '*';
/// Marker for a sticky choice, which can be followed multiple times in the story.
pub const STICKY_CHOICE_MARKER: char = '+';
/// Marker for a gather point.
pub const GATHER_MARKER: char = '-';
/// Marker for a divert to another knot, stitch or label in the story.
pub const DIVERT_MARKER: &'static str = "->";
/// Marker for glue which joins separate lines together without a newline character.
pub const GLUE_MARKER: &'static str = "<>";
/// Marker for a tag associated with a line in the story.
///
/// Multiple markers can be used in a single line. All text content between markers
/// (or the end of the line) will be a single tag.
pub const TAG_MARKER: char = '#';
/********************
* Sequence markers *
********************/
/// Marker for a cycle alternative sequence.
pub const CYCLE_MARKER: char = '&';
/// Marker for a once-only alternative sequence.
pub const ONCE_ONLY_MARKER: char = '!';
/// Marker for a shuffle alternative sequence.
pub const SHUFFLE_MARKER: char = '~';
/// Marker for sequence item separator.
pub const SEQUENCE_SEPARATOR: &'static str = "|";
/****************
* Knot markers *
****************/
/// Marker for a knot, the main divisor of story content.
pub const KNOT_MARKER: &'static str = "==";
/// Marker for a stitch belonging to a knot.
pub const STITCH_MARKER: &'static str = "=";
/************************
* Comment line markers *
************************/
/// Marker for line comments, which will be ignored when parsing a story.
pub const LINE_COMMENT_MARKER: &'static str = "//";
/// Marker for line comments which will print a reminder message when encountered.
pub const TODO_COMMENT_MARKER: &'static str = "TODO:";
/*****************************
* Default names for objects *
*****************************/
/// Default name for the root `Stitch` in a `Knot` and `Knot` in a `Story`.
///
/// Contains characters which are not allowed in addresses, so there can never be a conflict
/// with a name in the `Ink` story.
pub const ROOT_KNOT_NAME: &'static str = "$ROOT$";
/// Name of knot that marks that a branch of story content is done.
pub const DONE_KNOT: &'static str = "DONE";
/// Name of knot that marks that the story is finished.
pub const END_KNOT: &'static str = "END";
/**********************
* Meta data variable *
**********************/
/// Marker for constant variable.
pub const CONST_MARKER: &'static str = "CONST";
/// Marker for external function signature.
pub const EXTERNAL_FUNCTION_MARKER: &'static str = "EXTERNAL";
/// Marker for include of another file.
pub const INCLUDE_MARKER: &'static str = "INCLUDE";
/// Marker for global variable.
pub const VARIABLE_MARKER: &'static str = "VAR";
/// Names which cannot be used by variables, knots or stitches.
pub const RESERVED_KEYWORDS: & = &;