Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add spans to tables #11

Merged
merged 3 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/rust-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v1
- uses: EmbarkStudios/cargo-deny-action@v2

publish-check:
name: Publish Check
Expand Down
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