MushCode Tools


Mushcode isn't that easy to read. Somewhere I remember reading a quote where the general appearance of mushcode was compared to terminal linenoise. To make writing code easier, a number of people have developed tools that allow you to write code in a formatted style much like C, with indenting, one mushcode statement per line, etc.

Unformatters

These are links to popular unformatters. Much of the source code you find in archives is formatted assuming you have the appropriate tool to unformat it before or while quoting it into the mush.

Other offline tools


My own perl unformatter

Unprettify was inspired by Andrew Molitor's mushunformatter.c program, which I've also used. I wrote a new one in perl and provided easier ways of controlling white space at end of lines. I also wrote a companion program Prettify that will create a source file.

Prettified sources files break/indent lines on {} braces and on [] square brackets. You may place one mushcode statement per line. A line consisting of a single dash "-" in column 1 denotes the end of a single line of mushcode. Lines starting with a # in column one are comments and are not quoted to the mush. Leading and trailing whitespace is always stripped from lines, so you may indent as much as you like. To preserve a leading or trailing space, place a \ character before a leading space, or a \ after a trailing space.

An additional goodie I saw and liked is also supported with unprettify. Lines beginning with a double quote (") are assumed to contain plain text which is to be converted to mushcode. Any occurances of five or more repeated characters are converted to [repeat()] calls, unless they're spaces in which case [space()] is used instead. Smaller collections of spaces are converted to %b. Tabs are converted to %t. An %r is appended to the end of each line.

Before and After examples of mushcode.


Prettify (Wednesday, 16-Jun-1999 15:02:27 CDT)
This perl script converts a TinyFugue-logged @decompile into a pretty- printed source file. It produces a lot of whitespace, allowing you to edit the result into whatever indenting style you prefer.
Unprettify (Wednesday, 16-Jun-1999 15:02:27 CDT)
This perl script mashes a prettified source file back into input suitable for quoting to a mush via TinyFugue. Edit one "require" line to point to were text2mush.pl lives.
PrettyComp (Wednesday, 16-Jun-1999 15:02:27 CDT)
This Bash script compares two pretty source files.
Text2mush (Sunday, 11-Jul-1999 12:15:24 CDT)
This perl script takes a plain text file and converts it into a single line of mushcode. This is useful for creating menus, etc, quickly. Edit one "require" line to point to where text2mush.pl lives.
text2mush.pl (Wednesday, 16-Jun-1999 15:04:04 CDT)
Subroutine library used by both Text2mush and unprettify.
mtags (Wednesday, 16-Jun-1999 15:05:44 CDT)
This is like a ctags, for mushcode. It produces tags files that are compatible with VIM, and probably VI, and likely EMACS if you tell it to read VI-style tags. It's designed for use with the other tools here, but might work on others as well.

Vector Internet indicates you are visitor since 3/16/98.
Frames Homepage Non-Frames Homepage

Say no to monopolies, BOYCOTT MICROSOFT!
KMFMS, one of the Angry Penguins.
[U.S. Flag] In memory of those who died Sept. 11, 2001 at the World Trade Center, the Pentagon, and on American Airlines Flight 11, United Airlines Flight 175, American Airlines Flight 77, and United Airlines Flight 93
Honoring Marsh & McLennan professionals I've worked with, including:
Jack Aron, Valerie Hanna, Joe Sisolak, Greg Reda, and Cathy Fagan.
Shattered Photoessay by James Nachtewy

Comments may be sent to gyles19@nospam.visi.com

Last Updated: Thursday, 11-Nov-1999 15:09:11 CST