brazilofmux / tinymux

TinyMUX
www.tinymux.org
48 stars 21 forks source link

parenmatch [REF: Job 102] #14

Open brazilofmux opened 9 years ago

brazilofmux commented 9 years ago

Original issue 11 created by brazilofmux on 2006-09-08T21:04:20.000Z:

On Sat Jul 24 21:35:55 2004, Lolly suggested:

A nifty feature from Rhost, no less, it takes anything you pass to it, unevaluated, and analyses the brackets, highlighting them, in ansi, according to function depth, and, more crucially, highlights in red when you have odd brackets, a truly awesome feature, that I think ALL MU* should have! =)

[REF: Job 102]

brazilofmux commented 9 years ago

Comment #1 originally posted by brazilofmux on 2006-09-08T21:06:56.000Z:

Parenmatch() originally from ChaoticMUX.

brazilofmux commented 9 years ago

Comment #2 originally posted by brazilofmux on 2006-09-09T05:02:38.000Z:

On Wed May 24 01:23:41 2006, Leona suggested:

Can you ask Ash really nicely, for the code for Rhost's Parenmatch function, for easier bugfixing? :) It highlights the brackets in a ling of code, and the bad ones, ie excessive brckets, are highlighted in red.

On Wed May 24 07:12:35 2006, poldy added:

You probably already know this, but if you edit your MUSHcode offline (perhaps using a formatter), good text editors can do paren-matching ( in vi). Also, TinyFugue will do paren-matching in the input area using Esc-=.

On Wed May 24 10:37:47 2006, Kelvin added:

I'd really like to have the brackets() or maybe it was called pairs() to give the total number of each type of brackets/pairs in any given text. This too is really useful. And I never have and probably never will use a formatter or vi for softcoding, I'm not sure how many actually do either.

On Wed May 24 11:55:46 2006, poldy added:

This seemed like a nice bit of MUSHcode practice, so I did it at http://www.skynet.ie/~poldy/brackets.mush

On Wed May 24 11:57:31 2006, Kevin added:

Indeed, a number of games have things such as this, but that really is a nasty way of checking them when a simple hardcode function could do the same thing a lot more cleanly and in some cases where funky esapes are involved, more accurately.

[REF: Job 298]

brazilofmux commented 9 years ago

Comment #3 originally posted by brazilofmux on 2006-11-28T05:23:47.000Z:

Still not totally sold on the value of this.

brazilofmux commented 9 years ago

Comment #4 originally posted by brazilofmux on 2007-09-21T00:58:14.000Z:

<empty>

brazilofmux commented 9 years ago

Comment #5 originally posted by brazilofmux on 2007-11-02T00:14:01.000Z:

The examine/pairs option from TinyMUSH does this (paren/bracket counting/matching) as well.

Though if we're stealing inspiration in terms of examine switches from other games, I find examine/pairs less useful than the examine/pretty switch (which dumps an object, or an attribute, in nicely indented/pretty-printed formatted code format). :)