Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Why3
why3
Commits
eed376ad
Commit
eed376ad
authored
Feb 24, 2012
by
Guillaume Melquiond
Browse files
Add backward-compatibility for scripts using (* YOU MAY EDIT *) comments.
parent
a8514e62
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/printer/coq.ml
View file @
eed376ad
...
...
@@ -417,6 +417,27 @@ let read_old_proof =
Query
(
name
,
Vernacular
,
s
)
with
StringValue
s
->
Other
s
(* Load old-style proofs where users were confined to a few sections. *)
let
read_deprecated_script
ch
=
let
sc
=
ref
[]
in
let
context
=
ref
true
in
try
while
true
do
let
pos
=
pos_in
ch
in
let
s
=
input_line
ch
in
if
!
context
then
if
s
=
"(* DO NOT EDIT BELOW *)"
then
context
:=
false
else
sc
:=
Other
s
::
!
sc
else
if
s
<>
""
then
begin
seek_in
ch
pos
;
sc
:=
read_old_proof
ch
::
Other
""
::
!
sc
;
raise
End_of_file
end
done
;
assert
false
with
|
End_of_file
->
!
sc
let
read_old_script
=
let
axm
=
Str
.
regexp
"
\\
(Axiom
\\
|Parameter
\\
)[ ]+
\\
([^ :(.]+
\\
)"
in
fun
ch
->
...
...
@@ -433,6 +454,8 @@ let read_old_script =
(
let
name
=
Str
.
matched_group
2
s
in
sc
:=
Axiom
name
::
!
sc
;
skip_to_empty
:=
true
)
else
if
s
=
"(* Why3 goal *)"
then
sc
:=
read_old_proof
ch
::
!
sc
else
if
s
=
"(* YOU MAY EDIT THE CONTEXT BELOW *)"
then
(
sc
:=
read_deprecated_script
ch
;
raise
End_of_file
)
else
sc
:=
Other
s
::
!
sc
done
;
assert
false
...
...
Write
Preview
Markdown
is supported
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