summaryrefslogtreecommitdiff
path: root/src/parse/parser.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/parse/parser.rs')
-rw-r--r--src/parse/parser.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/parse/parser.rs b/src/parse/parser.rs
index b7767772..986a36b0 100644
--- a/src/parse/parser.rs
+++ b/src/parse/parser.rs
@@ -243,6 +243,11 @@ impl<'s> Parser<'s> {
)
}
+ /// Peek at the source of the next token.
+ pub fn peek_src(&self) -> &'s str {
+ self.get(self.peek_span())
+ }
+
/// Checks whether the next token fulfills a condition.
///
/// Returns `false` if there is no next token.