dMZX Forums: Ambiguous parse in interpolation syntax -> Archived MegaZeux Bugs -> Tracker

Jump to content

Report ID 866 Title Ambiguous parse in interpolation syntax
Product Archived MegaZeux Bugs Status Fixed (Severity 2 - Fair)
Version GIT (debytecode) Fixed in 2.93d
Introduced In Version GIT (debytecode)Operating System All platforms

Page 1 of 1
  • Cannot start a new Issue
  • Closed Issue This issue is locked

Report ID #866: Ambiguous parse in interpolation syntax

#1 User is offline  
Lachesis 

  • the pinnacle of human emotion
  • Group: DigiStaff
  • Posts: 3,949
  • Joined: 17-July 04
  • Gender:Female
  • Location:Sealand

Posted 08 September 2024 - 05:58 AM

As of GIT ffc10416 all string and counter interpolation is handled by the <> interpolation syntax. While this also has limited support for expressions e.g. "<a + b>", unfortunately, I wasn't able to fully merge expression interpolation into this syntax. This is because certain expressions create an ambiguous parse in the compiler and interpreter:

// this works how you would expect
* "(a >> b)"

// this doesn't work"
* "<a >> b>"


I think unfortunately the solution to unifying all interpolation is to replace the <> brackets with {} curly braces.

// this would work correctly
* "{a >> b}"


Since interpolation must always be bounded within a string literal or a backtick-wrapped identifier/label, this should not interfere with the usage of {} for code blocks. There is also some precedent for {} interpolation syntax in C++'s std::format and in Python.
"Let's just say I'm a GOOD hacker, AND virus maker. I'm sure you wouldn't like to pay for another PC would you?"

xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository


Page 1 of 1  
  • Cannot start a new Issue
  • Closed Issue This issue is locked

Replies (1 - 3)

#2 User is offline  
Lachesis 

  • the pinnacle of human emotion
  • Group: DigiStaff
  • Posts: 3,949
  • Joined: 17-July 04
  • Gender:Female
  • Location:Sealand

Posted 21 May 2025 - 07:27 AM

Another problem that needs to be resolved:

* "('$string')"

and

* "&$string&"

both would get translated to

* "{$string}"

so single identifier expressions with a string or ambiguous identifier need to be wrapped in () or .int() needs to be added to the syntax to fully fix this.
"Let's just say I'm a GOOD hacker, AND virus maker. I'm sure you wouldn't like to pay for another PC would you?"

xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository

#3 User is offline  
Lachesis 

  • the pinnacle of human emotion
  • Group: DigiStaff
  • Posts: 3,949
  • Joined: 17-July 04
  • Gender:Female
  • Location:Sealand

Posted 06 June 2025 - 03:22 AM

Updating status to: Fixed
Issue fixed in: 2.93d

Fixed in GIT dd070068, using the () wrapping solution for ('$string') conversion for now.
"Let's just say I'm a GOOD hacker, AND virus maker. I'm sure you wouldn't like to pay for another PC would you?"

xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository

#4 User is offline  
Lachesis 

  • the pinnacle of human emotion
  • Group: DigiStaff
  • Posts: 3,949
  • Joined: 17-July 04
  • Gender:Female
  • Location:Sealand

Posted 12 June 2025 - 10:09 AM

Moving to: Archived MegaZeux Bugs


Page 1 of 1
  • Cannot start a new Issue
  • Closed Issue This issue is locked

1 User(s) are reading this issue
1 Guests and 0 Anonymous Users


Powered by IP.Tracker 1.3.2 © 2025  IPS, Inc.