This repository has been archived by the owner on Nov 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathsnippets.json
97 lines (97 loc) · 2.09 KB
/
snippets.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
{
"Reach starter": {
"prefix": "reach",
"body": [
"'reach 0.1';",
"",
"export const main = Reach.App(() => {",
" const A = Participant('A', {});",
" deploy();",
" $0",
"});",
""
],
"description": "Simple Reach program"
},
"Only - Local Step": {
"prefix": "only",
"body": [
"${1:Participant}.only(() => {${0:LocalStep}});"
],
"description": "Have a participant perform actions."
},
"Declassify": {
"prefix": "declassify_interact",
"body": [
"declassify(interact.${1:Field})${0}"
],
"description": "Declasify an interact value"
},
"Each - Local Step": {
"prefix": "each",
"body": [
"each([${1:Participants}], () => ${0:LocalStep});"
],
"description": "Have multiple participants perform actions."
},
"Publish": {
"prefix": "publish",
"body": [
"${1:Participant}.publish(${0:Variables});"
],
"description": "Have a Participant make a publication"
},
"Parallel Reduce": {
"prefix": "parallelReduce",
"body": [
"parallelReduce([ ${1:INIT_EXPR} ])",
" .invariant(${2:INVARIANT_EXPR})",
" .while(${3:COND_EXPR})",
" .case(${4:PART_EXPR},",
" (() => ({",
" when: ${5:PUBLISH_WHEN_EXPR},",
" msg: ${6:PUBLISH_MSG_EXPR}",
" })),",
" ((msg) => ${7:PAY_EXPR}),",
" ((msg) => {",
" ${8:CONSENSUS_EXPR}",
" }))",
" .timeout(${9:DEADLINE}, () => {",
" ${10:TIMEOUT_BLOCK}",
" });"
],
"description": "parallelReduce"
},
"While Loop": {
"prefix": "while",
"body": [
"var ${1:LHS} = ${2:INIT_EXPR};",
"invariant(${3:INVARIANT_EXPR});",
"while(${4:COND_EXPR}) {",
" ${5:BLOCK}",
"}"
],
"description": "while"
},
"Participant": {
"prefix": "Participant",
"body": [
"Participant('${1:NAME}', { ${0} })"
],
"description": "Participant constructor"
},
"Participant Class": {
"prefix": "ParticipantClass",
"body": [
"ParticipantClass('${1:NAME}', { ${0} })"
],
"description": "Participant Class constructor"
},
"View": {
"prefix": "View",
"body": [
"View('${1:NAME}', { ${0} })"
],
"description": "View constructor"
}
}