her-lexer 0.0 → 0.1
raw patch · 2 files changed
+20/−3 lines, 2 filesdep +splitPVP ok
version bump matches the API change (PVP)
Dependencies added: split
API changes (from Hackage documentation)
+ Language.Haskell.Her.FromClutterToLines: fromClutterToLines :: [[Tok]] -> [[Tok]]
Files
her-lexer.cabal view
@@ -1,9 +1,9 @@ name: her-lexer-version: 0.0+version: 0.1 homepage: http://personal.cis.strath.ac.uk/~conor/pub/she synopsis: A lexer for Haskell source code. description:- This is a simple lexer which converts Haskell source code into tolkins and back to ordinary haskell again.+ This is a simple lexer which converts Haskell source code into tokins and back to ordinary haskell again. category: Language license: PublicDomain license-file: LICENCE@@ -15,8 +15,10 @@ library exposed-modules: Language.Haskell.Her.HaLay Language.Haskell.Her.Parsley+ Language.Haskell.Her.FromClutterToLines build-depends: base >=3 && < 5,- mtl >=2 && <3+ mtl >=2 && <3,+ split >= 0 hs-source-dirs: src source-repository head
+ src/Language/Haskell/Her/FromClutterToLines.lhs view
@@ -0,0 +1,15 @@+>module Language.Haskell.Her.FromClutterToLines where+>import Language.Haskell.Her.HaLay+>import Data.List.Split++| When we get the tokss from her-parser's ready, they're a bit cluttered. I'm not sure what Dr. McBride had in mind when he made that mess. But this doesn't mater, from this clutter we can create a list of lines which is aware of haskell's brackets. If a multi-line clause is inside brackets, then we keep the whole section in the same "line".++>fromClutterToLines :: [[Tok]] -> [[Tok]]+>fromClutterToLines tokss =+> split (keepDelimsL $+> whenElt+> (\a ->+> case a of+> NL _ -> True+> _ -> False))+> $ (NL (" ",0)) : concat tokss