diff options
Diffstat (limited to 'lib/Postdelay/TimeSpec.hs')
-rw-r--r-- | lib/Postdelay/TimeSpec.hs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Postdelay/TimeSpec.hs b/lib/Postdelay/TimeSpec.hs index af8d801..676dabf 100644 --- a/lib/Postdelay/TimeSpec.hs +++ b/lib/Postdelay/TimeSpec.hs | |||
@@ -2,6 +2,7 @@ | |||
2 | 2 | ||
3 | module Postdelay.TimeSpec | 3 | module Postdelay.TimeSpec |
4 | ( pTimeSpec | 4 | ( pTimeSpec |
5 | , pTimeZone | ||
5 | , TimeCtx(..) | 6 | , TimeCtx(..) |
6 | ) where | 7 | ) where |
7 | 8 | ||
@@ -308,7 +309,7 @@ pTimeBase = choice' [ do | |||
308 | pMinute = ensure (< 60) =<< natural | 309 | pMinute = ensure (< 60) =<< natural |
309 | pSecond = decimal | 310 | pSecond = decimal |
310 | 311 | ||
311 | pTimeZone :: MonadTP m => ParsecT String () m (Either TimeZone TZ) | 312 | pTimeZone :: MonadIO m => ParsecT String () m (Either TimeZone TZ) |
312 | pTimeZone = choice' [ do | 313 | pTimeZone = choice' [ do |
313 | sgn <- choice [ id <$ char '+' | 314 | sgn <- choice [ id <$ char '+' |
314 | , negate <$ char '-' | 315 | , negate <$ char '-' |
@@ -317,7 +318,9 @@ pTimeZone = choice' [ do | |||
317 | ms <- option 0 $ (\d u -> 10 * d + u) <$> digit <*> digit | 318 | ms <- option 0 $ (\d u -> 10 * d + u) <$> digit <*> digit |
318 | return . Left . minutesToTimeZone $ hs * 60 + ms | 319 | return . Left . minutesToTimeZone $ hs * 60 + ms |
319 | , do | 320 | , do |
320 | n <- many1 $ letter <|> char '/' | 321 | let |
322 | ident = (++) <$> many1 alphaNum <*> option "" ((:) <$> oneOf "_-/.+" <*> ident) | ||
323 | n <- ident | ||
321 | tz <- liftIO $ do | 324 | tz <- liftIO $ do |
322 | let | 325 | let |
323 | fbHandler :: IO a -> (IOException -> IO a) | 326 | fbHandler :: IO a -> (IOException -> IO a) |