-
-
Notifications
You must be signed in to change notification settings - Fork 264
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
PEEK[start..end] #334
PEEK[start..end] #334
Conversation
meta/src/parser.rs
Outdated
Rule::quote, | ||
Rule::single_quote | ||
], | ||
positives: vec![Rule::term], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no idea why I had to change this. is this a bug on master or did my added rule really change something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may be a bug. I can take a closer look at it. It's weird that this particular example shouldn't be influenced by the changes you've made.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll take a jab at this right now to see exactly what's going on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've fixed it in #343.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good progress! 👍
meta/src/parser.rs
Outdated
Rule::quote, | ||
Rule::single_quote | ||
], | ||
positives: vec![Rule::term], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may be a bug. I can take a closer look at it. It's weird that this particular example shouldn't be influenced by the changes you've made.
f123d3a
to
2d5e03b
Compare
OK, one problem: Compiling pest_grammars v2.0.0 (/home/phil/Dev/Rust/pest/grammars)
error[E0433]: failed to resolve. Use of undeclared type or module `state`
--> derive/tests/grammar.rs:15:10
|
15 | #[derive(Parser)]
| ^^^^^^ Use of undeclared type or module `state`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0433`.
error: Could not compile `pest_derive`. I don’t know what I did differently than the other generator code. What did I miss? |
oh, whoops! thank you! I also fixed the next problem: Compiling pest_derive v2.0.1 (/home/phil/Dev/Rust/pest/derive)
error[E0308]: mismatched types
--> derive/tests/grammar.rs:15:10
|
15 | #[derive(Parser)]
| ^^^^^^
| |
| expected enum `std::option::Option`, found i32
| help: try using a variant of the expected type: `Some(-2i32)`
|
= note: expected type `std::option::Option<i32>`
found type `i32` the problem was that I fixed it as described in dtolnay/quote#20 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is pretty close. I'll take a look at the error reporting issue right now and let you know as soon as I figure it out.
meta/src/parser.rs
Outdated
Rule::quote, | ||
Rule::single_quote | ||
], | ||
positives: vec![Rule::term], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll take a jab at this right now to see exactly what's going on.
pub fn stack_match_peek_slice(mut self: Box<Self>, start: i32, end: Option<i32>, match_dir: MatchDir) -> ParseResult<Box<Self>> { | ||
let range = match constrain_idxs(start, end, self.stack.len()) { | ||
Some(r) => r, | ||
None => return Err(self), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should being out-of-range be considered a hard error or a match fail? Currently, POP
-ing on an empty stack causes a panic, but I feel like this approach is probably more expressive, if more error-prone.
Also, brackets should be added in |
4307654
to
ec331e9
Compare
i added the brackets, all done! |
d28442b
to
74be17d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM apart from small fix!
bors r+ |
👎 Rejected by code reviews |
bors r+ |
Merge conflict |
Co-Authored-By: flying-sheep <[email protected]>
Co-Authored-By: flying-sheep <[email protected]>
Co-Authored-By: flying-sheep <[email protected]>
Co-Authored-By: flying-sheep <[email protected]>
a5c6f6e
to
9a63e1b
Compare
bors r+ |
334: PEEK[start..end] r=dragostis a=flying-sheep fixes #329 Co-authored-by: Philipp A <[email protected]> Co-authored-by: Dragoș Tiselice <[email protected]>
Build succeeded |
Yay 🥳 Too bad it wasn't a squash merge, that's some messy series of commits 😅 |
fixes #329