Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
why3
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
Model registry
Operate
Environments
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
Nils Fitinghoff
why3
Commits
3b45464e
Commit
3b45464e
authored
6 years ago
by
Andrei Paskevich
Browse files
Options
Downloads
Patches
Plain Diff
Pretty: do not print qualifiers for the built-in symbols
parent
dc0b56b0
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/core/pretty.ml
+24
-52
24 additions, 52 deletions
src/core/pretty.ml
with
24 additions
and
52 deletions
src/core/pretty.ml
+
24
−
52
View file @
3b45464e
...
@@ -163,72 +163,44 @@ let print_ls fmt ls =
...
@@ -163,72 +163,44 @@ let print_ls fmt ls =
let
print_pr
fmt
pr
=
let
print_pr
fmt
pr
=
Ident
.
print_decoded
fmt
(
id_unique
pprinter
pr
.
pr_name
)
Ident
.
print_decoded
fmt
(
id_unique
pprinter
pr
.
pr_name
)
let
print_library_path
fmt
lp
=
let
print_qualified
decode
fmt
id
=
(* if Debug.test_noflag debug_print_qualifs then raise Not_found; *)
let
dot
fmt
()
=
pp_print_char
fmt
'.'
;
pp_print_cut
fmt
()
in
let
str
fmt
s
=
let
str
fmt
s
=
if
String
.
contains
s
'
'
||
String
.
contains
s
'.'
then
begin
if
String
.
contains
s
'
'
||
String
.
contains
s
'.'
then
begin
pp_print_char
fmt
'
"'; pp_print_string fmt s; pp_print_char fmt '"
'
pp_print_char
fmt
'
"'; pp_print_string fmt s; pp_print_char fmt '"
'
end
else
pp_print_string
fmt
s
in
end
else
pp_print_string
fmt
s
;
let
dot
fmt
()
=
dot
fmt
()
in
pp_print_char
fmt
'.'
;
pp_print_cut
fmt
()
in
let
lp
,
tn
,
qn
=
Theory
.
restore_path
id
(* raises Not_found *)
in
if
lp
<>
[]
then
begin
let
qn
=
match
lp
with
print_list
dot
str
fmt
lp
;
dot
fmt
()
|
"why3"
::_
->
if
qn
=
[]
then
[
tn
]
(* theory *)
else
qn
end
|
_
->
print_list
Pp
.
nothing
str
fmt
lp
;
tn
::
qn
in
if
decode
then
match
List
.
rev
qn
with
let
print_qualified_name
fmt
qn
=
|
[
sn
]
->
let
dot
fmt
()
=
Ident
.
print_decoded
fmt
sn
pp_print_char
fmt
'.'
;
pp_print_cut
fmt
()
in
if
qn
<>
[]
then
begin
dot
fmt
()
;
print_list
dot
pp_print_string
fmt
qn
end
let
print_decoded_name
fmt
qn
=
match
List
.
rev
qn
with
|
sn
::
qn
->
|
sn
::
qn
->
print_qualified_name
fmt
(
List
.
rev
qn
);
print_list
dot
pp_print_string
fmt
(
List
.
rev
qn
);
dot
fmt
()
;
pp_print_char
fmt
'.'
;
pp_print_cut
fmt
()
;
Ident
.
print_decoded
fmt
sn
Ident
.
print_decoded
fmt
sn
|
[]
->
()
|
[]
->
()
else
print_list
dot
pp_print_string
fmt
qn
let
print_th_qualified
fmt
th
=
let
print_th_qualified
fmt
th
=
(* if Debug.test_flag debug_print_qualifs then begin *)
try
print_qualified
false
fmt
th
.
th_name
with
Not_found
->
print_th
fmt
th
try
let
lp
,
tn
,_
=
Theory
.
restore_path
th
.
th_name
in
fprintf
fmt
"%a%s"
print_library_path
lp
tn
with
Not_found
->
print_th
fmt
th
(* end else print_th fmt th *)
let
print_ts_qualified
fmt
ts
=
let
print_ts_qualified
fmt
ts
=
if
ts_equal
ts
ts_func
then
pp_print_string
fmt
"(->)"
else
if
ts_equal
ts
ts_func
then
pp_print_string
fmt
"(->)"
else
(* if Debug.test_flag debug_print_qualifs then begin *)
try
print_qualified
false
fmt
ts
.
ts_name
with
Not_found
->
print_ts
fmt
ts
try
let
lp
,
tn
,
qn
=
Theory
.
restore_path
ts
.
ts_name
in
fprintf
fmt
"%a%s%a"
print_library_path
lp
tn
print_qualified_name
qn
with
Not_found
->
print_ts
fmt
ts
(* end else print_ts fmt ts *)
let
print_cs_qualified
fmt
ls
=
let
print_cs_qualified
fmt
ls
=
(* if Debug.test_flag debug_print_qualifs then begin *)
try
print_qualified
false
fmt
ls
.
ls_name
with
Not_found
->
print_cs
fmt
ls
try
let
lp
,
tn
,
qn
=
Theory
.
restore_path
ls
.
ls_name
in
fprintf
fmt
"%a%s%a"
print_library_path
lp
tn
print_qualified_name
qn
with
Not_found
->
print_cs
fmt
ls
(* end else print_cs fmt ls *)
let
print_ls_qualified
fmt
ls
=
let
print_ls_qualified
fmt
ls
=
(* if Debug.test_flag debug_print_qualifs then begin *)
try
print_qualified
true
fmt
ls
.
ls_name
with
Not_found
->
print_ls
fmt
ls
try
let
lp
,
tn
,
qn
=
Theory
.
restore_path
ls
.
ls_name
in
fprintf
fmt
"%a%s%a"
print_library_path
lp
tn
print_decoded_name
qn
with
Not_found
->
print_ls
fmt
ls
(* end else print_ls fmt ls *)
let
print_pr_qualified
fmt
pr
=
let
print_pr_qualified
fmt
pr
=
(* if Debug.test_flag debug_print_qualifs then begin *)
try
print_qualified
true
fmt
pr
.
pr_name
with
Not_found
->
print_pr
fmt
pr
try
let
lp
,
tn
,
qn
=
Theory
.
restore_path
pr
.
pr_name
in
fprintf
fmt
"%a%s%a"
print_library_path
lp
tn
print_decoded_name
qn
with
Not_found
->
print_pr
fmt
pr
(* end else print_pr fmt pr *)
(** Types *)
(** Types *)
...
...
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