
Show HN: A syntax-diagram generator for rust's macro_rules() - lukaslueg
https://lukaslueg.github.io/macro_railroad_wasm_demo/
======
dleslie
Try feeding the Java-ish Rust macro[0] into it, which was featured on HN last
week.

> Failed to parse, and I didn't even write an error-handler. Anyway:

> ParseError(None)

0:
[https://gitlab.com/jD91mZM2/jrust/blob/master/src/lib.rs](https://gitlab.com/jD91mZM2/jrust/blob/master/src/lib.rs)

~~~
htor
do you mean to say there's a rust macro that lets you type java in rust?
that's a horrible thing to invent! un-invent! exterminate at once!

~~~
dleslie
There is, sort-of, and the macro appears to kill this tool. ;)

------
phyzome
Nothing happens, and I see this in the developer console:

    
    
      ReferenceError: WebAssembly is not defined
    

Does this need some kind of special browser?

~~~
Something1234
Are you running the latest firefox? Works for me, but I don't see anything
special about it.

~~~
phyzome
Yes, I'm using the latest Firefox on my update channel (ESR), namely 52.9.0.
It's up to date.

~~~
LawnGnome
WebAssembly is explicitly disabled on the ESR version of Firefox 52, per
[https://www.caniuse.com/#search=webassembly](https://www.caniuse.com/#search=webassembly),
so that would explain that.

------
ChickeNES
Too bad you can't do the inverse: graphically lay out a syntax-diagram and get
a macro_rules!() block back...

