Mush-Format New version release!
-
Hello, all you mushcode dinos! I've recently been improving on the logic behind my mushcode preprocessor. Mainly I've been testing aginst Theno's CoFD codebase for quirks. It passes as far as I can tell! Check it out! https://format.ursamu.io The code and readme are available at https://github.com/digibear-io/mush-format
Feel free to play with the demo and let me know where I can improve by leaving an issue on the GitHub repo! Or a star if you're feeling generous.
Thanks for reading!
-
Back with another update, you old salty code-dogs! Someone, I can't remember who, asked if there was a CLI. Now there is!
The next step is a diffing algorithm to check for changed commands between renders of the same file. It'll make it /way/ more useful to add into my own mushcode development toolchain and anyone else who might still be interested.
I've also had requests to add prettifier functionality. That should be interesting!
More soon!
-
On a roll! Now Mush-Format comes with diffing! Perfect for adding into your mushcode development stack. Check out the demo or check out the GitHub!
Next up is local archive processing. Soon you should be able to build and debug an archive on your local machine, then send the whole shebang off to GitHub for public consumption.
Thanks for stopping in!
-
Local #includes work now. And I've verified, with much giddiness, that using /quote in TF to send only the changes is <3. If anyone else is still writing mushcode (haha!) Check it out. Today's the first day in my mushcoding career that I didn't have to cut and paste to develop.
I'm officially spoiled.
That is all.
-
Oooooooh snap! More updates!
New feature roll out!
#define
!#define
allows you to make your own directives and code snippets! Especially handy for those of you who still aren't using Rhost (for some reason)! Say I have a staff check for a handful of commands on my object. Normally, I'd have to repeat@assert orflags(wWZ) = {@pemit %#= Permission denied.}
Right? Not a whole lot of code but it adds up! Now, for you dinos who haven't discovered Rhost's@include
you can do something like this:#define @staff_check { @assert orflags(%#,wWZ) = {@pemit %#= Permission denied.}; }
Then later ....
&cmd #dbref = $+awesome cmd: @staff_check // .... Continue with your command
But it also accepts variables by way of regular expression like patterns! I say 'like' because their string interpretation of regular expressions, so you have to do things like use actual spaces to represent spaces. Any unescaped slashes will be escaped for you! Just to warn! Wildcard matches are represented by
$<match index>
. Remember! In a RegExp match and replace in JavaScript,$0
is the entire matched string, followed by the input groups provided starting at$1
.#define [@\+]te[st]+ (.*) { This test produces: $1 }
I struggled with adding this feature to the formatter for the sake of code legibility. However, after spoiling myself on Rhost
@include
I decided that other flavors of Mushcode needed something similar!A more practical example:
#define #create (.*)=(.*) { @create $1 @tag/add $2 = lastcreate(me,t) @set $2 = safe inherit <etc> } #create Room Parent=RP
If you still write mushcode, give it a spin if you'd like!
Thanks for reading!
-
Me again! With another update! Woot! Now
mform
has been restructured a bit!Usage: mform [options] [command] A MUSHcode pre-processor. Options: -V, --version output the version number -h, --help display help for command Commands: run|r <path> run a Project or file. init|i <project> Initialize a new MUSHCode project. help [command] display help for command
to run an archive into a file you would use something like
mform run input.mush -o output.mush
. Want to start a project that's ready for GitHub really quick?mform init
has you covered!mform init <path>
Will take you through a series of questions, whilemform init -y <path>
generates a new project in the given folder with some default values! It will create the folder if it doesn't exist!mform honors relative paths, so
mform ~/path/to/project
works, or within your code you can link your includes like#include ./stuff/archive.mush
Feel free to give it a whirl! If you have Node installed on your system,
npm i -g @digibear/mush-format
Thenmfom
!Thanks for reading!