cyrusfirheir / twee3-language-tools

[ VSCode extension ] Syntax highlighting and programmatic language tools for Twee 3, and Twine 2 storyformats.
https://marketplace.visualstudio.com/items?itemName=cyrusfirheir.twee3-language-tools
MIT License
47 stars 15 forks source link

Extension incorrectly reports Nonexistent passage when using nested quotes #127

Closed BawdyInkSlinger closed 1 year ago

BawdyInkSlinger commented 1 year ago

image image

For testing purposes, I made a strange passage name:

:: Test Pagination "'Nested Buttons'" [pagination:5 demo]

Elsewhere, I have a macro refer to this passage:

<<act "Passage with less pages than current" "Test Pagination \"'Nested Buttons'\"">><</act>>

I get a warning on the second parameter saying: Nonexistent passage: "Test Pagination \"'Nested Buttons'\""sc2-ex(110)

I expected no warnings.

This is how the macro is defined in my config:

    act:
      name: act
      container: true
      parameters:
        - text |+ (passage|undefined) |+ text
greyelf commented 1 year ago

@BawdyInkSlinger My advice, don't create Passages with names like that! :)

Tranberry commented 1 year ago

@BawdyInkSlinger My advice, don't create Passages with names like that! :)

perhaps twee notation update incoming? 👺

tmedwards commented 1 year ago

perhaps twee notation update incoming? 👺

Assuming you mean the Twee specification, it has no issues with such passage names.

greyelf commented 1 year ago

@Tranberry

perhaps twee notation update incoming? 👺

a. The File Type section of the current (v3.0.2) version of the Twee 3 Specification recommends that the Twee file be UTF-8 based.

Which means that any Unicode character can be used inside such a file.

b. The Passage Header section of the specification explains what characters have special meaning within such a header, and that you need to escape those special characters if you want to include any of them within a Passage or Tag Name.

This section includes no restrictions about using any Unicode character within the Passage Header.

c. The Passage Name section recommended not using the special characters that make up the syntax of a "Markup based Link" as part of the Name of a Passage, but it doesn't forbit such usage.

So in theory you can use any Unicode character in a Passage Name, as long as you escape any of the characters that have specially meaning.

But to make things easier for yourself, and others, you might not want to go crazy with what characters you use in the Name of a Passage.... :)

Tranberry commented 1 year ago

sometimes limits just makes things better than no limits

BawdyInkSlinger commented 1 year ago

Perhaps this issue can be reopened? I think this fix causes warnings on new kinds of passage name's:

<<act "See what she does next." "\"A monster girl!\"-Intro-46">><</act>>

<<act "Drag her out of your home." "\"A monster girl!\"-Intro-46">><</act>>

<<act "Scream in terror." "\"A monster girl!\"-Intro-46">><</act>>

<<act "Skip Intro (Not recommended!)" "Tutorial" "act__button--metagame">><</act>>

:: \"A monster girl!\"-Intro-46 [nohud noinventory nojournal pagination:7 demo]

image

BawdyInkSlinger commented 1 year ago

But to make things easier for yourself, and others, you might not want to go crazy with what characters you use in the Name of a Passage.... :)

Yeah, I agree. For what it's worth, these passage names were generated with code. I have since modified that code to generate better passage names.