diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/parser.rs | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/src/parser.rs b/src/parser.rs index 35b57fa..9eb506a 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -292,22 +292,7 @@ impl<'a> Parser<'a> { // Parse an array index as a natural number fn array_index(&mut self) -> Option<String> { - let mut index = String::new(); - while let Some((_, ch)) = self.peek(0) { - match ch { - v @ '0' ... '9' => { - if !self.eat(v) { - return None - } - index.push(v); - } - _ => return Some(index), - } - } - if index.len() > 0 { - return Some(index); - } - None + self.integer(0, false, false) } /// Parse a path into a vector of paths |