aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/string_lexing/parser.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-12-27 12:03:18 +0000
committerAleksey Kladov <[email protected]>2018-12-27 12:03:18 +0000
commit359e70d1b20402ca9cc8731909daecfab598e55d (patch)
tree7c0cfa82de89b62597bdb897c9484f9d5b02cd90 /crates/ra_syntax/src/string_lexing/parser.rs
parent73ded3c63ca2522b7bb6ca8eb7834c5adc1a3511 (diff)
support literal suffixes
Diffstat (limited to 'crates/ra_syntax/src/string_lexing/parser.rs')
-rw-r--r--crates/ra_syntax/src/string_lexing/parser.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/crates/ra_syntax/src/string_lexing/parser.rs b/crates/ra_syntax/src/string_lexing/parser.rs
index 13f3db889..14c6015c2 100644
--- a/crates/ra_syntax/src/string_lexing/parser.rs
+++ b/crates/ra_syntax/src/string_lexing/parser.rs
@@ -139,6 +139,16 @@ impl<'a> Parser<'a> {
139 )) 139 ))
140 } 140 }
141 } 141 }
142
143 pub fn parse_suffix(&mut self) -> Option<TextRange> {
144 let start = self.get_pos();
145 let _ = self.peek()?;
146 while let Some(_) = self.peek() {
147 self.advance();
148 }
149 let end = self.get_pos();
150 Some(TextRange::from_to(start, end))
151 }
142} 152}
143 153
144#[derive(Debug, Eq, PartialEq, Clone)] 154#[derive(Debug, Eq, PartialEq, Clone)]