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
2762da3e
Commit
2762da3e
authored
May 18, 2014
by
Andrew Gibiansky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added `pager` and `no-pager` options for controlling whether to use the
pager. Closes #126.
parent
6038faf1
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
11 deletions
+26
-11
Test.ipynb
notebooks/Test.ipynb
+11
-2
Lint.hs
src/IHaskell/Eval/Lint.hs
+1
-2
Parser.hs
src/IHaskell/Eval/Parser.hs
+0
-1
Types.hs
src/IHaskell/Types.hs
+4
-0
Main.hs
src/Main.hs
+10
-6
No files found.
notebooks/Test.ipynb
View file @
2762da3e
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
"celltoolbar": "Hiding",
"celltoolbar": "Hiding",
"language": "haskell",
"language": "haskell",
"name": "",
"name": "",
"signature": "sha256:
15cf13f0b51aedf4b16cbd0be35d8f1f0e7cca10ef18411c270d26f993eda4a7
"
"signature": "sha256:
bfb92bc59c8c3f67da7b83650a8f51392e6267254808a7bba3df4f09cbad6081
"
},
},
"nbformat": 3,
"nbformat": 3,
"nbformat_minor": 0,
"nbformat_minor": 0,
...
@@ -53,7 +53,16 @@
...
@@ -53,7 +53,16 @@
"metadata": {
"metadata": {
"hidden": false
"hidden": false
},
},
"outputs": []
"outputs": [
{
"metadata": {},
"output_type": "display_data",
"text": [
"18"
]
}
],
"prompt_number": 2
},
},
{
{
"cell_type": "code",
"cell_type": "code",
...
...
src/IHaskell/Eval/Lint.hs
View file @
2762da3e
...
@@ -201,10 +201,9 @@ htmlSuggestions = concatMap toHtml
...
@@ -201,10 +201,9 @@ htmlSuggestions = concatMap toHtml
showSuggestion
::
String
->
String
showSuggestion
::
String
->
String
showSuggestion
=
remove
Splices
.
remove
lintIdent
.
dropDo
showSuggestion
=
remove
lintIdent
.
dropDo
where
where
remove
str
=
replace
str
""
remove
str
=
replace
str
""
removeSplices
=
id
-- Drop leading ' do ', and blank spaces following.
-- Drop leading ' do ', and blank spaces following.
dropDo
::
String
->
String
dropDo
::
String
->
String
...
...
src/IHaskell/Eval/Parser.hs
View file @
2762da3e
...
@@ -78,7 +78,6 @@ parseString codeString = do
...
@@ -78,7 +78,6 @@ parseString codeString = do
-- Split input into chunks based on indentation.
-- Split input into chunks based on indentation.
let
chunks
=
layoutChunks
$
removeComments
codeString
let
chunks
=
layoutChunks
$
removeComments
codeString
result
<-
joinFunctions
<$>
processChunks
[]
chunks
result
<-
joinFunctions
<$>
processChunks
[]
chunks
liftIO
$
print
result
-- Return to previous flags. When parsing, flags can be set to make
-- Return to previous flags. When parsing, flags can be set to make
-- sure parsing works properly. But we don't want those flags to be
-- sure parsing works properly. But we don't want those flags to be
...
...
src/IHaskell/Types.hs
View file @
2762da3e
...
@@ -148,6 +148,7 @@ data KernelState = KernelState
...
@@ -148,6 +148,7 @@ data KernelState = KernelState
useSvg
::
Bool
,
useSvg
::
Bool
,
useShowErrors
::
Bool
,
useShowErrors
::
Bool
,
useShowTypes
::
Bool
,
useShowTypes
::
Bool
,
usePager
::
Bool
,
openComms
::
Map
UUID
Widget
openComms
::
Map
UUID
Widget
}
}
deriving
Show
deriving
Show
...
@@ -160,6 +161,7 @@ defaultKernelState = KernelState
...
@@ -160,6 +161,7 @@ defaultKernelState = KernelState
useSvg
=
True
,
useSvg
=
True
,
useShowErrors
=
False
,
useShowErrors
=
False
,
useShowTypes
=
False
,
useShowTypes
=
False
,
usePager
=
True
,
openComms
=
empty
openComms
=
empty
}
}
...
@@ -185,6 +187,8 @@ kernelOpts =
...
@@ -185,6 +187,8 @@ kernelOpts =
,
KernelOpt
[
"no-show-types"
]
[
"-t"
]
$
\
state
->
state
{
useShowTypes
=
False
}
,
KernelOpt
[
"no-show-types"
]
[
"-t"
]
$
\
state
->
state
{
useShowTypes
=
False
}
,
KernelOpt
[
"show-errors"
]
[]
$
\
state
->
state
{
useShowErrors
=
True
}
,
KernelOpt
[
"show-errors"
]
[]
$
\
state
->
state
{
useShowErrors
=
True
}
,
KernelOpt
[
"no-show-errors"
]
[]
$
\
state
->
state
{
useShowErrors
=
False
}
,
KernelOpt
[
"no-show-errors"
]
[]
$
\
state
->
state
{
useShowErrors
=
False
}
,
KernelOpt
[
"pager"
]
[]
$
\
state
->
state
{
usePager
=
True
}
,
KernelOpt
[
"no-pager"
]
[]
$
\
state
->
state
{
usePager
=
False
}
]
]
-- | Initialization information for the kernel.
-- | Initialization information for the kernel.
...
...
src/Main.hs
View file @
2762da3e
...
@@ -164,14 +164,14 @@ runKernel profileSrc initInfo = do
...
@@ -164,14 +164,14 @@ runKernel profileSrc initInfo = do
-- running some code.
-- running some code.
let
extLines
=
map
(
":extension "
++
)
$
extensions
initInfo
let
extLines
=
map
(
":extension "
++
)
$
extensions
initInfo
noPublish
_
=
return
()
noPublish
_
=
return
()
evaluator
line
=
do
evaluator
line
=
void
$
do
-- Create a new state each time.
-- Create a new state each time.
stateVar
<-
liftIO
initialKernelState
stateVar
<-
liftIO
initialKernelState
state
<-
liftIO
$
takeMVar
stateVar
state
<-
liftIO
$
takeMVar
stateVar
evaluate
state
line
noPublish
evaluate
state
line
noPublish
mapM
evaluator
extLines
mapM
_
evaluator
extLines
mapM
evaluator
$
initCells
initInfo
mapM
_
evaluator
$
initCells
initInfo
forever
$
do
forever
$
do
-- Read the request from the request channel.
-- Read the request from the request channel.
...
@@ -335,8 +335,9 @@ replyTo interface req@ExecuteRequest{ getCode = code } replyHeader state = do
...
@@ -335,8 +335,9 @@ replyTo interface req@ExecuteRequest{ getCode = code } replyHeader state = do
-- If this has some pager output, store it for later.
-- If this has some pager output, store it for later.
let
pager
=
pagerOut
result
let
pager
=
pagerOut
result
unless
(
null
pager
)
$
unless
(
null
pager
)
$
modifyMVar_
pagerOutput
(
return
.
(
++
pager
++
"
\n
"
))
if
usePager
state
then
modifyMVar_
pagerOutput
(
return
.
(
++
pager
++
"
\n
"
))
else
sendOutput
$
Display
[
html
pager
]
let
execCount
=
getExecutionCounter
state
let
execCount
=
getExecutionCounter
state
-- Let all frontends know the execution count and code that's about to run
-- Let all frontends know the execution count and code that's about to run
...
@@ -350,7 +351,10 @@ replyTo interface req@ExecuteRequest{ getCode = code } replyHeader state = do
...
@@ -350,7 +351,10 @@ replyTo interface req@ExecuteRequest{ getCode = code } replyHeader state = do
idleHeader
<-
liftIO
$
dupHeader
replyHeader
StatusMessage
idleHeader
<-
liftIO
$
dupHeader
replyHeader
StatusMessage
send
$
PublishStatus
idleHeader
Idle
send
$
PublishStatus
idleHeader
Idle
pager
<-
liftIO
$
readMVar
pagerOutput
-- Take pager output if we're using the pager.
pager
<-
if
usePager
state
then
liftIO
$
readMVar
pagerOutput
else
return
""
return
(
updatedState
,
ExecuteReply
{
return
(
updatedState
,
ExecuteReply
{
header
=
replyHeader
,
header
=
replyHeader
,
pagerOutput
=
pager
,
pagerOutput
=
pager
,
...
...
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