Skip to content

Migration to Yarnspinner 2.5.0#275

Draft
Galdormin wants to merge 6 commits intoYarnSpinnerTool:mainfrom
Galdormin:migration_2.5
Draft

Migration to Yarnspinner 2.5.0#275
Galdormin wants to merge 6 commits intoYarnSpinnerTool:mainfrom
Galdormin:migration_2.5

Conversation

@Galdormin
Copy link
Contributor

@Galdormin Galdormin commented Feb 3, 2026

As there are a lot of changes and I'm not familiar with the non-bevy crates, I'll start the migration to the last v2 supported version.

Git diff: YarnSpinnerTool/YarnSpinner@da39c71...v2.5.0

I've looked at the git diff, and this is the files with changes (except doc changes) among the Compiler and Runtime. LanguageServer and tests were ignored.

Compiler

  • YarnSpinner.Compiler/Compiler.cs
  • YarnSpinner.Compiler/Declaration.cs
  • YarnSpinner.Compiler/DeclarationVisitor.cs
  • YarnSpinner.Compiler/Project.cs
  • YarnSpinner.Compiler/StringTableManager.cs
  • YarnSpinner.Compiler/Utility.cs
  • (Unsure) YarnSpinner.Compiler/YarnSpinnerLexer.cs => Autogenerated
  • (Unsure) YarnSpinner.Compiler/YarnSpinnerLexer.g4

Runtime

  • (Unsure) YarnSpinner/AssemblyInfo.cs
  • YarnSpinner/Dialogue.cs
  • YarnSpinner/Library.cs
  • YarnSpinner/Program.cs
  • YarnSpinner/VirtualMachine.cs
  • YarnSpinner/YarnSpinner.Markup/LineParser.cs
  • YarnSpinner/YarnSpinner.Markup/MarkupParseResult.cs

Test

  • YarnSpinner.Tests/ErrorHandlingTests.cs
  • YarnSpinner.Tests/ProjectFileTests.cs
  • YarnSpinner.Tests/ProjectTests.cs
  • YarnSpinner.Tests/TagTests.cs
  • YarnSpinner.Tests/TestBase.cs
  • YarnSpinner.Tests/TestPlan.cs
  • YarnSpinner.Tests/TypeTests.cs => test for validate_unique_inferred_variable (removed in 3.0)

- YarnSpinner.Compiler/Declaration.cs
- YarnSpinner.Compiler/DeclarationVisitor.cs
- YarnSpinner.Compiler/StringTableManager.cs
- YarnSpinner.Compiler/Utility.cs
- validate_unique_inferred_variable seems to break the tests and was removed in the 3.0
- YarnSpinner.Tests/ErrorHandlingTests.cs
- YarnSpinner.Tests/ProjectTests.cs
- YarnSpinner.Tests/TagTests.cs
@Galdormin
Copy link
Contributor Author

@janhohenheim I need help here.

In here, they used 2 fields to store callbacks. I don't think I can do that using a closure in rust, especially because they need a mutable reference of the dialogue.

https://github.com/YarnSpinnerTool/YarnSpinner/blob/838761ad55d8d08be3b46e6f2bea2d017208e445/YarnSpinner.Tests/TestPlan.cs#L205C1-L210C41

https://github.com/YarnSpinnerTool/YarnSpinner/blob/838761ad55d8d08be3b46e6f2bea2d017208e445/YarnSpinner.Tests/TestBase.cs#L216C13-L245C15

I had considered storing all the set variables and allowing a TestPlan function to be called by providing an FnOnce closure. That should work, but I’m not sure if you have any better ideas?

@janhohenheim
Copy link
Collaborator

I'll check when the jam is over in 2 days :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants