Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
general
stups
ProB 2 Jupyter Kernel
Commits
dcec9077
Commit
dcec9077
authored
Nov 08, 2021
by
dgelessus
Browse files
Fix source code not being shown in :type errors
parent
83361fe2
Pipeline
#73950
passed with stage
in 1 minute and 56 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/de/prob2/jupyter/commands/TypeCommand.java
View file @
dcec9077
...
...
@@ -68,12 +68,14 @@ public final class TypeCommand implements Command {
final
ProBKernel
kernel
=
this
.
kernelProvider
.
get
();
final
Trace
trace
=
this
.
animationSelector
.
getCurrentTrace
();
final
IEvalElement
formula
=
kernel
.
parseFormula
(
args
.
get
(
FORMULA_PARAM
),
FormulaExpand
.
EXPAND
);
final
TypeCheckResult
result
=
trace
.
getStateSpace
().
typeCheck
(
formula
);
if
(
result
.
isOk
())
{
return
new
DisplayData
(
result
.
getType
());
}
else
{
throw
new
ProBError
(
"Type errors in formula"
,
result
.
getErrors
());
}
return
CommandUtils
.
withSourceCode
(
formula
,
()
->
{
final
TypeCheckResult
result
=
trace
.
getStateSpace
().
typeCheck
(
formula
);
if
(
result
.
isOk
())
{
return
new
DisplayData
(
result
.
getType
());
}
else
{
throw
new
ProBError
(
"Type errors in formula"
,
result
.
getErrors
());
}
});
}
@Override
...
...
Write
Preview
Supports
Markdown
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