]> git.lizzy.rs Git - rust.git/commit
Fix parsing of "postfix" range expressions.
authorGeoffry Song <goffrie@gmail.com>
Fri, 15 Nov 2019 08:08:43 +0000 (00:08 -0800)
committerGeoffry Song <goffrie@gmail.com>
Fri, 15 Nov 2019 08:18:28 +0000 (00:18 -0800)
commit989cebc99c02acd427f01724c4fa77d81691e886
tree89c2ed0185257de734b60eb3db01be2f5270b7c3
parent3ad11973ac7596323f085a9fcb9530e47f021c41
Fix parsing of "postfix" range expressions.

Right now they are handled in `postfix_dot_expr`, but that doesn't allow it to
correctly handle precedence. Integrate it more tightly with the Pratt parser
instead.

Also includes a drive-by fix for parsing `match .. {}`.

Fixes #2242.
crates/ra_parser/src/grammar/expressions.rs
crates/ra_syntax/test_data/parser/err/0038_endless_inclusive_range.rs [new file with mode: 0644]
crates/ra_syntax/test_data/parser/err/0038_endless_inclusive_range.txt [new file with mode: 0644]
crates/ra_syntax/test_data/parser/ok/0060_as_range.rs [new file with mode: 0644]
crates/ra_syntax/test_data/parser/ok/0060_as_range.txt [new file with mode: 0644]
crates/ra_syntax/test_data/parser/ok/0061_match_full_range.rs [new file with mode: 0644]
crates/ra_syntax/test_data/parser/ok/0061_match_full_range.txt [new file with mode: 0644]