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
2456f05f
Commit
2456f05f
authored
10 years ago
by
Manos Koukoutos
Committed by
Etienne Kneuss
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Some cosmetic changes in Main
parent
4e238ff0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/scala/leon/Main.scala
+16
-14
16 additions, 14 deletions
src/main/scala/leon/Main.scala
with
16 additions
and
14 deletions
src/main/scala/leon/Main.scala
+
16
−
14
View file @
2456f05f
...
...
@@ -45,7 +45,7 @@ object Main {
lazy
val
allOptions
=
allComponents
.
flatMap
(
_
.
definedOptions
)
++
topLevelOptions
def
displayHelp
(
reporter
:
Reporter
)
{
def
displayHelp
(
reporter
:
Reporter
,
error
:
Boolean
)
{
reporter
.
info
(
"usage: leon [--xlang] [--termination] [--synthesis] [--help] [--debug=<N>] [..] <files>"
)
reporter
.
info
(
""
)
for
(
opt
<-
topLevelOptions
.
toSeq
.
sortBy
(
_
.
name
))
{
...
...
@@ -63,9 +63,11 @@ object Main {
reporter
.
info
(
f
"${opt.usageOption}%-20s ${opt.usageDesc}"
)
}
}
sys
.
exit
(
1
)
exit
(
error
)
}
private
def
exit
(
error
:
Boolean
)
=
sys
.
exit
(
if
(
error
)
1
else
0
)
def
processOptions
(
args
:
Seq
[
String
])
:
LeonContext
=
{
val
initReporter
=
new
DefaultReporter
(
Settings
())
...
...
@@ -129,7 +131,7 @@ object Main {
Some
(
LeonFlagOption
(
fod
.
name
,
v
))
case
None
=>
initReporter
.
error
(
"Invalid option usage: --"
+
fod
.
name
+
"="
+
value
)
displayHelp
(
initReporter
)
displayHelp
(
initReporter
,
error
=
true
)
None
}
case
(
vod
:
LeonValueOptionDef
,
value
)
=>
...
...
@@ -174,7 +176,7 @@ object Main {
case
LeonFlagOption
(
"noop"
,
true
)
=>
settings
=
settings
.
copy
(
verify
=
false
)
case
LeonFlagOption
(
"help"
,
true
)
=>
displayHelp
(
initReporter
)
displayHelp
(
initReporter
,
error
=
false
)
case
_
=>
}
...
...
@@ -204,6 +206,8 @@ object Main {
def
computePipeline
(
settings
:
Settings
)
:
Pipeline
[
List
[
String
]
,
Any
]
=
{
import
purescala.Definitions.Program
import
purescala.
{
FunctionClosure
,
RestoreMethods
}
import
utils.FileOutputPhase
import
frontends.scalac.ExtractionPhase
import
synthesis.SynthesisPhase
import
termination.TerminationPhase
...
...
@@ -232,9 +236,9 @@ object Main {
}
else
if
(
settings
.
xlang
)
{
XLangAnalysisPhase
}
else
if
(
settings
.
verify
)
{
purescala
.
FunctionClosure
andThen
AnalysisPhase
FunctionClosure
andThen
AnalysisPhase
}
else
{
purescala
.
RestoreMethods
andThen
utils
.
FileOutputPhase
RestoreMethods
andThen
FileOutputPhase
}
}
...
...
@@ -242,7 +246,7 @@ object Main {
pipeProcess
}
private
var
hasFatal
=
false
;
private
var
hasFatal
=
false
def
main
(
args
:
Array
[
String
])
{
val
argsl
=
args
.
toList
...
...
@@ -250,9 +254,10 @@ object Main {
// Process options
val
ctx
=
try
{
processOptions
(
argsl
)
}
catch
{
case
LeonFatalError
(
None
)
=>
sys
.
exit
(
1
)
exit
(
error
=
true
)
case
LeonFatalError
(
Some
(
msg
))
=>
// For the special case of fatal errors not sent though Reporter, we
...
...
@@ -263,7 +268,7 @@ object Main {
case
_:
LeonFatalError
=>
}
sys
.
exit
(
1
)
exit
(
error
=
true
)
}
ctx
.
interruptManager
.
registerSignalHandler
()
...
...
@@ -282,11 +287,7 @@ object Main {
execute
(
args
,
ctx
)
}
if
(
hasFatal
)
{
sys
.
exit
(
1
)
}
else
{
sys
.
exit
(
0
)
}
exit
(
hasFatal
)
}
def
execute
(
args
:
Seq
[
String
],
ctx0
:
LeonContext
)
:
Unit
=
{
...
...
@@ -314,6 +315,7 @@ object Main {
ctx
.
reporter
.
whenDebug
(
DebugSectionTimers
)
{
debug
=>
ctx
.
timers
.
outputTable
(
debug
)
}
hasFatal
=
false
}
catch
{
case
LeonFatalError
(
None
)
=>
hasFatal
=
true
...
...
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