Skip to content

Commit

Permalink
Allow lines of dashes in route files
Browse files Browse the repository at this point in the history
See #1180.
  • Loading branch information
mrkkrp committed Mar 11, 2016
1 parent 8df56ec commit 3640d75
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions yesod-core/Yesod/Routes/Parse.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import Language.Haskell.TH.Quote
import qualified System.IO as SIO
import Yesod.Routes.TH
import Yesod.Routes.Overlap (findOverlapNames)
import Data.List (foldl')
import Data.List (foldl', isPrefixOf)
import Data.Maybe (mapMaybe)
import qualified Data.Set as Set

Expand Down Expand Up @@ -86,7 +86,7 @@ resourcesFromString =
spaces = takeWhile (== ' ') thisLine
(others, remainder) = parse indent otherLines'
(this, otherLines') =
case takeWhile (/= "--") $ words thisLine of
case takeWhile (not . isPrefixOf "--") $ words thisLine of
(pattern:rest0)
| Just (constr:rest) <- stripColonLast rest0
, Just attrs <- mapM parseAttr rest ->
Expand Down
2 changes: 2 additions & 0 deletions yesod-core/test/Hierarchy.hs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ do
let resources = [parseRoutes|
/ HomeR GET

----------------------------------------

/!#Int BackwardsR GET

/admin/#Int AdminR:
Expand Down

0 comments on commit 3640d75

Please sign in to comment.