language-dickinson 1.1.0.2 → 1.1.0.3
raw patch · 7 files changed
+20/−1 lines, 7 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +4/−0
- examples/fionaBot.dck +1/−0
- language-dickinson.cabal +1/−1
- lib/adjectives.dck +1/−0
- lib/noun.dck +3/−0
- run/Main.hs +4/−0
- run/REPL/Completions.hs +6/−0
CHANGELOG.md view
@@ -1,5 +1,9 @@ # dickinson +## 1.1.0.3++ * More sensible completions in REPL+ ## 1.1.0.2 * Support `prettyprinter` ≥ 1.7.0
examples/fionaBot.dck view
@@ -10,6 +10,7 @@ (| "The child is gone.") (| "If you're right you'll agree.") (| "I just wanna feel everything")+ (| "Everything good I deem too good to be true.") (| "What does she think of me?") (| "You raped me in the same bed your daughter was born in.") (| "I want to suffer for my sins")
language-dickinson.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.0 name: language-dickinson-version: 1.1.0.2+version: 1.1.0.3 license: BSD3 license-file: LICENSE copyright: Copyright: (c) 2020 Vanessa McHale
lib/adjectives.dck view
@@ -20,6 +20,7 @@ (| "anabatic") (| "arid") (| "antinomian")+ (| "boffo") (| "azure") (| "antipruritic") (| "elysian")
lib/noun.dck view
@@ -35,11 +35,14 @@ (| "tail") (| "joke") (| "autocracy")+ (| "foofaraw") (| "autonomous") (| "pseudonym")+ (| "perfidy") (| "heliophagy") (| "valedictorian") (| "apothegm")+ (| "pablum") (| "satori") (| "ardor") (| "palaver")
run/Main.hs view
@@ -20,6 +20,7 @@ | Format !FilePath Bool | Man | Ide !FilePath ![FilePath]+ | Dir main :: IO () main = run =<< execParser wrapper@@ -33,6 +34,8 @@ <> command "fmt" (info formatP (progDesc "Format Dickinson code")) <> command "man" (info (pure Man) (progDesc "Dump path to manpages")) <> command "ide" (info ide (progDesc "Run all checks and lints"))+ -- ide and dir should be hidden?+ <> command "dir" (info (pure Dir) (progDesc "Show library install directory")) ) <|> runP formatP :: Parser Act@@ -96,3 +99,4 @@ run (Format fp True) = fmtInplace fp run Man = putStrLn . (</> "emd.1") . (</> "man") =<< getDataDir run (Ide fp is) = do { is' <- modIs is ; validateFile is' fp ; warnFile fp }+run Dir = putStrLn =<< getDataDir
run/REPL/Completions.hs view
@@ -5,6 +5,7 @@ ) where import Control.Monad.State (StateT, gets)+import Data.List (isPrefixOf) import qualified Data.Map as M import qualified Data.Text as T import Language.Dickinson.Eval@@ -54,4 +55,9 @@ emdCompletions (" epyt:", "") = do { ns <- namesStr ; pure (" epyt:", cyclicSimple ns) } emdCompletions (" t:", "") = do { ns <- namesStr ; pure (" t:", cyclicSimple ns) } emdCompletions ("", "") = ("",) . cyclicSimple <$> namesStr+emdCompletions (rp, "") = do { ns <- namesStr ; pure (unwords ("" : tail (words rp)), cyclicSimple (namePrefix ns rp)) }+-- see? http://hackage.haskell.org/package/dhall-1.34.0/docs/src/Dhall.Repl.html#completer emdCompletions _ = pure (undefined, [])++namePrefix :: [String] -> String -> [String]+namePrefix names prevRev = filter (last (words (reverse prevRev)) `isPrefixOf`) names