Strange bug involving commas

I had a strange bug happen with a TADS game. I typed this by accident:

,l

Live footage showing how this bug happened

The fingers you have used to dial are too fat. To obtain a special dialing wand please mash the keypad with your palm... now." : r/TheSimpsons

Anyway, the game threw an error about accessing properties of nothing or no one and crashed.

I thought it was just that game, but I opened up another game (Jim Nelson’s IFComp game) and tried the same thing. It threw the same error, but didn’t crash due to some fancy code Mr. Nelson had.

Someone on discord suggested this was due to the game thinking you were addressing a non-existent person, but also suggested I post this here so others are aware of it.

8 Likes

confirm the bug on a3Lite, but seems absent in adv3.

Best regards from Italy,
dott. Piergiorgio.

4 Likes

Sounds like a parser bug in adv3Lite. I can take a look, but @Eric_Eve will probably have an easier time of it.

This is something I’ve been toying with to see if it holds up. So far, it’s been helpful. If it survives the comp, I’ll package it up and see if anyone else wants to use it.

4 Likes

Does it ever make sense to begin a command line with punctuation? On the assumption that it doesn’t the easiest fix is probably to add a StringPreParser that strips it out. A quick test suggests the following does the job.

InitialPunctPreparser:StringPreParser
    doParsing(str, which)
    {
        return str.findReplace(R'^<Punct>+', '');        
    }    
;

If that seems to work for everyone, I’ll add it to the library.

5 Likes

adv3 catches this kind of input with a message similar to “You seem to have left out some words…”
There is a simpleNounPhrase(empty) grammar (with badness 600) whose resolveNouns calls emptyNounPhrase on the ResolveResults object, which throws a ParseFailureException leading to the above message…

2 Likes