My mind is reeling from this link. Read the Ph.D. Thesis if you can, it’s got a very detailed description of parsing techniques and also outlines COLM pretty thoroughly. COLM shares a LOT of things in common with MetaSharp. There are enough differences that I’m not too worried but lots of great ideas in here.
The primary difference which, I’m now jealous of, is that in COLM the patterns appear to be more like objects, while in MetaSharp they appear to be more like functions. You can declare matches and treat them inside of expressions and statements as variables and perform match operators on them inline. Very cool. I think that I could actually do something like that too… maybe construct a Type that holds the function and also a function? I’ll have to think about it. Also, the patterns have variables associated with them, which is something I was thinking about doing too. Except I was going to create a let statement but this is different still somehow, it’s like they are simultaneously patterns and nodes, that’s an interesting idea. Also while reading this I can see that my notion of the “PatternContext” that gets passed aroudn is probably useless. I think that I can totally just create local variables that get passed into the constructor instead. That would be so much cleaner. I can see that is how they are doing the symbol table also.
Also, I don’t think that you need to formally make a lex and token types. I think those are just normal patterns and matches. It gets very esoteric in a lot of places also, a lot of implicit variables and some functions I’m not sure where they’re coming from, seemingly random empty brackets  peppered around. But I’m really glad to see that my idea of putting arbitrary statements in productions is not totally crazy.
Tons to think about now!