summaryrefslogtreecommitdiff
path: root/src/parse/parser.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-02-03 21:30:36 +0100
committerLaurenz <laurmaedje@gmail.com>2021-02-03 21:34:49 +0100
commitd86a5e8a1f469dd79abf3137dba77a71fae2a774 (patch)
treefc7ab35d999322b9d124e41ab80948df23965d26 /src/parse/parser.rs
parent6fcef9973be4253e5b377251dd9d1921f9738fc1 (diff)
Tidy up raw blocks 🧹
- Better trimming (only trim at the end if necessary) - Fixed block-level layouting - Improved pretty printing - Flip inline variable to block - Flip inline variable to display for math formulas
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.