tools/pas2c/landTemplatesUnit2yaml.hs
changeset 13898 b95074eb8d57
parent 13887 5988e73080a3
equal deleted inserted replaced
13897:1d4291eccb5f 13898:b95074eb8d57
    60             | (i == "Template" ++ show templateNumber ++ suffix) = ie
    60             | (i == "Template" ++ show templateNumber ++ suffix) = ie
    61             | otherwise = Nothing
    61             | otherwise = Nothing
    62         toTemplatePointInit _ _ = Nothing
    62         toTemplatePointInit _ _ = Nothing
    63 
    63 
    64         breakNTPX :: InitExpression -> [InitExpression]
    64         breakNTPX :: InitExpression -> [InitExpression]
    65         breakNTPX (InitArray ia) = map (InitArray . filter (not . isNtpx)) $ groupBy (\a _ -> not $ isNtpx a) ia
    65         breakNTPX (InitArray ia) = map InitArray . filter ((<) 0 . length) . map (filter (not . isNtpx)) $ groupBy (\a b -> isNtpx a == isNtpx b) ia
    66         breakNTPX a = error $ show a
    66         breakNTPX a = error $ show a
    67         isNtpx :: InitExpression -> Bool
    67         isNtpx :: InitExpression -> Bool
    68         isNtpx (InitRecord ((Identifier "x" _, InitReference (Identifier "NTPX" _)):_)) = True
    68         isNtpx (InitRecord ((Identifier "x" _, InitReference (Identifier "NTPX" _)):_)) = True
    69         isNtpx _ = False
    69         isNtpx _ = False
    70 
    70