Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
inox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LARA
inox
Commits
b9ba429d
Commit
b9ba429d
authored
11 years ago
by
Emmanouil (Manos) Koukoutos
Browse files
Options
Downloads
Patches
Plain Diff
Support for internal errors
parent
bde52498
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/scala/leon/Reporter.scala
+17
-3
17 additions, 3 deletions
src/main/scala/leon/Reporter.scala
with
17 additions
and
3 deletions
src/main/scala/leon/Reporter.scala
+
17
−
3
View file @
b9ba429d
...
...
@@ -16,6 +16,7 @@ abstract class Reporter(settings: Settings) {
case
object
WARNING
extends
Severity
case
object
ERROR
extends
Severity
case
object
FATAL
extends
Severity
case
object
INTERNAL
extends
Severity
case
class
DEBUG
(
section
:
DebugSection
)
extends
Severity
case
class
Message
(
severity
:
Severity
,
position
:
Position
,
msg
:
Any
);
...
...
@@ -28,9 +29,9 @@ abstract class Reporter(settings: Settings) {
def
account
(
msg
:
Message
)
:
Message
=
{
msg
.
severity
match
{
case
WARNING
=>
_warningCount
+=
1
case
ERROR
|
FATAL
=>
_errorCount
+=
1
case
_
=>
case
WARNING
=>
_warningCount
+=
1
case
ERROR
|
FATAL
|
INTERNAL
=>
_errorCount
+=
1
case
_
=>
}
msg
...
...
@@ -50,6 +51,15 @@ abstract class Reporter(settings: Settings) {
emit
(
account
(
Message
(
FATAL
,
pos
,
msg
)))
onFatal
()
}
final
def
internalError
(
pos
:
Position
,
msg
:
Any
)
:
Nothing
=
{
emit
(
account
(
Message
(
INTERNAL
,
pos
,
msg
.
toString
+
"\nPlease inform the authors of Leon about this message"
)))
onFatal
()
}
final
def
internalAssertion
(
cond
:
Boolean
,
pos
:
Position
,
msg
:
Any
)
:
Unit
=
{
if
(!
cond
)
internalError
(
pos
,
msg
)
}
def
terminateIfError
()
=
{
if
(
errorCount
>
0
)
{
...
...
@@ -87,6 +97,8 @@ abstract class Reporter(settings: Settings) {
final
def
warning
(
msg
:
Any
)
:
Unit
=
warning
(
NoPosition
,
msg
)
final
def
error
(
msg
:
Any
)
:
Unit
=
error
(
NoPosition
,
msg
)
final
def
fatalError
(
msg
:
Any
)
:
Nothing
=
fatalError
(
NoPosition
,
msg
)
final
def
internalError
(
msg
:
Any
)
:
Nothing
=
internalError
(
NoPosition
,
msg
)
final
def
internalAssertion
(
cond
:
Boolean
,
msg
:
Any
)
:
Unit
=
internalAssertion
(
cond
,
NoPosition
,
msg
)
final
def
debug
(
msg
:
=>
Any
)(
implicit
section
:
DebugSection
)
:
Unit
=
debug
(
NoPosition
,
msg
)
}
...
...
@@ -96,6 +108,7 @@ class DefaultReporter(settings: Settings) extends Reporter(settings) {
case
WARNING
=>
"["
+
Console
.
YELLOW
+
"Warning"
+
Console
.
RESET
+
"]"
case
INFO
=>
"["
+
Console
.
BLUE
+
" Info "
+
Console
.
RESET
+
"]"
case
FATAL
=>
"["
+
Console
.
RED
+
Console
.
BOLD
+
" Fatal "
+
Console
.
RESET
+
"]"
case
INTERNAL
=>
"["
+
Console
.
BOLD
+
"Internal"
+
Console
.
RESET
+
"]"
case
DEBUG
(
_
)
=>
"["
+
Console
.
MAGENTA
+
" Debug "
+
Console
.
RESET
+
"]"
}
...
...
@@ -163,4 +176,5 @@ class DefaultReporter(settings: Settings) extends Reporter(settings) {
protected
def
reline
(
pfx
:
String
,
msg
:
String
)
:
String
=
{
pfx
+
" "
+
msg
.
replaceAll
(
"\n"
,
"\n"
+
(
" "
*
prefixSize
))
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment