Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
f523882
hackathon start
pietroalbini Oct 25, 2024
c01f1ab
add yet another token tree implementation
pietroalbini Oct 25, 2024
d3783d5
Meta variable type is resolved actually :sweat_smile:
scrabsha Oct 25, 2024
3fb5ac8
Oupsy doupsy
scrabsha Oct 25, 2024
c5dda81
add RepetitionId
pietroalbini Oct 25, 2024
68dd30b
silence missing docs lint
pietroalbini Oct 25, 2024
ae9e71f
Temporarily make the id inner field public
scrabsha Oct 25, 2024
c4bd7c2
The metavariable name is actually an identifier
scrabsha Oct 25, 2024
85fd5e7
Use the metavariable type in the tokenstream definition
scrabsha Oct 25, 2024
b680417
The repetition can actually be an ident, a punctuation or a literal
scrabsha Oct 25, 2024
fa7234c
Add the Repetition::to_token_tree method
scrabsha Oct 25, 2024
6cf4c7b
Add the proc-macro2::TokenStream -> expandable_impl::TokenStream impl
scrabsha Oct 25, 2024
2281e45
Fix the error enum
scrabsha Oct 25, 2024
ec31e32
Add transcriber parsing as well :sparkles:
scrabsha Oct 25, 2024
ad62900
Add tests for the TokenTree parsing, fix a (stupid) error
scrabsha Oct 25, 2024
b700112
Fix id ordering, add more tests
scrabsha Oct 25, 2024
29285be
Make sure expect test output is the same regardless of how the test s…
scrabsha Oct 25, 2024
bce4b17
add a better debug impl for repetition id
pietroalbini Oct 26, 2024
3c7a254
gather repetition groups
pietroalbini Oct 26, 2024
8c8e782
Add tokenstream -> generic tokenstream convertion function
scrabsha Oct 26, 2024
d8ee159
suppress warnings
pietroalbini Oct 26, 2024
3ad881d
Add tests
scrabsha Oct 26, 2024
98c0d3b
Remove warnings
scrabsha Oct 26, 2024
5966337
create our own Span type that renders the source text in the debug impl
pietroalbini Oct 26, 2024
6311e55
update tests
pietroalbini Oct 26, 2024
ca579e2
switch the default span in the error to our own
pietroalbini Oct 26, 2024
9e9f4ff
remove deref impl for our span
pietroalbini Oct 26, 2024
1d3c179
calculate proper span for metavariables
pietroalbini Oct 26, 2024
eb073af
slightly nicer debug implementation for span
pietroalbini Oct 26, 2024
6e87afd
better rendering for repetition group tests
pietroalbini Oct 26, 2024
732160c
fix span for repetitions
pietroalbini Oct 26, 2024
e90c025
Fancy debug impl :blush:
scrabsha Oct 26, 2024
f9a8553
document the repetition groups code
pietroalbini Oct 26, 2024
08cb4a2
Ditch the old architecture
scrabsha Oct 26, 2024
33ef9cc
pin a nightly and rewrap comments
pietroalbini Oct 26, 2024
293d9bb
Use our own span in the error
pietroalbini Oct 26, 2024
281b11f
add failing tests for the upcoming thing
pietroalbini Oct 26, 2024
45e0b4b
handle more edge cases with ghost metavars
pietroalbini Oct 26, 2024
6a2a692
Glue the new code together :sparkles:
scrabsha Oct 26, 2024
b663295
Actually `rust-grammar-dpdfa` and `grammar-gen` can be removed too!
scrabsha Oct 27, 2024
bd8d4ab
Move the expansion checking code to the right module, implement the m…
scrabsha Oct 27, 2024
7126b28
refactor to use an Analysis struct
pietroalbini Oct 27, 2024
02f1564
document ghost metavariables
pietroalbini Oct 27, 2024
411099f
remove compilation error
pietroalbini Oct 27, 2024
63df827
Fix warnings and lints
scrabsha Oct 27, 2024
c150537
better diagnostics
pietroalbini Oct 27, 2024
74debd9
fix conflicts
scrabsha Oct 27, 2024
5539b37
Missing docs
scrabsha Oct 27, 2024
f6bcabc
better rendering for ghost groups in tests
pietroalbini Nov 3, 2024
83e82dd
use correct spacing when converting our tokentree into generic
pietroalbini Nov 3, 2024
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
14 changes: 7 additions & 7 deletions expandable-impl/src/expand/repetition_groups.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,8 @@ mod tests {
Err(
MetavariableDefinedAtLowerDepth {
name: "foo",
definition_span: bytes(8..13),
usage_span: bytes(17..20),
definition_span: span(ident),
usage_span: span(foo),
definition_depth: 1,
usage_depth: 0,
},
Expand All @@ -394,7 +394,7 @@ mod tests {
expect![[r#"
Err(
RepetitionWithoutMetavariables {
span: bytes(3..7),
span: span((1,)),
},
)
"#]],
Expand All @@ -408,19 +408,19 @@ mod tests {
expect![[r#"
{
"bar": Definition {
span: bytes(10..15),
span: span(ident),
depth: 0,
},
"baz": Definition {
span: bytes(40..45),
span: span(ident),
depth: 1,
},
"foo": Definition {
span: bytes(29..34),
span: span(ident),
depth: 1,
},
"quux": Definition {
span: bytes(54..59),
span: span(ident),
depth: 2,
},
}
Expand Down
24 changes: 12 additions & 12 deletions expandable-impl/src/token_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -759,12 +759,12 @@ mod tests {
Repetition(
Repetition {
id: repetition 0,
dollar: bytes(1..2),
dollar: span($),
paren: bytes(0..0),
content: [
Metavariable(
Metavariable {
dollar: bytes(3..4),
dollar: span($),
name: Ident {
sym: a,
},
Expand All @@ -790,12 +790,12 @@ mod tests {
Repetition(
Repetition {
id: repetition 1,
dollar: bytes(5..6),
dollar: span($),
paren: bytes(0..0),
content: [
Metavariable(
Metavariable {
dollar: bytes(7..8),
dollar: span($),
name: Ident {
sym: a,
},
Expand Down Expand Up @@ -881,12 +881,12 @@ mod tests {
Repetition(
Repetition {
id: repetition 0,
dollar: bytes(1..2),
dollar: span($),
paren: bytes(0..0),
content: [
Metavariable(
Metavariable {
dollar: bytes(3..4),
dollar: span($),
name: Ident {
sym: foo,
},
Expand All @@ -903,12 +903,12 @@ mod tests {
Repetition(
Repetition {
id: repetition 1,
dollar: bytes(5..6),
dollar: span($),
paren: bytes(0..0),
content: [
Metavariable(
Metavariable {
dollar: bytes(7..8),
dollar: span($),
name: Ident {
sym: bar,
},
Expand Down Expand Up @@ -941,18 +941,18 @@ mod tests {
Repetition(
Repetition {
id: repetition 2,
dollar: bytes(9..10),
dollar: span($),
paren: bytes(0..0),
content: [
Repetition(
Repetition {
id: repetition 3,
dollar: bytes(11..12),
dollar: span($),
paren: bytes(0..0),
content: [
Metavariable(
Metavariable {
dollar: bytes(13..14),
dollar: span($),
name: Ident {
sym: foo,
},
Expand All @@ -963,7 +963,7 @@ mod tests {
),
Metavariable(
Metavariable {
dollar: bytes(15..16),
dollar: span($),
name: Ident {
sym: bar,
},
Expand Down
Loading