Skip to content

Commit 1b1cdee

Browse files
committed
---
yaml --- r: 123703 b: refs/heads/try c: c8a0252 h: refs/heads/master i: 123701: a8ff418 123699: fcb28cf 123695: ba61646 v: v3
1 parent 5cb3d0f commit 1b1cdee

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: da4e4e4e0a7778a85748aa4a303b13f603e96b4b
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 8ddd286ea4ba4384a0dc9eae393ed515460a986e
5-
refs/heads/try: 47fe8aa6bfaa18d42561801dc230d2043b984b76
5+
refs/heads/try: c8a02527ae6364175c31a5447dd4e21bb6ac3488
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/libsyntax/parse/lexer/mod.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,20 @@ impl<'a> StringReader<'a> {
217217
self.with_str_from_to(start, self.last_pos, f)
218218
}
219219

220+
/// Create an Ident from a given offset to the current offset, each
221+
/// adjusted 1 towards each other (assumes that on either side there is a
222+
/// single-byte delimiter).
223+
pub fn ident_from(&self, start: BytePos) -> ast::Ident {
224+
debug!("taking an ident from {} to {}", start, self.last_pos);
225+
self.with_str_from(start, str_to_ident)
226+
}
227+
228+
/// As ident_from, with an explicit endpoint.
229+
pub fn ident_from_to(&self, start: BytePos, end: BytePos) -> ast::Ident {
230+
debug!("taking an ident from {} to {}", start, end);
231+
self.with_str_from_to(start, end, str_to_ident)
232+
}
233+
220234
/// Calls `f` with a string slice of the source text spanning from `start`
221235
/// up to but excluding `end`.
222236
fn with_str_from_to<T>(&self, start: BytePos, end: BytePos, f: |s: &str| -> T) -> T {

0 commit comments

Comments
 (0)