Skip to content

Commit 59c5e82

Browse files
authored
Merge pull request #73 from Bodigrim/master
Avoid Data.List.{head,tail}
2 parents 39730db + cbc9e9b commit 59c5e82

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/ATTParser.hs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,11 @@ preprocess ('\t':attr) = let (h, t) = break isSpace attr
9999
-- ia64
100100
("stringz":x:_) -> [mkAscii $ read x ++ "\0"]
101101
_ -> []
102-
where w = head . words
102+
where
103+
w x = case words x of
104+
[] -> error $ "preprocess: expected some non-space characters, "
105+
++ "but got spaces only in '" ++ x ++ "'"
106+
hd : _ -> hd
103107
preprocess ('.':'z':'e':'r':'o':'f':'i':'l':'l':' ':x) = case words' (==',') x of
104108
(_seg:_sect:sym:size:_) | size == "4" -> [Ident sym, mkLong 0]
105109
| size == "8" -> [Ident sym, mkQuad 0]

0 commit comments

Comments
 (0)