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.
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.
| Frames Homepage | Non-Frames Homepage |
|
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