Skip to content

Commit f5479a9

Browse files
committed
Parse _ as an ident
Technically a breaking change but 0.4 is so new I'm tempted to leave this as 0.4.1 Closes #87
1 parent ca3dcad commit f5479a9

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

src/stable.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -787,8 +787,6 @@ fn symbol(input: Cursor) -> PResult<TokenTree> {
787787
let a = &input.rest[..end];
788788
if a == "r#_" {
789789
Err(LexError)
790-
} else if a == "_" {
791-
Ok((input.advance(end), Punct::new('_', Spacing::Alone).into()))
792790
} else {
793791
let ident = if raw {
794792
::Ident::_new_raw(&a[2..], ::Span::call_site())

tests/test.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ fn roundtrip() {
113113
",
114114
);
115115
roundtrip("'a");
116+
roundtrip("'_");
116117
roundtrip("'static");
117118
roundtrip("'\\u{10__FFFF}'");
118119
roundtrip("\"\\u{10_F0FF__}foo\\u{1_0_0_0__}\"");

0 commit comments

Comments
 (0)