File tree 1 file changed +0
-28
lines changed
plugins/hls-eval-plugin/src/Ide/Plugin/Eval
1 file changed +0
-28
lines changed Original file line number Diff line number Diff line change 5
5
6
6
-- | GHC API utilities
7
7
module Ide.Plugin.Eval.GHC (
8
- isExpr ,
9
8
addExtension ,
10
9
addImport ,
11
10
hasPackage ,
@@ -42,33 +41,6 @@ import StringBuffer (stringToStringBuffer)
42
41
"/Users/titto/.ghcup/ghc/8.8.4/lib/ghc-8.8.4"
43
42
-}
44
43
45
- {- | Returns true if string is an expression
46
-
47
- >>> isExprTst e df = return (isExpr df e)
48
- >>> run $ isExprTst "3"
49
- True
50
-
51
- >>> run $ isExprTst "(x+y)"
52
- True
53
-
54
- >>> run $ isExprTst "import Data.Maybe"
55
- False
56
-
57
- >>> run $ isExprTst "three=3"
58
- False
59
- -}
60
- isExpr :: DynFlags -> String -> Bool
61
- isExpr df stmt = case parseThing Parser. parseExpression df stmt of
62
- Lexer. POk _ _ -> True
63
- Lexer. PFailed {} -> False
64
-
65
- parseThing :: Lexer. P thing -> DynFlags -> String -> Lexer. ParseResult thing
66
- parseThing parser dflags stmt = do
67
- let buf = stringToStringBuffer stmt
68
- loc = mkRealSrcLoc (fsLit " <interactive>" ) 1 1
69
-
70
- Lexer. unP parser (Lexer. mkPState dflags buf loc)
71
-
72
44
{- | True if specified package is present in DynFlags
73
45
74
46
-- >>> hasPackageTst pkg = run $ \df -> return (hasPackage df pkg)
You can’t perform that action at this time.
0 commit comments