Skip to content

Commit

Permalink
Merge pull request #1182 from mrkkrp/master
Browse files Browse the repository at this point in the history
Allow lines of dashes in route files
  • Loading branch information
snoyberg committed Mar 13, 2016
2 parents 27a9faa + 3640d75 commit 292270f
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
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
Expand Up @@ -78,6 +78,8 @@ do
let resources = [parseRoutes|
/ HomeR GET

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

/!#Int BackwardsR GET

/admin/#Int AdminR:
Expand Down

0 comments on commit 292270f

Please sign in to comment.