Sort ParseBuffer methods by likelihood of use
diff --git a/src/parse.rs b/src/parse.rs
index 72e564f..ae5020a 100644
--- a/src/parse.rs
+++ b/src/parse.rs
@@ -230,18 +230,6 @@
}
impl<'a> ParseBuffer<'a> {
- pub fn cursor(&self) -> Cursor<'a> {
- self.cell.get()
- }
-
- pub fn is_empty(&self) -> bool {
- self.cursor().eof()
- }
-
- pub fn lookahead1(&self) -> Lookahead1<'a> {
- lookahead::new(self.scope, self.cursor())
- }
-
pub fn parse<T: Parse>(&self) -> Result<T> {
self.check_unexpected()?;
T::parse(self)
@@ -272,6 +260,14 @@
Punctuated::parse_terminated_with(self, parser)
}
+ pub fn is_empty(&self) -> bool {
+ self.cursor().eof()
+ }
+
+ pub fn lookahead1(&self) -> Lookahead1<'a> {
+ lookahead::new(self.scope, self.cursor())
+ }
+
pub fn fork(&self) -> Self {
ParseBuffer {
scope: self.scope,
@@ -305,6 +301,10 @@
}
}
+ pub fn cursor(&self) -> Cursor<'a> {
+ self.cell.get()
+ }
+
fn check_unexpected(&self) -> Result<()> {
match self.unexpected.get() {
Some(span) => Err(Error::new(span, "unexpected token")),