]> gitweb.factorcode.org Git - factor.git/commitdiff
metar: some fixes for TAF parsing.
authorJohn Benediktsson <mrjbq7@gmail.com>
Wed, 7 Sep 2016 23:04:59 +0000 (16:04 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 7 Sep 2016 23:04:59 +0000 (16:04 -0700)
extra/metar/metar.factor

index e9522bd0bb8f30a6f098fa09a7c7cbe19f1d5962..fc6df7b008634ca9f7691707d06fdcbce96e4e18 100644 (file)
@@ -615,6 +615,8 @@ sky-condition raw ;
 : taf-body ( report str -- report )
     [ blank? ] split-when
 
+    [ "TAF" = ] find-one drop
+
     [ { "AMD" "COR" "RTD" } member? ] find-one drop
 
     [ re-station matches? ] find-one
@@ -679,7 +681,7 @@ sky-condition raw ;
     [ taf-report new ] dip [ >>raw ] keep
     string-lines [ [ blank? ] trim ] map
     rest dup first "TAF" = [ rest ] when
-    harvest unclip taf-body taf-partials ;
+    harvest unclip swapd taf-body swap taf-partials ;
 
 : taf-report. ( report -- )
     [