Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gargantext-ihaskell
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
gargantext-ihaskell
Commits
bea11742
Commit
bea11742
authored
Jan 28, 2020
by
Vaibhav Sagar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Start implementing :sprint
parent
76bbf5e4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
Evaluate.hs
src/IHaskell/Eval/Evaluate.hs
+13
-1
Parser.hs
src/IHaskell/Eval/Parser.hs
+2
-0
No files found.
src/IHaskell/Eval/Evaluate.hs
View file @
bea11742
...
...
@@ -28,6 +28,7 @@ import qualified Data.Set as Set
import
Data.Char
as
Char
import
Data.Dynamic
import
qualified
Data.Serialize
as
Serialize
import
qualified
Debugger
import
System.Directory
import
System.Posix.IO
(
fdToHandle
)
import
System.IO
(
hGetChar
,
hSetEncoding
,
utf8
)
...
...
@@ -735,7 +736,7 @@ evalCommand _ (Directive GetHelp _) state = do
,
" :type <expression> - Print expression type."
,
" :info <name> - Print all info for a name."
,
" :hoogle <query> - Search for a query on Hoogle."
,
" :doc <ident> - Get documentation for an identifier via Ho
go
le."
,
" :doc <ident> - Get documentation for an identifier via Ho
og
le."
,
" :set -XFlag -Wall - Set an option (like ghci)."
,
" :option <opt> - Set an option."
,
" :option no-<opt> - Unset an option."
...
...
@@ -785,6 +786,17 @@ evalCommand _ (Directive GetDoc query) state = safely state $ do
results
<-
liftIO
$
Hoogle
.
document
query
return
$
hoogleResults
state
results
evalCommand
_
(
Directive
SPrint
binding
)
state
=
safely
state
$
do
Debugger
.
pprintClosureCommand
False
False
binding
return
EvalOut
{
evalStatus
=
Success
,
evalResult
=
mempty
,
evalState
=
state
,
evalPager
=
[]
,
evalMsgs
=
[]
}
evalCommand
output
(
Statement
stmt
)
state
=
wrapExecution
state
$
evalStatementOrIO
output
state
(
CapturedStmt
stmt
)
...
...
src/IHaskell/Eval/Parser.hs
View file @
bea11742
...
...
@@ -63,6 +63,7 @@ data DirectiveType = GetType -- ^ Get the type of an expression via ':type'
|
GetDoc
-- ^ Get documentation for an identifier via Hoogle.
|
GetKind
-- ^ Get the kind of a type via ':kind'.
|
LoadModule
-- ^ Load and unload modules via ':module'.
|
SPrint
-- ^ Print without evaluating via ':sprint'.
deriving
(
Show
,
Eq
)
-- | Pragma types. Only LANGUAGE pragmas are currently supported. Other pragma types are kept around
...
...
@@ -285,6 +286,7 @@ parseDirective (':':directive) ln =
,
(
SetExtension
,
"extension"
)
,
(
GetHelp
,
"?"
)
,
(
GetHelp
,
"help"
)
,
(
SPrint
,
"sprint"
)
]
parseDirective
_
_
=
error
"Directive must start with colon!"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment