https://github.com/SiENcE/yarnparser/
It fully supports the current Yarn Spinner syntax. Additionally, I reverse-engineered the eBNF since there was no official one available (which is unfortunate).
Features
- Parses Yarn scripts into structured node objects
- Groups related content (like choices and their responses)
- Can locate dialogue lines preceding choice groups
Supports:
- Dialogue lines
- Choices (including nested choices)
- Conditional statements (if/else)
- Variable assignments, declarations, and interpolation
- Commands (jump, set, declare, etc.)
- Comments (both single-line and multi-line)
Previously, there was only this outdated parser, which is no longer compatible with the current yarn syntax.
Pull requests are welcome.