summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xavwx.cabal2
-rw-r--r--changelog.md4
-rw-r--r--src/Data/Aviation/WX.hs4
3 files changed, 7 insertions, 3 deletions
diff --git a/avwx.cabal b/avwx.cabal
index e6257f7..e113fe3 100755
--- a/avwx.cabal
+++ b/avwx.cabal
@@ -1,5 +1,5 @@
name: avwx
-version: 0.3.0.1
+version: 0.3.0.2
synopsis: Parse aviation weather reports
description: Parse aviation weather reports, currently METARs and TAFs
homepage: https://www.hcesperer.org/posts/2016-09-20-avwx.html
diff --git a/changelog.md b/changelog.md
index bff1b6d..c89bc23 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,3 +1,7 @@
+# 0.3.0.2
+
+* Fix a TAF parsing bug
+
# 0.3.0.0
* Parse TAFs
diff --git a/src/Data/Aviation/WX.hs b/src/Data/Aviation/WX.hs
index 9ea17e2..081e7e8 100644
--- a/src/Data/Aviation/WX.hs
+++ b/src/Data/Aviation/WX.hs
@@ -765,7 +765,7 @@ wxParser = do
obfs <- perhaps obfuscationParser
othr <- perhaps otherParser
when ( (== 0) . Prelude.length . Prelude.filter not $
- [ isNothing dsc, isNothing prc
+ [ isNothing prc
, isNothing obfs, isNothing othr ] ) $ fail ""
return $ Phenomenon intsy dsc prc obfs othr
@@ -1015,7 +1015,7 @@ changesParser = some $ spaces >> transitionTypeParser
[ "TEMPO" `callsfor` (TEMPO <$> parseFrom <*> parseTo <*> transitionParser)
, "BECMG" `callsfor` (BECMG <$> parseFrom <*> parseTo <*> transitionParser)
, "FM" `callsfor` (BECMG <$> parseFromFM <*> pure Nothing <*> transitionParser)
- , "PROB" `callsfor` (PROB <$> twoDigits <*> (head <$> changesParser)) ]
+ , "PROB" `callsfor` (PROB <$> twoDigits <*> (spaces >> transitionTypeParser)) ]
transitionParser = sepBy1 oneTransition (char ' ')
parseFromFM = do
fromDate <- dateParserSansZulu