* Introduce multiline call annotations
Call annotations have same format as `;`-annotations, but can allow
multiline JSON literals. They look like `#| ... |#` (that's Common Lisp syntax for multiline comments).
For example:
```
(call "peer_id" ("serv" "func") [a b] var) #|
map = {
"0": null,
"default": 42,
}
|#
```
* A JSON in the assertion parser doesn't have be last
We have been using nom's `rest` for JSON values. Now we have a simple JSON parser
that recognizes JSON to be parsed with `serde_json`, and may have multiple JSON objects
within same assertion.
* Allow annotation after a compound form
It is attached to a rightmost nested element that has to be a `call` special form.
1. Network can be shared between several execution, being used by an Rc-handle.
2. The neighborhood is just network's all peers with removed/inserted hosts delta with respect to network.
3. An AIR script is transformed into a separate value of type `TransformedAirScript`. It allows running several
particles on the same parsed AIR script, sharing state.
4. `TestExecutor` was renamed to `AirScriptExecutor`. It also has a constructor that accepts a `TransformedAirScript`.
Try to parse the annotated AIR script with the standard parser to catch
to catch errors early with better error messages.
We do it in the `TestExecutor` only to make testing framwork parser
tests simplier. For user experience, it doesn't matter.
* seq_result` -> `seq_ok`; add `seq_err`
`seq_ok` and `seq_err` are consistent with `ok` and `err`, but produce
results sequentially.
* Accept `;;` and longer comments in the sexp parser
Currently they are just dropped, and resulting AIR has different
character positions in the error messages.
* Add "map" assertion
Lookup result in a map by service's first argument.
Testing framework for AquaVM
Its primary features are:
1. It generates services declaratively by annotation in the comments inserted just after calls.
2. Ephemeral network keeps each node's data and incoming data queue. The network can be also generated based on peer IDs featured in the script.
3. One can explicitly add additional peers and services.
The example of the script annotations:
```
(seq
(call "peer_1" ("service" "func") [] var) ; ok=42
(call "peer_2" ("service" "func") [var]) ; err={"ret_code": 1, "result":"no towel"}
)
```
Passing this script to `air_test_framework::TestExecutor::new(...)` will create a virtual network with peers "peer_1" and "peer_2" (and any peer you provide in the `TestRunParameters`), and the particular calls will return respective values.
Please note that autogenerated services use modified service name as a side channel for finding a correct value: "..{N}" is added to each service name (two dots and serial number). Be careful with service names taken from a variable.