diff options
| author | Florian Hahn <flo@fhahn.com> | 2016-01-24 22:46:39 +0100 |
|---|---|---|
| committer | Florian Hahn <flo@fhahn.com> | 2016-01-26 10:32:58 +0100 |
| commit | 1bde18d60c2e2a4fec149312bae6e20609b6599b (patch) | |
| tree | c09697d0cb233d611e3914df8c3107bb1384a648 /src/libsyntax/parse/token.rs | |
| parent | 20edb366e7d16da946c2484a8542dffb07b79837 (diff) | |
| download | rust-1bde18d60c2e2a4fec149312bae6e20609b6599b.tar.gz rust-1bde18d60c2e2a4fec149312bae6e20609b6599b.zip | |
Use interpolated token span when building spans for bigger expressions
Diffstat (limited to 'src/libsyntax/parse/token.rs')
| -rw-r--r-- | src/libsyntax/parse/token.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index 242626154fc..220d0aff2e3 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -223,6 +223,14 @@ impl Token { } } + /// Returns `true` if the token is interpolated. + pub fn is_interpolated(&self) -> bool { + match *self { + Interpolated(..) => true, + _ => false, + } + } + /// Returns `true` if the token is an interpolated path. pub fn is_path(&self) -> bool { match *self { |
