This is tricky... getting a double period as a literal

I’m implementing a command line (like DOS, or Linux) in a game, and while I have most of my commands working perfectly, one is becoming a problem:

cd ..

The parser automatically strips the double period out, treating it like punctuation. getLiteral returns nil, and getOrigText only says ‘cd’, not ‘cd …’ - which doesn’t help. I tried tracing it in the actual code (input.t, actor.t), but lost it somewhere in actor.t…
While I’m quite willing to replace or modify code, I’d much rather just get my original string, and the get* variables hint that it’s possible… without actually making it possible (as far as I know).

So, is there some magic bullet out there that let’s me get the original text, as it was typed?

One way to deal with this is to use a StringPreParser to wrap whatever follows a command beginning with CD in double qoutes, so it’s all treated as one string literal and not parsed any further:

    doParsing(str, which)
        if(str.startsWith('cd '))
            str = str.substr(1 ,3) + '"' + str.substr(4) + '"';
        return str;            

I tested this with the following very basic code for a CD command, and it seemed to work:


    'cd' singleLiteral
    : CDAction

– Eric

Aha! Nice! I was about halfway there, but I couldn’t quite figure out what to modify… thanks!
I must say, going from TADS 2 to TADS 3… there’s a lot more nice stuff, but trying to hack in your own weird ideas gets a bit harder. Heh.