MOO-cows Mailing List Archive
[Prev][Next][Index][Thread]
Match problems...
-
Date: Thu, 18 Jan 1996 20:21:03 PST
-
From: Kipp the Kidd <mcmudge@mailbox.syr.edu>
-
Content-Type: TEXT/PLAIN; charset=US-ASCII
I made a verb called 'egrepchange' which would change things in verbs
using regular expressions... Because things in my MOO can be invisible,
each object has to decide if it can see %t or not, so some other
pronoun_sub isn't acceptable... Now everything uses a 'notifyf' verb,
that does the specialized substitutions. I wanted to change all refs to
$you:say_action to player.location:announce_all... But I wanted to make
sure that ones with the fourth argument as 'where' didn't interfere, so I
excluded $you:say_action calls that contain commas, I would do theese
manualy. So, here's what I typed:
egrepchange ^%$you:say_action(%([^,]*%));$/player.location:announce_all(%1);
It searched the core and did the changes in about 30 seconds. No problems.
Then I realized, that verbs can have spaces before their expressions, so
I added a ' *' to the beginning:
egrepchange ^ *%$you:say_action(%([^,]*%));$/
player.location:announce_all(%1);
But THIS time, it took 5 minutes to grep the core... Nobody is compiling
on the machine, nobody is even logged in, except me... Is this a speed
bug in match?
Second... I am not very sure about this, but, looking at .db files, I
see that many of the expressions have spaces in them, for example:
foo:bar(a, b, c, d);
...Wouldn't it save some space, if the spaces were excluded;
foo:bar(a,b,c,d);
...I believe once when editing a .db file, I forgot to enter the spaces,
and it parsed OK... How easy would this be to implement? Maybe even
make another option to verb_code() that does this?
- Kipp
Home |
Subject Index |
Thread Index