Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
Seb
Wizard


Joined: 14 Aug 2004
Posts: 1269

PostPosted: Sun Nov 26, 2006 12:54 am   

[1.16] Compile problems with comma within parentheses
 
#echo Some text (more text, yet more text)
and
#show Some text (more text, yet more text)
and
#say Some text (more text, yet more text)

does not compile with:
Error compiling script:
unmatched parenthesis

If you change the scripts by adding braces around the whole line ecluding the command, e.g. to:
#echo {Some text (more text, yet more text)}
it does compile.

If I take out the comma these scripts compile.

In zMUD it was not necessary to put braces {} around echoes. In the version of zMUD that I learnt on, the example in the help file for #ECHO didn't even have braces. The examples in the help file for #SHOW and #SAY do not have braces either even in the current zMUD help file.

Can I suggest some changes to the *.MUD import process? I can't see any reason NOT to change any script line beginning with #ECHO, #SAY, #SHOW, and possibly #SUB, by adding braces {} around the argument to the command. For all of these except #SUB, it is very easy to do since the commands only take one argument, you just need to add { at the beginning of the argument and } at the end. I could do it with a regular expression search and replace in TextPad, but that would only benefit myself and not other CMUD users...
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Sun Nov 26, 2006 5:09 am   
 
I haven't tried but I'm guessing the issue is that by using the ( ), CMUD is trying to interpret "text" as a function and the comma is telling it to parse the parameters.
_________________
Asati di tempari!
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sun Nov 26, 2006 8:12 am   
 
Zugg seemed to imply earlier (though it's not explicitly stated anywhere) that CMUD is more unforgiving when it comes to leaving out {} for command arguments by design and that some things really won't work unless you use them. It's also possible that () is trying to perform expression evaluation, or something else too - it's hard to tell because the checker is giving the wrong errors at the moment.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
The Raven
Magician


Joined: 13 Oct 2000
Posts: 463

PostPosted: Mon Nov 27, 2006 9:20 pm   
 
There will be commands that worked in zMud, but will not work in CMUD, because the parser is more strict. That said, I think this may be a bug, because #ECHO, #SHOW, and #SAY only take one argument so they don't need to be as rigorous in checking their inputs for separate tokens. Have you tried commenting out the parenthesis with the ~?

#SHOW Some ~(Text, with~) parenthesis.

That works for me. The () are special characters now, unlike before, and that means that even in places where zMud would ignore special characters, CMUD almost always pays attention to them and tries to process them. So quoting them, or putting the whole thing in {} is now necessary.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon Nov 27, 2006 10:10 pm   
 
I'm also still trying to come up with a way to allow parenthesis, since they are pretty common on MUD command lines.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net