17
17
[" parallel" ,
18
18
[" lockjson/add" ,
19
19
[" repos/get" , " github.com/tyru/open-browser.vim" ],
20
- [" @ " , " default" ]],
20
+ [" $array " , " default" ]],
21
21
[" plugconf/install" , " github.com/tyru/open-browser.vim" ]]],
22
22
[" label" ,
23
23
3 ,
24
24
" github.com/tyru/open-browser-github.vim ... {{if .Done}}done!{{end}}" ,
25
25
[" parallel" ,
26
26
[" lockjson/add" ,
27
27
[" repos/get" , " github.com/tyru/open-browser-github.vim" ],
28
- [" @ " , " default" ]],
28
+ [" $array " , " default" ]],
29
29
[" plugconf/install" , " github.com/tyru/open-browser-github.vim" ]]]]]]
30
30
```
31
31
36
36
* e.g. "label"
37
37
* e.g. "parallel"
38
38
* macro: like function, but is expanded before execution
39
- * e.g. "@ "
39
+ * e.g. "$array "
40
40
* expression: the form of operator application
41
41
* e.g. ` ["label", ...] `
42
42
* e.g. ` ["parallel", ...] `
@@ -98,10 +98,10 @@ JSON DSL is a S-expression like DSL represented as JSON format.
98
98
```
99
99
100
100
This is an application form (called "expression" in this note).
101
- An array literal value is written using ` @ ` operator.
101
+ An array literal value is written using ` $array ` operator.
102
102
103
103
``` json
104
- [" @ " , 1 , 2 , 3 ]
104
+ [" $array " , 1 , 2 , 3 ]
105
105
```
106
106
107
107
This expression is evaluated to ` [1, 2, 3] ` .
@@ -173,7 +173,7 @@ version for easiness).
173
173
[" do" ,
174
174
[" lockjson/add" ,
175
175
[" repos/get" , " github.com/tyru/caw.vim" ],
176
- [" @ " , " default" ]],
176
+ [" $array " , " default" ]],
177
177
[" plugconf/install" , " github.com/tyru/caw.vim" ]]]
178
178
```
179
179
@@ -188,7 +188,7 @@ At first, to invert the expression, `$invert` macro is used:
188
188
[" do" ,
189
189
[" lockjson/add" ,
190
190
[" repos/get" , " github.com/tyru/caw.vim" ],
191
- [" @ " , " default" ]],
191
+ [" $array " , " default" ]],
192
192
[" plugconf/install" , " github.com/tyru/caw.vim" ]]]]
193
193
```
194
194
@@ -203,7 +203,7 @@ API" section.
203
203
[" do" ,
204
204
[" lockjson/add" ,
205
205
[" repos/get" , " github.com/tyru/caw.vim" ],
206
- [" @ " , " default" ]],
206
+ [" $array " , " default" ]],
207
207
[" plugconf/install" , " github.com/tyru/caw.vim" ]]]]
208
208
```
209
209
@@ -219,7 +219,7 @@ Note that `expr1` and `expr2` becomes reversed order.
219
219
[" $invert" ,
220
220
[" lockjson/add" ,
221
221
[" repos/get" , " github.com/tyru/caw.vim" ],
222
- [" @ " , " default" ]]]]]
222
+ [" $array " , " default" ]]]]]
223
223
```
224
224
225
225
And
234
234
[" plugconf/delete" , [" $invert" , " github.com/tyru/caw.vim" ]],
235
235
[" lockjson/remove" ,
236
236
[" $invert" , [" repos/get" , " github.com/tyru/caw.vim" ]],
237
- [" $invert" , [" @ " , " default" ]]]]]
237
+ [" $invert" , [" $array " , " default" ]]]]]
238
238
```
239
239
240
240
` ["$invert", ["repos/get", path]] ` becomes
246
246
[" plugconf/delete" , [" $invert" , " github.com/tyru/caw.vim" ]],
247
247
[" lockjson/remove" ,
248
248
[" repos/delete" , [" $invert" , " github.com/tyru/caw.vim" ]],
249
- [" $invert" , [" @ " , " default" ]]]]]
249
+ [" $invert" , [" $array " , " default" ]]]]]
250
250
```
251
251
252
252
And if ` $invert ` is applied to literals like string, JSON array, it just remains
@@ -258,7 +258,7 @@ as-is.
258
258
[" plugconf/delete" , " github.com/tyru/caw.vim" ],
259
259
[" lockjson/remove" ,
260
260
[" repos/delete" , " github.com/tyru/caw.vim" ],
261
- [" @ " , " default" ]]]]
261
+ [" $array " , " default" ]]]]
262
262
```
263
263
264
264
We can successfully evaluate the inverse expression of the first expression :)
@@ -322,7 +322,7 @@ TODO: Move to Godoc.
322
322
All macros has `$` prefixed name for readability.
323
323
Macros are not saved in transaction log (expanded before saving).
324
324
325
- * `["@ ", v1 Value, ...] Array`
325
+ * `["$array ", v1 Value, ...] Array`
326
326
* Returns inverse expression of given expression.
327
327
* Internally, this macro calls `InvertExpr()` method of each operator struct.
328
328
* What value is returned depends on each operator's `InvertExpr()`
@@ -334,7 +334,7 @@ Macros are not saved in transaction log (expanded before saving).
334
334
* What value is returned depends on each operator's `InvertExpr()`
335
335
implementation.
336
336
337
- * `["$eval ", expr Expr[* => *]] Expr[* => *] `
337
+ * `["$expand-macro ", expr Value] Value `
338
338
* Evaluate `expr` at parsing time.
339
339
This is useful to save evaluated value to transaction log,
340
340
instead of its expression.
@@ -416,9 +416,9 @@ Macros are not saved in transaction log (expanded before saving).
416
416
{target_hash}`
417
417
* It does nothing for bare git repository.
418
418
* e.g.
419
- * ` [" repos/git/update" , " github.com/tyru/caw.vim" , [" $eval " , [" repos/git/rev-parse" , " HEAD" , " github.com/tyru/caw.vim" ]], [" $eval " , [" repos/git/fetch" , " github.com/tyru/caw.vim" ]]]`
419
+ * ` [" repos/git/update" , " github.com/tyru/caw.vim" , [" $expand-macro " , [" repos/git/rev-parse" , " HEAD" , " github.com/tyru/caw.vim" ]], [" $expand-macro " , [" repos/git/fetch" , " github.com/tyru/caw.vim" ]]]`
420
420
* To save evaluated hash string in transaction log instead of its
421
- expression, apply ` $eval ` to ` repos/git/fetch` expression.
421
+ expression, apply ` $expand-macro ` to ` repos/git/fetch` expression.
422
422
* ` [" $invert" , [" repos/git/update" , path, target_hash, prev_hash]]` = ` [" repos/git/update" , [" $invert" , path], [" $invert" , prev_hash], [" $invert" , target_hash]]`
423
423
424
424
* ` [" repos/git/rev-parse" , str string , path ReposPath ] hash string `
@@ -437,7 +437,7 @@ Macros are not saved in transaction log (expanded before saving).
437
437
* It fails if specified profile name does not exist.
438
438
* Need to create profile before using ` lockjson/profile/add` .
439
439
* e.g.
440
- * ` [" lockjson/add" , [" repos/get" , " github.com/tyru/caw.vim" ], [" @ " , " default" ]]`
440
+ * ` [" lockjson/add" , [" repos/get" , " github.com/tyru/caw.vim" ], [" $array " , " default" ]]`
441
441
* ` [" $invert" , [" lockjson/add" , repos, profiles]]` = ` [" lockjson/remove" , [" $invert" , repos], [" $invert" , profiles]]`
442
442
443
443
* ` [" lockjson/profile/add" , name string ] Profile `
@@ -500,7 +500,7 @@ directory:
500
500
" path" : " github.com/tyru/caw.vim" ,
501
501
" version" : " deadbeefcafebabe"
502
502
},
503
- [" @ " , " default" ]
503
+ [" $array " , " default" ]
504
504
],
505
505
[" repos/delete" , " github.com/tyru/caw.vim" ],
506
506
[" plugconf/delete" , " github.com/tyru/caw.vim" ],
@@ -522,7 +522,7 @@ And below is the inverse expression of above.
522
522
"path" : " github.com/tyru/caw.vim" ,
523
523
"version" : " deadbeefcafebabe"
524
524
},
525
- [" @ " , " default" ]
525
+ [" $array " , " default" ]
526
526
]
527
527
]
528
528
```
@@ -550,7 +550,7 @@ This is what we expected.
550
550
"path" : " github.com/tyru/caw.vim" ,
551
551
"version" : " deadbeefcafebabe"
552
552
},
553
- [" @ " , " default" ]
553
+ [" $array " , " default" ]
554
554
],
555
555
[" repos/delete" , " github.com/tyru/caw.vim" ],
556
556
[" plugconf/delete" , " github.com/tyru/caw.vim" ]]]
@@ -570,7 +570,7 @@ The inverse expression of the above is:
570
570
"path" : " github.com/tyru/caw.vim" ,
571
571
"version" : " deadbeefcafebabe"
572
572
},
573
- [" @ " , " default" ]]]]
573
+ [" $array " , " default" ]]]]
574
574
```
575
575
576
576
1 . Installs plugconf
@@ -595,7 +595,7 @@ But, of course if we placed `vimdir/with-install` at before `repos/delete` or
595
595
"path" : " github.com/tyru/caw.vim" ,
596
596
"version" : " deadbeefcafebabe"
597
597
},
598
- [" @ " , " default" ]
598
+ [" $array " , " default" ]
599
599
],
600
600
[" repos/delete" , " github.com/tyru/caw.vim" ],
601
601
[" plugconf/delete" , " github.com/tyru/caw.vim" ]]
@@ -611,7 +611,7 @@ But, of course if we placed `vimdir/with-install` at before `repos/delete` or
611
611
"path" : " github.com/tyru/caw.vim" ,
612
612
"version" : " deadbeefcafebabe"
613
613
},
614
- [" @ " , " default" ]],
614
+ [" $array " , " default" ]],
615
615
[" vimdir/with-install" ,
616
616
[" github.com/tyru/caw.vim" ],
617
617
" dummy" ]]
@@ -630,7 +630,7 @@ Here is the simple JSON to install
630
630
[" do" ,
631
631
[" lockjson/add" ,
632
632
[" repos/get" , " github.com/tyru/caw.vim" ],
633
- [" @ " , " default" ]],
633
+ [" $array " , " default" ]],
634
634
[" plugconf/install" , " github.com/tyru/caw.vim" ]]]
635
635
```
636
636
@@ -642,7 +642,7 @@ Here is the inverse expression of above.
642
642
[" plugconf/delete" , " github.com/tyru/caw.vim" ],
643
643
[" lockjson/remove" ,
644
644
[" repos/delete" , " github.com/tyru/caw.vim" ],
645
- [" @ " , " default" ]]]]
645
+ [" $array " , " default" ]]]]
646
646
```
647
647
648
648
Here is the JSON to install plugins from local directory (static repository).
@@ -651,7 +651,7 @@ Here is the JSON to install plugins from local directory (static repository).
651
651
[" vimdir/with-install" ,
652
652
[" lockjson/add" ,
653
653
{ ... (repository information of local directory) ... },
654
- [" @ " , " default" ]],
654
+ [" $array " , " default" ]],
655
655
[" plugconf/install" , " localhost/local/myplugin" ]]
656
656
```
657
657
@@ -662,7 +662,7 @@ Here is the inverse expression of above.
662
662
[" plugconf/delete" , " localhost/local/myplugin" ],
663
663
[" lockjson/remove" ,
664
664
{ ... (repository information of local directory) ... },
665
- [" @ " , " default" ]]]
665
+ [" $array " , " default" ]]]
666
666
```
667
667
668
668
### Label examples
@@ -678,7 +678,7 @@ Here is the simple example of installing
678
678
[" do" ,
679
679
[" lockjson/add" ,
680
680
[" repos/get" , " github.com/tyru/caw.vim" ],
681
- [" @ " , " default" ]],
681
+ [" $array " , " default" ]],
682
682
[" plugconf/install" , " github.com/tyru/caw.vim" ]]]]
683
683
```
684
684
@@ -698,7 +698,7 @@ Note that:
698
698
[" plugconf/install" , " github.com/tyru/caw.vim" ],
699
699
[" lockjson/add" ,
700
700
[" repos/get" , " github.com/tyru/caw.vim" ],
701
- [" @ " , " default" ]]]]]
701
+ [" $array " , " default" ]]]]]
702
702
```
703
703
704
704
Here is more complex example to install two plugins "tyru/open-browser.vim",
@@ -716,15 +716,15 @@ Here is more complex example to install two plugins "tyru/open-browser.vim",
716
716
[" parallel" ,
717
717
[" lockjson/add" ,
718
718
[" repos/get" , " github.com/tyru/open-browser.vim" ],
719
- [" @ " , " default" ]],
719
+ [" $array " , " default" ]],
720
720
[" plugconf/install" , " github.com/tyru/open-browser.vim" ]]],
721
721
[" label" ,
722
722
3 ,
723
723
" github.com/tyru/open-browser-github.vim ... {{if .Done}}done!{{end}}" ,
724
724
[" parallel" ,
725
725
[" lockjson/add" ,
726
726
[" repos/get" , " github.com/tyru/open-browser-github.vim" ],
727
- [" @ " , " default" ]],
727
+ [" $array " , " default" ]],
728
728
[" plugconf/install" , " github.com/tyru/open-browser-github.vim" ]]]]]]
729
729
```
730
730
0 commit comments