diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-04-18 20:36:37 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-04-18 20:36:37 +0100 |
commit | 7a59cd49ff2bb47fa0844fcf5f1ec44f32523b1b (patch) | |
tree | 2266a12f833d72faa4c4ba12a997999c7013e975 /crates/ra_mbe/src/syntax_bridge.rs | |
parent | b95b77f92f4ce73b3c9cc652ac9ae40580d308ce (diff) | |
parent | a1b5cf81ebcac15299cc612b49023bb418507027 (diff) |
Merge #4035
4035: Convert bool to ident instead of literal in mbe r=matklad a=edwin0cheng
Fixed #1249
Currently we treat boolean literal as `tt::Literal` , which makes parsing $lit:lit matcher easily.
However, proc-macro2 treat boolean literal as `ident` :
https://github.com/alexcrichton/proc-macro2/blob/4173a21dc497c67326095e438ff989cc63cd9279/src/lib.rs#L939
OT: I am quite happy we finally need to fix this bug :)
Co-authored-by: Edwin Cheng <[email protected]>
Diffstat (limited to 'crates/ra_mbe/src/syntax_bridge.rs')
-rw-r--r-- | crates/ra_mbe/src/syntax_bridge.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/ra_mbe/src/syntax_bridge.rs b/crates/ra_mbe/src/syntax_bridge.rs index 70899bc5d..2b4390eb2 100644 --- a/crates/ra_mbe/src/syntax_bridge.rs +++ b/crates/ra_mbe/src/syntax_bridge.rs | |||
@@ -376,7 +376,7 @@ trait TokenConvertor { | |||
376 | }; | 376 | }; |
377 | } | 377 | } |
378 | let leaf: tt::Leaf = match k { | 378 | let leaf: tt::Leaf = match k { |
379 | T![true] | T![false] => make_leaf!(Literal), | 379 | T![true] | T![false] => make_leaf!(Ident), |
380 | IDENT => make_leaf!(Ident), | 380 | IDENT => make_leaf!(Ident), |
381 | k if k.is_keyword() => make_leaf!(Ident), | 381 | k if k.is_keyword() => make_leaf!(Ident), |
382 | k if k.is_literal() => make_leaf!(Literal), | 382 | k if k.is_literal() => make_leaf!(Literal), |