robrix / Madness

Recursive Descent Into Madness
MIT License
291 stars 17 forks source link

Significant indentation #54

Closed robrix closed 9 years ago

robrix commented 9 years ago

Defines >>= over parsers, and demonstrates the use of it for parsing structurally significant indentation, in this case a rose tree of list items.

Fixes #42. Fixes #50.

/cc @jspahrsummers because of the relevance to https://github.com/Carthage/ogdl-swift/pull/1 /cc @mdiep because of the relevance to Markdown parsing

If this isn’t madness, I don’t know what is.

robrix commented 9 years ago

@jspahrsummers Note that the actual parsing is functioning just fine—the remainder of the work to be done on this branch is documentation/explanatory.

We can point https://github.com/Carthage/ogdl-swift/pull/1 at this branch, or we can just define >>=/bind over parsers there, at your preference. There aren’t any other significant contributions on Madness’ side that I know of yet—although maybe I’ll add some conveniences for parsing significant indentation in light of experience doing it.

jspahrsummers commented 9 years ago

I think I'd prefer to target this branch, just to minimize code duplication.

robrix commented 9 years ago

I think I'd prefer to target this branch, just to minimize code duplication.

:+1: