- Deprecate
start
method inStory
- Stabilize public API
- Add User Guide using
mdbook
- Add support for CONST variables
- Add shuffle sequences with
rand
(with enabled featurerandom
) - Return
Option
instead ofResult
for getter methods inStory
- Add
to_string
methods forVariable
- Breaking change:
start
does not begin the text processing. Instead, useresume
afterstart
has been called. - Breaking change:
resume_with_choice
has been removed and replaced with the pair ofmake_choice
andresume
methods.
- Mathematical expressions are in.
{a + 3 * (b + c)}
in a line will evaluate to the expected value for variablesa
,b
, andc
. - Strings can be concatenated using an expression with the add operator:
"str" + "ing" == "string"
.
This release focuses on improving errors from parsing the story. Two main improvements are that parsing doesn't stop after encountering an error, but collects any it finds in a single pass before returning them all as a set. This may not catch all errors but should be an improvement over the previous version. Second is that line numbers can be accessed for all parsing and validation errors. The new helper function print_read_error
prints these line numbers alongside the error.
- Breaking change: error module restructured with no private structs.
- Errors are now yielded if global variables, knots or stitches within one knot have duplicate names.
- Lines, knots, stitches and choices have line indices associated with them to help with tracking down errors.
- Parsing a story now returns all encountered parsing errors at once (if any), instead of just the first. This happens before validation, which is a separate step.
- All validation errors are returned as a set instead of individually.
- Add
print_read_error
function to describe all encountered parsing errors with line numbers. - Fix bug where location and variable addresses were not validated in choice lines.
This release focuses on validating the content of a story after successfully parsing it.
- Name space collisions are searched for in the validation step after parsing a story. Stitches can no longer have the same name as knots or variables, nor can variables have the same name as knots.
- Conditions and expressions are checked in the validation step after parsing a story. If they contain invalid variables they will yield errors.
- Conditions can now use expressions on either side of a comparison:
a + 2 > b * c - 1
, and so on. - Fix bug where additional conditions in choices were not added to the condition:
* {condition and other_condition}
became just* {condition}
. - Fix bug where addresses were not validated inside the
else
content of conditions.
- Support for threading by Matthew Woelk (pull request #1)
- Relicensed under Parity 7.0 and Apache 2.0
- Resume stories with index of instead of reference to choice from the previous result.
- Remove debugging output from used functions.
- Validate knot and stitch addresses after parsing a story.
- Allow fallback choices with output text (
* [] Text content
). - Fix bug where glue was not respected over fallback choices.
- Fix bug where fallback choices were not made from the knot or stitch they were found in, leading to inconsistent behavior and runtime errors.
- Add
move_to
andresume
methods forStory
. These are used to respectively move the story to a different knot and resume from there. - Line conditionals are implemented.
- Conditions can be nested with parenthesis and
and
/or
connections.
- Add reading of tags for knots. Get them with the
get_knot_tags
method forStory
. - Fix bug where
serde_support
could not be activated sinceFollowData
did not derive the traits.
- Add
get_current_location
andget_num_visited
methods forStory
. The formers retrieves the knot and stitch name that the story is currently at. The latter the number of times a location has been visited so far in the story. - Add support for global variables in text. They cannot yet be used in conditions or modified in the Ink script itself, but they will be evaluated into text when encountered in the text flow.
- Add
get_variable
/set_variable
methods forStory
with which to inspect or modify global variables. - Parse global tags for the story. Can be retrieved with the
get_story_tags
method forStory
.
- Variables can now be used in conditions.
- Add
equal_to
,greater_than
andless_than
methods forVariable
.
- Add stitches to organize stories through.
- Reorganize the
InklingError
type to separate internal from external errors. External errors are front loaded and concern user or typing errors instead of the internal machinery that is not relevant to the user (except if they occur). - Add optional de/serialization of stories using
serde
. Enable with featureserde_support
.
- Correct naming of
serde_support
feature in README.md.
- Add support for fallback choices.
- Improved documentation.
- Maintenance work: node system replaced with something simpler, lines replaced with something more advanced but feature rich.
- Add alternatives in text and choice lines. Currently regular sequences, cycles and once-only sequences are supported.