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
8f88fee6
Commit
8f88fee6
authored
13 years ago
by
Régis Blanc
Browse files
Options
Downloads
Patches
Plain Diff
adding tree support and printing
parent
f6fc0c92
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/scala/leon/purescala/PrettyPrinter.scala
+7
-1
7 additions, 1 deletion
src/main/scala/leon/purescala/PrettyPrinter.scala
src/main/scala/leon/purescala/Trees.scala
+3
-0
3 additions, 0 deletions
src/main/scala/leon/purescala/Trees.scala
with
10 additions
and
1 deletion
src/main/scala/leon/purescala/PrettyPrinter.scala
+
7
−
1
View file @
8f88fee6
...
...
@@ -81,7 +81,12 @@ object PrettyPrinter {
case
IntLiteral
(
v
)
=>
sb
.
append
(
v
)
case
BooleanLiteral
(
v
)
=>
sb
.
append
(
v
)
case
StringLiteral
(
s
)
=>
sb
.
append
(
"\""
+
s
+
"\""
)
case
Tuple
(
exprs
)
=>
ppNary
(
sb
,
exprs
,
"("
,
", "
,
")"
,
lvl
)
case
TupleSelect
(
t
,
i
)
=>
{
pp
(
t
,
sb
,
lvl
)
sb
.
append
(
"._"
+
i
)
sb
}
case
OptionSome
(
a
)
=>
{
var
nsb
=
sb
nsb
.
append
(
"Some("
)
...
...
@@ -297,6 +302,7 @@ object PrettyPrinter {
nsb
.
append
(
" => "
)
pp
(
tt
,
nsb
,
lvl
)
}
case
TupleType
(
tpes
)
=>
ppNaryType
(
sb
,
tpes
,
"("
,
", "
,
")"
,
lvl
)
case
c
:
ClassType
=>
sb
.
append
(
c
.
classDef
.
id
)
case
_
=>
sb
.
append
(
"Type?"
)
}
...
...
This diff is collapsed.
Click to expand it.
src/main/scala/leon/purescala/Trees.scala
+
3
−
0
View file @
8f88fee6
...
...
@@ -37,6 +37,7 @@ object Trees {
case
class
IfExpr
(
cond
:
Expr
,
then
:
Expr
,
elze
:
Expr
)
extends
Expr
case
class
Tuple
(
exprs
:
Seq
[
Expr
])
extends
Expr
case
class
TupleSelect
(
tuple
:
Expr
,
index
:
Int
)
extends
Expr
object
MatchExpr
{
def
apply
(
scrutinee
:
Expr
,
cases
:
Seq
[
MatchCase
])
:
MatchExpr
=
{
...
...
@@ -359,6 +360,7 @@ object Trees {
case
SetMax
(
s
)
=>
Some
((
s
,
SetMax
))
case
CaseClassSelector
(
cd
,
e
,
sel
)
=>
Some
((
e
,
CaseClassSelector
(
cd
,
_
,
sel
)))
case
CaseClassInstanceOf
(
cd
,
e
)
=>
Some
((
e
,
CaseClassInstanceOf
(
cd
,
_
)))
case
TupleSelect
(
t
,
i
)
=>
Some
((
t
,
TupleSelect
(
_
,
i
)))
case
_
=>
None
}
}
...
...
@@ -410,6 +412,7 @@ object Trees {
case
FiniteMap
(
args
)
=>
Some
((
args
,
(
as
:
Seq
[
Expr
])
=>
FiniteMap
(
as
.
asInstanceOf
[
Seq
[
SingletonMap
]])))
case
FiniteMultiset
(
args
)
=>
Some
((
args
,
FiniteMultiset
))
case
Distinct
(
args
)
=>
Some
((
args
,
Distinct
))
case
Tuple
(
args
)
=>
Some
((
args
,
Tuple
))
case
_
=>
None
}
}
...
...
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