mirror of
https://github.com/ArthurSonzogni/Diagon.git
synced 2026-08-30 00:50:45 +08:00
3a1dfe84ab
* Add support for new lines in Sequence
When using `diagon Sequence` it is not possible (at least I couldn't
find a way) to add new lines to the messages in the Sequence submodule.
This patch adds parameter `--new_lines_at_bsn` that results in
substituting literal `\n` with new lines.
Example:
```bash
$ echo "Alice -> Bob: send(\n msg="Hello...",\n length=8,\n)" | \
diagon Sequence --new_lines_at_bsn=true
```
output:
```
┌─────┐ ┌───┐
│Alice│ │Bob│
└──┬──┘ └─┬─┘
│ │
│send( │
│ msg=Hello...,│
│ length=8, │
│) │
│──────────────>│
┌──┴──┐ ┌─┴─┐
│Alice│ │Bob│
└─────┘ └───┘
```
* Add tests & refactor.
Co-authored-by: ArthurSonzogni <sonzogniarthur@gmail.com>
19 lines
604 B
Plaintext
19 lines
604 B
Plaintext
┌─┐ ┌─┐
|
|
│A│ │B│
|
|
└┬┘ └┬┘
|
|
│ │
|
|
│This is a │
|
|
│multiline string.│
|
|
│────────────────>│
|
|
│ │
|
|
│This is another │
|
|
│multiline string.│
|
|
│────────────────>│
|
|
│ │
|
|
│ This is the │
|
|
│ last one. │
|
|
│<────────────────│
|
|
┌┴┐ ┌┴┐
|
|
│A│ │B│
|
|
└─┘ └─┘
|