[211] in Coldmud discussion meeting

root meeting help first previous next next in chain last in chain last

match_template() needs help with consistancy

daemon@ATHENA.MIT.EDU (Thu Apr 28 00:12:22 1994 )

Date: Wed, 27 Apr 1994 21:17:18 -0600 (MDT)
From: the Lyncx <BRANDON@cc.usu.edu>
To: coldstuff@MIT.EDU
X-Vms-To: COLDSTUFF

Ayup.  Basically, in reference to parsing quotes you can currently do:

match_template("f * d *", "f zz d foo")        => ["f", "zz", "d", "foo"]
match_template("f * d *", "f \"zz\" d foo")    => ["f", "zz", "d", "foo"]
match_template("f * d *", "f \"zz\" cc d foo") => 0
match_template("f * d *", "f zz d \"fo\"o")    => ["f", "zz", "d", "\"fo\"o"]

Example 1 is a normal parse, hurah
Example 2 is a normal parse, it stripped the quotes, hurah.
Example 3 is a bad thing.
Example 4 is a bad thing.

As I feel it should work (for consistancy reasons):

match_template("f * d *", "f zz d foo")        => ["f", "zz", "d", "foo"]
match_template("f * d *", "f \"zz\" d foo")    => ["f", "zz", "d", "foo"]
match_template("f * d *", "f \"zz\" cc d foo") => ["f", "zz", "cc", "d", "foo"]
match_template("f * d *", "f zz d \"fo\"o")    => ["f", "zz", "d", "fo", "o"]

From here in-database methods can handle problems if it does not match
correctly.  It should also handle escaped quotes, so you can pass them
normally.

-Brandon

(WOAH, I was just toying around with match template a few more times and
received some VERY odd results (i'm sure its something local to the database,
but this is funny anyhow):

;match_template("f * d *", "f \"zz d foo");
=> ["f", "zz d foo", "d", "tell not found."]
(????)
;match_template("f * d *", "f \"zz d foo");
=> ["f", "zz d foo", "d", "foo\", \"d\", \"tell not found.\"]"]
(!?!?!?!?)
;match_template("f * d *", "f \"zz d foo");
=> 0
(...?)
;match_template("f * d *", "f \"zz d foo");
=> 0
(etc)

Anyhsm, dont even try to figure it out, must be something I set conflicting
with the eval).