v2.2.0
This is the compiler for Yarn Spinner. If you want to use Yarn Spinner in a Unity game, please see the releases page for Yarn Spinner for Unity!
Yarn Spinner is made possible by your generous patronage. Please consider supporting Yarn Spinner's development by becoming a patron!
Added
- Added
DeclarationBuilder
andFunctionTypeBuilder
classes. These classes allow external libraries to construct newDeclaration
andFunctionType
objects, without having to have access to the internal setters. CompilationResult.DebugInfo
now provides per-instruction positional debug information.- This allows users of the
Compiler
class to access positional information for each instruction, which is an important first step for source-level debugging.
- This allows users of the
- Made
Diagnostic
andDeclaration
serializable, for easier communication with language servers and other utilities. - The compiler now does a last-line-before-options tagging pass.
- This will add a
#lastline
tag onto any dialogue line that immediately precedes a block of options. - This is intended to used by other parts of the game to modify dialogue view behaviours.
- This will add a
Changed
Declaration
andDiagnostic
now provide position information via aRange
object, which specifies the start and end position of the relevant parts of the document.- Fixed an issue where attempting to access the value of a variable with insufficient context to figure out its type would crash the compiler. (This could happen when you used a variable in a line, like
Variable: {$myVar}
with no other uses of$myVar
.) - Fixed an issue where an option condition with no expression (for example:
-> Option one <<if>>
) would crash the compiler. - The compiler will no longer attempt to generate code if the Yarn script contains errors. (Previously, it was generating code, and then discarding it, but this allows for potential errors and crashes if code-generation is attempted on an invalid parse tree.)
- Typechecker now does partial backwards type inference, allowing for functions and variables to inform the type of the other regardless of them being the l- or r-value in an expression.