lima 0.2.1.0 → 0.2.1.1
raw patch · 5 files changed
+14/−12 lines, 5 files
Files
- README.hs +5/−4
- README.md +5/−4
- lima.cabal +1/−1
- src/Converter.hs +1/−1
- test/Conversions/Main.hs +2/−2
README.hs view
@@ -43,17 +43,18 @@ - A document can be parsed into a list of tokens. - Tags affect how a document is parsed. - The tokens can be printed back to that document.-- After printing a parsed document back to itself, the document becomes formatted.- - Formatting is idempotent. In other words, formatting the document again won't change its contents.+- Formatting a document is printing a parsed document back to itself.+ - Formatting is idempotent. In other words, formatting the document again won't change its content. - The `lima` library provides a parser and a printer for each supported format. - A composition of a printer after a parser produces a converter.-- Such a converter is usually invertible for two formatted documents.+- Such a converter is usually invertible for a formatted document.+ - Converting a document `A` to a document `B`, then converting `B` to `A` doesn't change the content of `A`. ## Setup 1. Create a test suite. 1. Add `lima` and `text` to its dependencies.-1. Create a test module. It can have the following contents.+1. Create a test module. It can have the following content. -} {- LIMA_INDENT 4 -}
README.md view
@@ -42,17 +42,18 @@ - A document can be parsed into a list of tokens. - Tags affect how a document is parsed. - The tokens can be printed back to that document.-- After printing a parsed document back to itself, the document becomes formatted.- - Formatting is idempotent. In other words, formatting the document again won't change its contents.+- Formatting a document is printing a parsed document back to itself.+ - Formatting is idempotent. In other words, formatting the document again won't change its content. - The `lima` library provides a parser and a printer for each supported format. - A composition of a printer after a parser produces a converter.-- Such a converter is usually invertible for two formatted documents.+- Such a converter is usually invertible for a formatted document.+ - Converting a document `A` to a document `B`, then converting `B` to `A` doesn't change the content of `A`. ## Setup 1. Create a test suite. 1. Add `lima` and `text` to its dependencies.-1. Create a test module. It can have the following contents.+1. Create a test module. It can have the following content. <!-- LIMA_INDENT 4 -->
lima.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: lima-version: 0.2.1.0+version: 0.2.1.1 synopsis: Convert between Haskell, Markdown, Literate Haskell, TeX description: See the [README.md](https://github.com/deemp/lima#readme) category: Productivity
src/Converter.hs view
@@ -631,7 +631,7 @@ mkToTokens :: (State -> [(Int, T.Text)] -> [Token] -> [Token]) -> T.Text -> Tokens mkToTokens toTokens xs = normalizeTokens (drop 1 $ reverse $ toTokens def (zip [1 ..] (T.lines xs)) [Dedent]) --- | Parse contents of a single line to a token.+-- | Parse a single line to a token. -- -- - Merge comments parseLineToToken :: Config Internal -> Format -> Token -> T.Text -> Int -> Tokens
test/Conversions/Main.hs view
@@ -100,8 +100,8 @@ genLine :: Gen T.Text genLine = do indent <- Gen.text (Range.constant 0 5) (pure ' ')- contents <- Gen.text (Range.constant 1 5) alphabet- pure $ indent <> contents+ content <- Gen.text (Range.constant 1 5) alphabet+ pure $ indent <> content genLines :: Gen [T.Text] genLines = Gen.list (Range.constant 1 5) genLine