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
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5187

PostPosted: Mon Dec 03, 2007 1:34 pm   

[2.14] Parsing error not detected with parameters of type VarName
 
This affects both the command line and compiler for scripts.

1. Launch CMud
2. Close Sessions window (ESC)
3. Enter at the command line
Code:
$var="a|b|c";#CALL %vartype($var};#SHOW got here;#IF ($var) {#SHOW yes $var} {#SHOW failed $var}

You will notice that the 'got here' never gets displayed. This is because of the mismatched parenthesis on %vartype($var}.
4. Open the Package Editor (CTRL-G)
5. Make a new alias, and paste the above command into it script
6. Click save changes, then look at the compiled tab
Code:
0000   LITERAL   "a|b|c"
0016   ASSIGNLOCAL   -1   0
0028   PUSHEXP   0044
0036   JUMP   0084
0044   STR   ''
0052   ASSIGNLOCAL   -1   0
0064   INT   1
0072   FUNCREF   vartype   (1)
0084   PUSHSTRLOC   0100
0092   JUMP   0136
0100   STR   '#SHOW yes '
0120   LOCAL   0   0
0132   CONCAT   
0136   PUSHSTRLOC   0152
0144   JUMP   0192
0152   STR   '#SHOW failed '
0176   LOCAL   0   0
0188   CONCAT   
0192   CMD   call   (3)
This shows that the closing parenthesis of the #IF was used to close the %vartype function. I guess what I am looking for is that it gives a parsing error if there are invalid characters in the VarName parameter, which actually would end up pointing at the brace typo.

The only other function that looks to be affected by this is %pop
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Zugg
MASTER


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

PostPosted: Mon Dec 03, 2007 6:30 pm   
 
I'll add this to the bug list and see what I can do. It it's easy and doesn't appear to have other side effects, then I might be able to fix it for the public version.
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