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
Zhiroc
Adept


Joined: 04 Feb 2005
Posts: 246

PostPosted: Wed Aug 15, 2007 5:59 am   

Weird behavior with multiple reparse trigger states
 
Try the following:
Code:
#REGEX {(say)} {#COLOR white
#PCOL red %x1
#WIN debug {saw says}}
#COND {".*?"} {#CW cyan,hi
#WIN debug {saw quotes}} {regex|reparse}
#COND {\b(xxx|yyy)\b} {#CW magenta,hi
#WIN debug {saw bracketed %x1}} {regex|reparse}

#SH Todd says ~"Bar~"

What you'll see in the debug window is:
Code:
saw says
saw quotes
saw bracketed 5

And then it will fail to fire again if you #SHOW again.

So, why does it stop firing, and more importantly, why does it match (xxx|yyy) in state 2?
Reply with quote
Tech
GURU


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

PostPosted: Wed Aug 15, 2007 8:02 am   
 
Confirmed. The trigger continues to fire for me in a blank session, so that must be something else in your scripts.

But I do see the behavior you describing and that looks like a bug. State two shouldn't be getting matched.
_________________
Asati di tempari!
Reply with quote
Zugg
MASTER


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

PostPosted: Wed Aug 15, 2007 6:03 pm   
 
Since I have recently been deep inside the multistate trigger code, I decided to take a quick look into this. Wow, this was a really obscure problem!

In CMUD, the #CW command needs to match multiple words on a line. So #CW needs to fire the trigger multiple times on the same line to determine what to color. In the case of a ReParse trigger state, the state of the trigger had moved to the next state (the xxx|yyy state), and when #CW in the .*? state called the trigger again to look for more matching text to color, the trigger was in a new state, which was actually causing the state to become corrupted with the wrong regex data. And once the compiled regex cache was messed up for the trigger, none of the states would work correctly.

So, this should be fixed in v2.0, and this bug could have caused weird side effects in any multistate trigger that also used the #CW command. Thanks for reporting it!
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