hankinsoft / MudClient

MudClient
3 stars 0 forks source link

[Bug] Switch statements in JavaScript #10

Closed dak closed 1 year ago

dak commented 1 year ago

JavaScript implementation appears to only be a partial implementation, and is missing basic features like switch statements.

hankinsoft commented 1 year ago

Just want to verify I believe switch should work as I'm using macOS built-in javascript execution, but the keyword itself is not highlighting. Is that what you mean, or are you finding the switch statement does not successfully execute?

(Syntax highlight is self-built, but the javascript execution is macOS with a few added-in methods, so all basic javascript logic should work out of box).

dak commented 1 year ago

I was getting an error thrown in-game when a trigger ran that had a switch statement. I believe it was complaining about a : in the case. I'll triple check I didn't just have invalid syntax tonight.

dak commented 1 year ago

The error was actually with how I misunderstand how the interpolation of a matching regex was occurring. I was assuming it was coming in as a string, rather than directly injected into the script. User error.