-
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for new lines in Sequence (#40)
* 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 <[email protected]>
- Loading branch information
1 parent
ccb028f
commit 3a1dfe8
Showing
10 changed files
with
128 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
A -> B: This is a\nmultiline string. | ||
A -> B: This is another\nmultiline string. | ||
B -> A: This is the \nlast one. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
┌─┐ ┌─┐ | ||
│A│ │B│ | ||
└┬┘ └┬┘ | ||
│ │ | ||
│This is a │ | ||
│multiline string.│ | ||
│────────────────>│ | ||
│ │ | ||
│This is another │ | ||
│multiline string.│ | ||
│────────────────>│ | ||
│ │ | ||
│ This is the │ | ||
│ last one. │ | ||
│<────────────────│ | ||
┌┴┐ ┌┴┐ | ||
│A│ │B│ | ||
└─┘ └─┘ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
1) A -> B : message\nnumber\n1 | ||
2) A -> B : message\nnumber\n2 | ||
|
||
A: 1<2 | ||
B: 1>2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
┌─┐ ┌─┐ | ||
│A│ │B│ | ||
└┬┘ └┬┘ | ||
│ │ | ||
│──┐ │ | ||
│message│ | ||
│number │ | ||
│2 │ │ | ||
│──────>│ | ||
│ │ │ | ||
│message│ | ||
│number │ | ||
│1 │ │ | ||
│ └───>│ | ||
┌┴┐ ┌┴┐ | ||
│A│ │B│ | ||
└─┘ └─┘ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
1) A -> B : message number 1 | ||
2) A -> B : message\nnumber\n2 | ||
|
||
A: 1<2 | ||
B: 1>2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
┌─┐ ┌─┐ | ||
│A│ │B│ | ||
└┬┘ └┬┘ | ||
│ │ | ||
│──┐ │ | ||
│ │ message │ | ||
│ │ number │ | ||
│ │ 2 │ | ||
│───────────────>│ | ||
│ │ │ | ||
│message number 1│ | ||
│ └────────────>│ | ||
┌┴┐ ┌┴┐ | ||
│A│ │B│ | ||
└─┘ └─┘ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
1) A -> B : message\nnumber\n1 | ||
2) A -> B : message number 2 | ||
|
||
A: 1<2 | ||
B: 1>2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
┌─┐ ┌─┐ | ||
│A│ │B│ | ||
└┬┘ └┬┘ | ||
│ │ | ||
│──┐ │ | ||
│message number 2│ | ||
│───────────────>│ | ||
│ │ │ | ||
│ │ message │ | ||
│ │ number │ | ||
│ │ 1 │ | ||
│ └────────────>│ | ||
┌┴┐ ┌┴┐ | ||
│A│ │B│ | ||
└─┘ └─┘ |