Skip to content

Commit

Permalink
fix: add spans to tables
Browse files Browse the repository at this point in the history
  • Loading branch information
baszalmstra committed Dec 17, 2024
1 parent a1a2daa commit 197cc40
Show file tree
Hide file tree
Showing 21 changed files with 532 additions and 273 deletions.
40 changes: 27 additions & 13 deletions integ-tests/tests/snapshots/parser__crlf-2.snap
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,28 @@ note[string]: root_lib_0_path
^^^^^^

note[table]: root_lib_0
┌─ crlf:1:1
1 │ [project]
^
┌─ crlf:7:1
7 │ ╭ [[lib]]
8 │ │
9 │ │ path = "lib.rs"
10 │ │ name = "splay"
· │
14 │ │ contents are never required to be entirely resident in memory all at once.
15 │ │ """
│ ╰───^

note[array]: root_lib
┌─ crlf:1:1
1 │ [project]
^
┌─ crlf:7:1
7 │ ╭ [[lib]]
8 │ │
9 │ │ path = "lib.rs"
10 │ │ name = "splay"
· │
14 │ │ contents are never required to be entirely resident in memory all at once.
15 │ │ """
│ ╰───^

note[string]: root_project_authors_0
┌─ crlf:5:13
Expand Down Expand Up @@ -63,9 +75,13 @@ note[string]: root_project_version

note[table]: root_project
┌─ crlf:1:1
1 │ [project]
^
1 │ ╭ [project]
2 │ │
3 │ │ name = "splay"
4 │ │ version = "0.1.0"
5 │ │ authors = ["[email protected]"]
│ ╰──────────────────────────────^

note[table]: root
┌─ crlf:1:1
Expand All @@ -78,5 +94,3 @@ note[table]: root
14 │ │ contents are never required to be entirely resident in memory all at once.
15 │ │ """
│ ╰───^


11 changes: 5 additions & 6 deletions integ-tests/tests/snapshots/parser__empty_table-2.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ source: integ-tests/tests/parser.rs
expression: spans
---
note[table]: root_foo
┌─ empty_table:1:1
1
^
┌─ empty_table:2:1
2 │ ╭ [foo]
3 │ │
│ ╰^

note[table]: root
┌─ empty_table:1:1
Expand All @@ -15,5 +16,3 @@ note[table]: root
2 │ │ [foo]
3 │ │
│ ╰^


80 changes: 44 additions & 36 deletions integ-tests/tests/snapshots/parser__fruit-2.snap
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ note[string]: root_fruit_0_physical_shape
^^^^^

note[table]: root_fruit_0_physical
┌─ fruit:1:1
1 │ [[fruit]]
^
┌─ fruit:4:1
4 │ ╭ [fruit.physical]
5 │ │ color = "red"
6 │ │ shape = "round"
│ ╰───────────────^

note[string]: root_fruit_0_variety_0_name
┌─ fruit:9:9
Expand All @@ -33,10 +35,11 @@ note[string]: root_fruit_0_variety_0_name
^^^^^^^^^^^^^

note[table]: root_fruit_0_variety_0
┌─ fruit:1:1
1 │ [[fruit]]
^
┌─ fruit:8:1
8 │ ╭ [[fruit.variety]]
9 │ │ name = "red delicious"
│ ╰──────────────────────^

note[string]: root_fruit_0_variety_1_name
┌─ fruit:12:9
Expand All @@ -45,22 +48,25 @@ note[string]: root_fruit_0_variety_1_name
^^^^^^^^^^^^

note[table]: root_fruit_0_variety_1
┌─ fruit:1:1
1 │ [[fruit]]
^
┌─ fruit:11:1
11 │ ╭ [[fruit.variety]]
12 │ │ name = "granny smith"
│ ╰─────────────────────^

note[array]: root_fruit_0_variety
┌─ fruit:1:1
1 │ [[fruit]]
^
┌─ fruit:8:1
8 │ ╭ [[fruit.variety]]
9 │ │ name = "red delicious"
│ ╰──────────────────────^

note[table]: root_fruit_0
┌─ fruit:1:1
1 │ [[fruit]]
^
1 │ ╭ [[fruit]]
2 │ │ name = "apple"
│ ╰──────────────^

note[string]: root_fruit_1_name
┌─ fruit:15:9
Expand All @@ -75,28 +81,32 @@ note[string]: root_fruit_1_variety_0_name
^^^^^^^^

note[table]: root_fruit_1_variety_0
┌─ fruit:1:1
1 │ [[fruit]]
^
┌─ fruit:17:1
17 │ ╭ [[fruit.variety]]
18 │ │ name = "plantain"
│ ╰─────────────────^

note[array]: root_fruit_1_variety
┌─ fruit:1:1
1 │ [[fruit]]
^
┌─ fruit:17:1
17 │ ╭ [[fruit.variety]]
18 │ │ name = "plantain"
│ ╰─────────────────^

note[table]: root_fruit_1
┌─ fruit:1:1
1 │ [[fruit]]
^
┌─ fruit:14:1
14 │ ╭ [[fruit]]
15 │ │ name = "banana"
│ ╰───────────────^

note[array]: root_fruit
┌─ fruit:1:1
1 │ [[fruit]]
^
1 │ ╭ [[fruit]]
2 │ │ name = "apple"
│ ╰──────────────^

note[table]: root
┌─ fruit:1:1
Expand All @@ -109,5 +119,3 @@ note[table]: root
18 │ │ name = "plantain"
19 │ │
│ ╰^


61 changes: 33 additions & 28 deletions integ-tests/tests/snapshots/parser__table_names-2.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3,46 +3,53 @@ source: integ-tests/tests/parser.rs
expression: spans
---
note[table]: root_"
┌─ table_names:1:1
1 │ [a."b"]
^
┌─ table_names:4:1
4 │ ╭ ["\""]
5 │ │ ['a.a']
│ ╰^

note[table]: root_""
┌─ table_names:1:1
1 │ [a."b"]
^
┌─ table_names:6:1
6 │ ╭ ['""']
7 │ │
│ ╰^

note[table]: root_a_b
┌─ table_names:1:1
1 │ [a."b"]
^
1 │ ╭ [a."b"]
2 │ │ ["f f"]
│ ╰^

note[table]: root_a
┌─ table_names:1:1
1 │ [a."b"]
^
1 │ ╭ [a."b"]
2 │ │ ["f f"]
│ ╰^

note[table]: root_a.a
┌─ table_names:1:1
1 │ [a."b"]
^
┌─ table_names:5:1
5 │ ╭ ['a.a']
6 │ │ ['""']
│ ╰^

note[table]: root_f f
┌─ table_names:1:1
1 │ [a."b"]
^
┌─ table_names:2:1
2 │ ╭ ["f f"]
3 │ │ ["f.f"]
│ ╰^

note[table]: root_f.f
┌─ table_names:1:1
1 │ [a."b"]
^
┌─ table_names:3:1
3 │ ╭ ["f.f"]
4 │ │ ["\""]
│ ╰^

note[table]: root
┌─ table_names:1:1
Expand All @@ -55,5 +62,3 @@ note[table]: root
6 │ │ ['""']
7 │ │
│ ╰^


43 changes: 23 additions & 20 deletions integ-tests/tests/snapshots/parser__tables_in_arrays-2.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,39 @@ source: integ-tests/tests/parser.rs
expression: spans
---
note[table]: root_foo_0_bar
┌─ tables_in_arrays:1:1
1 │ [[foo]]
^
┌─ tables_in_arrays:3:1
3 │ ╭ [foo.bar]
4 │ │ #…
│ ╰^

note[table]: root_foo_0
┌─ tables_in_arrays:1:1
1 │ [[foo]]
^
1 │ ╭ [[foo]]
2 │ │ #…
│ ╰^

note[table]: root_foo_1_bar
┌─ tables_in_arrays:1:1
1 │ [[foo]]
^
┌─ tables_in_arrays:8:1
8 │ ╭ [foo.bar]
9 │ │ #...
│ ╰^

note[table]: root_foo_1
┌─ tables_in_arrays:1:1
1 │ [[foo]]
^
┌─ tables_in_arrays:6:1
6 │ ╭ [[foo]] # ...
7 │ │ #…
│ ╰^

note[array]: root_foo
┌─ tables_in_arrays:1:1
1 │ [[foo]]
^
1 │ ╭ [[foo]]
2 │ │ #…
│ ╰^

note[table]: root
┌─ tables_in_arrays:1:1
Expand All @@ -43,5 +48,3 @@ note[table]: root
9 │ │ #...
10 │ │
│ ╰^


18 changes: 10 additions & 8 deletions integ-tests/tests/snapshots/valid__arrays__one-2.snap
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,19 @@ note[string]: root_people_0_last_name

note[table]: root_people_0
┌─ one:1:1
1 │ [[people]]
^
1 │ ╭ [[people]]
2 │ │ first_name = "Bruce"
3 │ │ last_name = "Springsteen"
│ ╰─────────────────────────^

note[array]: root_people
┌─ one:1:1
1 │ [[people]]
^
1 │ ╭ [[people]]
2 │ │ first_name = "Bruce"
3 │ │ last_name = "Springsteen"
│ ╰─────────────────────────^

note[table]: root
┌─ one:1:1
Expand All @@ -33,5 +37,3 @@ note[table]: root
2 │ │ first_name = "Bruce"
3 │ │ last_name = "Springsteen"
│ ╰─────────────────────────^


Loading

0 comments on commit 197cc40

Please sign in to comment.