Clarify position symbols in diff diagrams in manual

pull/353/head
Wilfred Hughes 2022-09-05 17:20:13 +07:00
parent 7422cb8f2e
commit 4c9a12a905
1 changed files with 26 additions and 11 deletions

@ -13,27 +13,42 @@ after the last syntax node in both trees.
Consider comparing `A` with `X A`.
```
START
+---------------------+
| Left: A Right: X A |
| ^ ^ |
+---------------------+
END
+---------------------+
| Left: A Right: X A |
| ^ ^|
+---------------------+
```
From the start vertex, we have two options:
* we can mark the first syntax node on the left as novel, and advance
to the next syntax node on the left (vertex 1 above), or
* we can mark the first syntax node on the right as novel, and advance
to the next syntax node on the right (vertex 2 above).
```
START
+---------------------+
| Left: A Right: X A |
| ^ ^ |
| ^ ^ |
+---------------------+
/ \
Novel atom L / \ Novel atom R
1 v 2 v
+---------------------+ +---------------------+
| Left: A Right: X A | | Left: A Right: X A |
| ^ ^ | | ^ ^ |
| ^ ^ | | ^ ^ |
+---------------------+ +---------------------+
```
From the start vertex, we have two options:
* we can mark the first syntax node on the left as novel, and advance
to the next syntax node on the left (vertex 1 above), or
* we can mark the first syntax node on the right as novel, and advance
to the next syntax node on the right (vertex 2 above).
Choosing "novel atom R" to vertex 2 will turn out to be the best
choice. From vertex 2, we can see three routes to the end vertex.
@ -42,14 +57,14 @@ choice. From vertex 2, we can see three routes to the end vertex.
2
+---------------------+
| Left: A Right: X A |
| ^ ^ |
| ^ ^ |
+---------------------+
/ | \
Novel atom L / | \ Novel atom R
3 v | 4 v
v | v
+---------------------+ | +---------------------+
| Left: A Right: X A | | | Left: A Right: X A |
| ^ ^ | | | ^ ^|
| ^ ^ | | | ^ ^|
+---------------------+ | +---------------------+
| | |
| Novel atom R | Nodes match | Novel atom L