How remieven/ysgo works
Main Components
a) Core Components:
• Dialogue Runner (runner.go)
• Parser System (internal/parser)
• Evaluator (evaluator.go)
• Variable Storage System (variable/)
• Command System (command_storer.go)
• Function System (function_storer.go)
b) Supporting Components:
• Markup System (markup/)
• Expression Tree (internal/tree)
• Container Utilities (internal/container)
Component Relationships
[Input: Yarn Script] → [Parser System]
• ↓
[Variable Storage] ← [Dialogue Runner] → [Command System]
• ↑ ↓ ↑ ↑
• → [Evaluator] ←──────────┘
• ↑
• [Function System]
[Markup System] ←──→ [Dialogue Runner]
Detailed Component Descriptions
a) Parser System (Blue):
• Shows the flow from YarnSpinner syntax to parsed AST
• Lexer and parser components
• To the expression tree builder
b) Dialogue Runner (Green):
• Central component coordinating all operations
• Shows connections to all major subsystems
• Handles dialogue flow control
c) Storage Systems (Yellow):
• Variable Storage for maintaining state
• Command Storage for registered commands
• Function Storage for available functions
d) Evaluator (Orange):
• Shows expression evaluation flow
• Connects to variable and function systems
Implementation Details
• "pull" mode architecture
• Runtime parsing approach (vs compilation)
• Test plan integration points
• Extension points for custom commands and functions
Notes Section
A notes section mentioning:
• Runtime vs compile-time behavior
• Missing YarnSpinner features (localization, type checking)
• Integration capabilities with game engines
• Test coverage and validation points