-
-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Golfing incorrectly escapes (s and )s #178
Comments
If you want to recreate this, you can attempt to use |
please can you give a minimal reproduction? thanks |
function(context,args){
args = args || {}
if (args.name == "testing"){
return #fs.scripts.quine()
}
} when hsm golf is run on it spits out function(t,$){
// ["name","testing","function(context,args){\n args = args || {}\n\tif (args.name == \"testing\"){\n return #fs.scripts.quine\()\n }\n}"]
let[e,s,i]=JSON.parse(#fs.scripts.quine().split` `[1])
if(($=$||{})[e]==s)return i} This, when run regardless of params, should cause the following error to appear |
ah, good catch |
I've added a fix. You can install the
If you then afterwards want to return to the latest proper release, run the same command again but replace |
I'm dealing with a big lack of sleep here while writing this, but much like #172 there's some seriously odd behavior that can emerge when golfing a script that contains
scripts.quine
in some form, as well as strings like "e)(ecutioner". This breaks the JSON parser for some reason.Basically, if (s or )s exist inside the cheated strings, don't escape them, as for some reason that makes them transcend the string itself and murders the parser. As soon as I removed the \s escaping the (s and )s within those strings, it stopped erroring.
The text was updated successfully, but these errors were encountered: