YarnSpinnerTool / YarnSpinner

Yarn Spinner is a tool for building interactive dialogue in games!
https://yarnspinner.dev
MIT License
2.3k stars 201 forks source link

Unexpected "[" while reading a shortcut option statement #377

Closed andresmakesgames closed 10 months ago

andresmakesgames commented 10 months ago

This is a repost of the ticket I wrote in the VSCodeExtension repo. https://github.com/YarnSpinnerTool/VSCodeExtension/issues/46

I dug into the code to try to understand what was happening myself and found parsing happens entirely in the LanguageServer, so this error would best be reported here.

What is the current behavior?

I have dialogue options in my Yarn file that follow the expected escape pattern for special characters, e.g. "->[Wisdom] Say something wise." Parsing the Yarn file using the VS Code Extension appears to work and render the graph correctly, and the Yarn file runs correctly through my tests, but VS Code shows the following parse errors file in my Problems view: Unexpected "[" while reading a shortcut option statement

My understanding is that the syntax below is allowed, but perhaps I'm mistaken. 2.0 has changed a few things and not all Yarn parsers have kept apace of all changes in the main repo. Is this behavior no longer accepted?

Please provide the steps to reproduce, and if possible a minimal demo of the problem:

This is the minimum yarn file I need in order to reproduce:

title: Node
position: 113,134
---
->\[Wisdom\] Say something wise.
===

What is the expected behavior?

As this is documented as the correct way to escape special characters, I would expect this to parse correctly.

Please tell us about your environment:

Yarn Spinner VS Code Extension, prerelease v2.2.135 VS Code Insiders 1.84.0 MacOS Sonoma (14.0)

Other information

N/A

McJones commented 10 months ago

can confirm the bug is happening here also