File tree Expand file tree Collapse file tree 2 files changed +25
-8
lines changed
Expand file tree Collapse file tree 2 files changed +25
-8
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,9 @@ Local Open Scope list.
1616
1717Definition C := C.t Api.effect.
1818
19+ Definition unquote (field_content : LString.t) : LString.t :=
20+ List.removelast (List.tl field_content).
21+
1922Definition get_version (name version : LString.t) : C Version.t :=
2023 let full_name := name ++ LString.s "." ++ version in
2124 let get_field field := Api.opam_field (LString.s field) full_name in
@@ -31,10 +34,10 @@ Definition get_version (name version : LString.t) : C Version.t :=
3134 ret @@ Version.New
3235 version
3336 description
34- license
35- homepage
36- bug
37- url
37+ (unquote license)
38+ (unquote homepage)
39+ (unquote bug)
40+ (unquote url)
3841 dependencies
3942 end .
4043
Original file line number Diff line number Diff line change 1+ Require Import Coq.Lists.List.
12Require Import Io.All .
23Require Io.List.
34Require Import ListString.All .
@@ -7,16 +8,29 @@ Require Import Model.
78
89Import Io.Run.
910
11+ Definition quote (field_content : LString.t) : LString.t :=
12+ LString.s """" ++ field_content ++ LString.s """".
13+
14+ Lemma unquote_quote (field_content : LString.t) : Main.unquote (quote field_content) = field_content.
15+ unfold Main.unquote, quote.
16+ simpl.
17+ rewrite List.removelast_app.
18+ - rewrite List.app_nil_r; reflexivity.
19+ - congruence.
20+ Qed .
21+
1022Definition get_version (name : LString.t) (version : Version.t)
1123 : Run.t (Main.get_version name (Version.version version)) version.
1224 eapply Let .
1325 - eapply (Join (Api.Run.opam_field (LString.s "synopsis") _ (Version.description version))).
14- eapply (Join (Api.Run.opam_field (LString.s "license:") _ (Version.license version))).
15- eapply (Join (Api.Run.opam_field (LString.s "homepage:") _ (Version.homepage version))).
16- eapply (Join (Api.Run.opam_field (LString.s "bug-reports:") _ (Version.bug version))).
17- eapply (Join (Api.Run.opam_field (LString.s "url.src:") _ (Version.url version))).
26+ eapply (Join (Api.Run.opam_field (LString.s "license:") _ (quote ( Version.license version) ))).
27+ eapply (Join (Api.Run.opam_field (LString.s "homepage:") _ (quote ( Version.homepage version) ))).
28+ eapply (Join (Api.Run.opam_field (LString.s "bug-reports:") _ (quote ( Version.bug version) ))).
29+ eapply (Join (Api.Run.opam_field (LString.s "url.src:") _ (quote ( Version.url version) ))).
1830 apply (Api.Run.opam_field (LString.s "depends:") _ (Version.dependencies version)).
1931 - destruct version.
32+ simpl.
33+ repeat rewrite unquote_quote.
2034 apply Ret.
2135Defined .
2236
You can’t perform that action at this time.
0 commit comments