// this shall become the rudiments of a Markdown to HTML compiler ometa trivial { alpha = 'a' | 'b' | 'c' | ' ', alphaText = alpha:a alphaText:as -> [a, as] | alpha:a -> a, boldText = '*' alphaText:t '*' -> ['bold', t], text = alpha:a text:t -> [a, t] | boldText:b text:t -> [b, t] | alphaText:a -> [a] } trivial.matchAll('aaa*bbb*ccc','text') [1,2,3].concat([4,5,6]) ometa MDtest { alpha = 'a' | 'b' | 'c' | ' ', text = alphaText:a text:t -> [a, t] | boldText:b text:t -> [b, t], alphaText = alpha:a alphaText:as -> [a, as], boldText = '*' alphaText:t '*' -> ['bold', t], } MDtest.matchAll('aaa','text') ometa MDregex { alpha = 'a' | 'b' | 'c' | ' ', alphaStar = alpha | '*', bold = alphaStar* '*' alpha* '*' alphaStar*, foo = alphaStar*:x '*' -> x } MDregex.matchAll('aaa *','foo') MDregex.matchAll('aaa *bbb* ccc','bold')