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

Adds curly brackets to route parser. #1363

Merged
merged 1 commit into from
Mar 26, 2017
Merged

Conversation

jprider63
Copy link
Contributor

As discussed on the google group. I still need to implement the &{} syntax.


where
parse :: String -> ( String, String)
parse ('{':s) = fmap ('{':) $ parseBracket s
Copy link
Member

Choose a reason for hiding this comment

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

Is there an advantage to retaining the surrounding braces? What about simply dropping them, and then removing the need for the dynamicPieceFromString below?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that would be too permissive. Otherwise, lines could contain arbitrary braces in routes. For example, the following would probably parse:

/m{}y/{route with}/{spaces} RouteR GET

I prefer the current stricter grammar that requires the braces follow '#' so that braces can only surround types in the route.

Copy link
Member

Choose a reason for hiding this comment

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

Fair enough, that makes sense.

@snoyberg snoyberg merged commit 5b5e411 into yesodweb:master Mar 26, 2017
@snoyberg
Copy link
Member

Thanks!

snoyberg added a commit that referenced this pull request Mar 26, 2017
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.

None yet

2 participants