-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
fix: box_syntax/pattern #1414
fix: box_syntax/pattern #1414
Conversation
Change-Id: I6e20e0163fa545de37226c1561b3b7103615626c
Change-Id: I45a856d74fb616d3bce33050f9e69d327186bd59
bors r+ Thanks! |
Build succeeded |
Does this PR also introduce box syntax in the way of matching them by box patterns? |
I think
https://github.com/rust-analyzer/rust-analyzer/pull/1414/files#diff-2363d5bd87246fdd9203ebd8cf0fc230R264
covers this?
…On Wed, 19 Jun 2019 at 13:21, Hero Bird ***@***.***> wrote:
Does this PR also introduce box patterns in the way of matching them by
box patterns?
I fail to see a test for this.
Something like this:
https://github.com/Robbepop/stevia/blob/master/simplifier/src/simplifications/bool_symbolic_solver.rs#L52
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1414>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AANB3M363T572OWYHV4QORLP3ICA3ANCNFSM4HZFRAHA>
.
|
Ah got it, didn't notice it was covered by that! Thanks. :) |
// fn foo() { | ||
// let x = box 1i32; | ||
// } | ||
fn box_expr(p: &mut Parser, m: Option<Marker>) -> CompletedMarker { |
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.
@matklad oops...did I miss something in this method? box syntax inside "tuple"s cannot be parsed.
struct Foo(Box<i32>);
let a = Foo(box 1i32);
let b = (box 1i32, box 2i32);
Hm, I guess, we should add box to expr_first ?
…On Friday, 5 July 2019, csmoe ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In crates/ra_parser/src/grammar/expressions/atom.rs
<#1414 (comment)>
:
> @@ -507,3 +508,17 @@ fn try_block_expr(p: &mut Parser, m: Option<Marker>) -> CompletedMarker {
block(p);
m.complete(p, TRY_EXPR)
}
+
+// test box_expr
+// fn foo() {
+// let x = box 1i32;
+// }
+fn box_expr(p: &mut Parser, m: Option<Marker>) -> CompletedMarker {
@matklad <https://github.com/matklad> oops...did I miss something in this
method? box syntax inside "tuple"s cannot be parsed.
struct Foo(Box<i32>);let a = Foo(box 1i32);let b = (box 1i32, box 2i32);
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1414>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AANB3MZT23KF25QWNPVJNKTP55O77ANCNFSM4HZFRAHA>
.
|
1722: Parse `box` keyword in patterns below top-level r=matklad a=ecstatic-morse This extends the parser to handle patterns like `if let Some(box x) = ...` where the `box` keyword is not at the top-level. The last line of the added test caused a `ParseError`. This is a variant of #1412 which was not fixed by #1414. ~~I'm not familiar with `rust-analyzer`, otherwise I would fix this as well 😄.~~ Co-authored-by: Dylan MacKenzie <ecstaticmorse@gmail.com>
1722: Parse `box` keyword in patterns below top-level r=matklad a=ecstatic-morse This extends the parser to handle patterns like `if let Some(box x) = ...` where the `box` keyword is not at the top-level. The last line of the added test caused a `ParseError`. This is a variant of #1412 which was not fixed by #1414. ~~I'm not familiar with `rust-analyzer`, otherwise I would fix this as well 😄.~~ Co-authored-by: Dylan MacKenzie <ecstaticmorse@gmail.com>
Closes #1412
r? @matklad