Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Significant indentation #54

Merged
merged 28 commits into from
Feb 16, 2015
Merged

Significant indentation #54

merged 28 commits into from
Feb 16, 2015

Conversation

robrix
Copy link
Owner

@robrix robrix commented Jan 30, 2015

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

  • Documentation for structurally significant indentation parsing.
  • Should there be direct conveniences in support of parsing structurally significant indentation?
  • Flesh out the tests’ example to parse text for the list items and store that in the tree.
  • Add a Playground which parses (some very minimal subset of) Markdown.
  • >>- instead of >>= (a la Runes and swiftz)
    • precedence 150

Fixes #42.
Fixes #50.

/cc @jspahrsummers because of the relevance to Carthage/ogdl-swift#1
/cc @mdiep because of the relevance to Markdown parsing

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

@robrix
Copy link
Owner Author

robrix commented Jan 30, 2015

@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 Carthage/ogdl-swift#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.

@@ -224,6 +236,13 @@ infix operator --> {
prefix operator % {}


/// Bind operator.
infix operator >>= {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this going to become >>-, per @gfontenot's tweets?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, note to-do item at top.

@jspahrsummers
Copy link
Collaborator

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

@robrix
Copy link
Owner Author

robrix commented Feb 8, 2015

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

👍

It’s not actually doing any significant indentation handling or showing
how >>- is used, so might as well rename it.
@robrix robrix changed the title [WIP] Significant indentation Significant indentation Feb 16, 2015
robrix added a commit that referenced this pull request Feb 16, 2015
@robrix robrix merged commit 464ac4b into master Feb 16, 2015
@robrix robrix deleted the significant-indentation branch February 16, 2015 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Parsing significant indentation >>- (bind) operator
2 participants