Skip to content

Commit

Permalink
Merge pull request #73 from Bodigrim/master
Browse files Browse the repository at this point in the history
Avoid Data.List.{head,tail}
  • Loading branch information
bgamari authored Jan 5, 2023
2 parents 39730db + cbc9e9b commit 59c5e82
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ATTParser.hs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,11 @@ preprocess ('\t':attr) = let (h, t) = break isSpace attr
-- ia64
("stringz":x:_) -> [mkAscii $ read x ++ "\0"]
_ -> []
where w = head . words
where
w x = case words x of
[] -> error $ "preprocess: expected some non-space characters, "
++ "but got spaces only in '" ++ x ++ "'"
hd : _ -> hd
preprocess ('.':'z':'e':'r':'o':'f':'i':'l':'l':' ':x) = case words' (==',') x of
(_seg:_sect:sym:size:_) | size == "4" -> [Ident sym, mkLong 0]
| size == "8" -> [Ident sym, mkQuad 0]
Expand Down

0 comments on commit 59c5e82

Please sign in to comment.