Debian Codegraph @

apps/json/examples/usage_json.v

raw
1 From elpi Require Import elpi json.
2
3 From elpi.json.tests Extra Dependency "test.json" as json_test_file.
4
5 Elpi Command hello_json.
6 Elpi Accumulate Plugin "json.elpi".
7 Elpi Accumulate lp:{{
8 main [str D] :-
9 std.assert-ok! (coq.extra-dep->json D J) "bad file",
10 coq.say "json AST:" J,
11 coq.json->string J S,
12 coq.say "pretty:" S,
13 coq.string->json S J',
14 coq.say "json AST:" J',
15 std.assert! (J = J') "this would be bad".
16 }}.
17 Elpi Export hello_json.
18
19 hello_json "json_test_file".