Skip to content

Commit

Permalink
move raw span to tt reader
Browse files Browse the repository at this point in the history
See https://github.com/rust-lang/rust/pull/50838/files#r283296243 for
explanation how jointness checking works with *next* pair
  • Loading branch information
matklad committed May 13, 2019
1 parent b91e0a3 commit e249f2e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/libsyntax/parse/lexer/tokentrees.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ impl<'a> TokenTreesReader<'a> {
// Note that testing for joint-ness here is done via the raw
// source span as the joint-ness is a property of the raw source
// rather than wanting to take `override_span` into account.
// Additionally, we actually check if the *next* pair of tokens
// is joint, but this is equivalent to checking the current pair.
let raw = self.string_reader.peek_span_src_raw;
self.real_token();
let is_joint = raw.hi() == self.string_reader.peek_span_src_raw.lo()
Expand All @@ -222,4 +224,3 @@ impl<'a> TokenTreesReader<'a> {
self.span = t.sp;
}
}

0 comments on commit e249f2e

Please sign in to comment.