| 1 | use superrust-analyzer cargo fluent-syntax 0.12.0 parser/::errorsrust-analyzer cargo fluent-syntax 0.12.0 parser/errors/::{ErrorKindrust-analyzer cargo fluent-syntax 0.12.0 parser/errors/ErrorKind#, ParserErrorrust-analyzer cargo fluent-syntax 0.12.0 parser/errors/ParserError#}; |
| 2 | use superrust-analyzer cargo fluent-syntax 0.12.0 parser/::{corerust-analyzer cargo fluent-syntax 0.12.0 parser/core/::Parserrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#, corerust-analyzer cargo fluent-syntax 0.12.0 parser/core/::Resultrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Result#, slicerust-analyzer cargo fluent-syntax 0.12.0 parser/slice/::Slicerust-analyzer cargo fluent-syntax 0.12.0 parser/slice/Slice#}; |
| 3 | |
| 4 | impl<'s, S> Parserrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#<S> |
| 5 | where |
| 6 | S: Slicerust-analyzer cargo fluent-syntax 0.12.0 parser/slice/Slice#<'s>, |
| 7 | { |
| 8 | pub(superrust-analyzer cargo fluent-syntax 0.12.0 parser/) fn is_current_byterust-analyzer cargo fluent-syntax 0.12.0 parser/helper/impl#[`Parser<S>`]is_current_byte().(&self, b: u8) -> bool { |
| 9 | get_current_byterust-analyzer cargo fluent-syntax 0.12.0 parser/macros/get_current_byte!!(self) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`][`PartialEq<Self>`]eq().Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(&b) |
| 10 | } |
| 11 | |
| 12 | pub(superrust-analyzer cargo fluent-syntax 0.12.0 parser/) fn is_byte_atrust-analyzer cargo fluent-syntax 0.12.0 parser/helper/impl#[`Parser<S>`]is_byte_at().(&self, b: u8, pos: usize) -> bool { |
| 13 | get_byterust-analyzer cargo fluent-syntax 0.12.0 parser/macros/get_byte!!(self, pos) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`][`PartialEq<Self>`]eq().Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(&b) |
| 14 | } |
| 15 | |
| 16 | pub(superrust-analyzer cargo fluent-syntax 0.12.0 parser/) fn skip_to_next_entry_startrust-analyzer cargo fluent-syntax 0.12.0 parser/helper/impl#[`Parser<S>`]skip_to_next_entry_start().(&mut self) { |
| 17 | while let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(b) = get_current_byterust-analyzer cargo fluent-syntax 0.12.0 parser/macros/get_current_byte!!(self) { |
| 18 | let new_line = self.ptrrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#ptr. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().0 || get_byterust-analyzer cargo fluent-syntax 0.12.0 parser/macros/get_byte!!(self, self.ptrrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#ptr. -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). 1) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`][`PartialEq<Self>`]eq().Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(&b'\n'); |
| 19 | |
| 20 | if new_line && (b.is_ascii_alphabeticrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u8]is_ascii_alphabetic().() || [b'-', b'#'].containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]contains().(b)) { |
| 21 | break; |
| 22 | } |
| 23 | |
| 24 | self.ptrrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#ptr. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().1; |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | pub(superrust-analyzer cargo fluent-syntax 0.12.0 parser/) fn skip_eolrust-analyzer cargo fluent-syntax 0.12.0 parser/helper/impl#[`Parser<S>`]skip_eol().(&mut self) -> bool { |
| 29 | match get_current_byterust-analyzer cargo fluent-syntax 0.12.0 parser/macros/get_current_byte!!(self) { |
| 30 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(b'\n') => { |
| 31 | self.ptrrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#ptr. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().1; |
| 32 | true |
| 33 | } |
| 34 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(b'\r') if self.is_byte_atrust-analyzer cargo fluent-syntax 0.12.0 parser/helper/impl#[`Parser<S>`]is_byte_at().(b'\n', self.ptrrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#ptr. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().1) => { |
| 35 | self.ptrrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#ptr. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().2; |
| 36 | true |
| 37 | } |
| 38 | _ => false, |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | pub(superrust-analyzer cargo fluent-syntax 0.12.0 parser/) fn skip_unicode_escape_sequencerust-analyzer cargo fluent-syntax 0.12.0 parser/helper/impl#[`Parser<S>`]skip_unicode_escape_sequence().(&mut self, length: usize) -> Resultrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Result#<()> { |
| 43 | let start = self.ptrrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#ptr.; |
| 44 | for _ in 0..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#length { |
| 45 | match get_current_byterust-analyzer cargo fluent-syntax 0.12.0 parser/macros/get_current_byte!!(self) { |
| 46 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(b) if b.is_ascii_hexdigitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u8]is_ascii_hexdigit().() => self.ptrrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#ptr. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().1, |
| 47 | _ => break, |
| 48 | } |
| 49 | } |
| 50 | if self.ptrrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#ptr. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().start rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne().length { |
| 51 | let end = if self.ptrrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#ptr. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge().>=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge().self.lengthrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#length. { |
| 52 | self.ptrrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#ptr. |
| 53 | } else { |
| 54 | self.ptrrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#ptr. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().1 |
| 55 | }; |
| 56 | let seq = self.sourcerust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#source..slicerust-analyzer cargo fluent-syntax 0.12.0 parser/slice/Slice#slice().(start..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#end).as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/AsRef#as_ref().().to_ownedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str][ToOwned]to_owned().(); |
| 57 | return errorrust-analyzer cargo fluent-syntax 0.12.0 parser/errors/error!!(ErrorKindrust-analyzer cargo fluent-syntax 0.12.0 parser/errors/ErrorKind#::InvalidUnicodeEscapeSequencerust-analyzer cargo fluent-syntax 0.12.0 parser/errors/ErrorKind#InvalidUnicodeEscapeSequence#(seq), self.ptrrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#ptr.); |
| 58 | } |
| 59 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()) |
| 60 | } |
| 61 | |
| 62 | pub(superrust-analyzer cargo fluent-syntax 0.12.0 parser/) fn is_identifier_startrust-analyzer cargo fluent-syntax 0.12.0 parser/helper/impl#[`Parser<S>`]is_identifier_start().(&self) -> bool { |
| 63 | matchesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/matches!!(get_current_byterust-analyzer cargo fluent-syntax 0.12.0 parser/macros/get_current_byte!!(self), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(b) if b.is_ascii_alphabeticrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u8]is_ascii_alphabetic().()) |
| 64 | } |
| 65 | |
| 66 | pub(superrust-analyzer cargo fluent-syntax 0.12.0 parser/) fn take_byte_ifrust-analyzer cargo fluent-syntax 0.12.0 parser/helper/impl#[`Parser<S>`]take_byte_if().(&mut self, b: u8) -> bool { |
| 67 | if self.is_current_byterust-analyzer cargo fluent-syntax 0.12.0 parser/helper/impl#[`Parser<S>`]is_current_byte().(b) { |
| 68 | self.ptrrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#ptr. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().1; |
| 69 | true |
| 70 | } else { |
| 71 | false |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | pub(superrust-analyzer cargo fluent-syntax 0.12.0 parser/) fn skip_blank_blockrust-analyzer cargo fluent-syntax 0.12.0 parser/helper/impl#[`Parser<S>`]skip_blank_block().(&mut self) -> usize { |
| 76 | let mut count = 0; |
| 77 | loop { |
| 78 | let start = self.ptrrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#ptr.; |
| 79 | self.skip_blank_inlinerust-analyzer cargo fluent-syntax 0.12.0 parser/helper/impl#[`Parser<S>`]skip_blank_inline().(); |
| 80 | if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().self.skip_eolrust-analyzer cargo fluent-syntax 0.12.0 parser/helper/impl#[`Parser<S>`]skip_eol().() { |
| 81 | self.ptrrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#ptr. = start; |
| 82 | break; |
| 83 | } |
| 84 | count rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().1; |
| 85 | } |
| 86 | count |
| 87 | } |
| 88 | |
| 89 | pub(superrust-analyzer cargo fluent-syntax 0.12.0 parser/) fn skip_blankrust-analyzer cargo fluent-syntax 0.12.0 parser/helper/impl#[`Parser<S>`]skip_blank().(&mut self) { |
| 90 | loop { |
| 91 | match get_current_byterust-analyzer cargo fluent-syntax 0.12.0 parser/macros/get_current_byte!!(self) { |
| 92 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(b' ') | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(b'\n') => self.ptrrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#ptr. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().1, |
| 93 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(b'\r') if get_byterust-analyzer cargo fluent-syntax 0.12.0 parser/macros/get_byte!!(self, self.ptrrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#ptr. +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). 1) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`][`PartialEq<Self>`]eq().Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(&b'\n') => self.ptrrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#ptr. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().2, |
| 94 | _ => break, |
| 95 | } |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | pub(superrust-analyzer cargo fluent-syntax 0.12.0 parser/) fn skip_blank_inlinerust-analyzer cargo fluent-syntax 0.12.0 parser/helper/impl#[`Parser<S>`]skip_blank_inline().(&mut self) -> usize { |
| 100 | let start = self.ptrrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#ptr.; |
| 101 | while let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(b' ') = get_current_byterust-analyzer cargo fluent-syntax 0.12.0 parser/macros/get_current_byte!!(self) { |
| 102 | self.ptrrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#ptr. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().1; |
| 103 | } |
| 104 | self.ptrrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#ptr. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().start |
| 105 | } |
| 106 | |
| 107 | pub(superrust-analyzer cargo fluent-syntax 0.12.0 parser/) fn is_byte_pattern_continuationrust-analyzer cargo fluent-syntax 0.12.0 parser/helper/impl#[`Parser<S>`]is_byte_pattern_continuation().(b: u8) -> bool { |
| 108 | !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().matchesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/matches!!(b, b'.' | b'}' | b'[' | b'*') |
| 109 | } |
| 110 | |
| 111 | pub(superrust-analyzer cargo fluent-syntax 0.12.0 parser/) fn is_calleerust-analyzer cargo fluent-syntax 0.12.0 parser/helper/impl#[`Parser<S>`]is_callee().(name: &S) -> bool { |
| 112 | name.as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/AsRef#as_ref().() |
| 113 | .as_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]as_bytes().() |
| 114 | .iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().() |
| 115 | .allrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/iter/impl#[`Iter<'a, T>`][Iterator]all().(|c| c.is_ascii_uppercaserust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u8]is_ascii_uppercase().() || c.is_ascii_digitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u8]is_ascii_digit().() || *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().c rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq().b'_' || *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().c rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq().b'-') |
| 116 | } |
| 117 | |
| 118 | pub(superrust-analyzer cargo fluent-syntax 0.12.0 parser/) fn expect_byterust-analyzer cargo fluent-syntax 0.12.0 parser/helper/impl#[`Parser<S>`]expect_byte().(&mut self, b: u8) -> Resultrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Result#<()> { |
| 119 | if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().self.is_current_byterust-analyzer cargo fluent-syntax 0.12.0 parser/helper/impl#[`Parser<S>`]is_current_byte().(b) { |
| 120 | return errorrust-analyzer cargo fluent-syntax 0.12.0 parser/errors/error!!(ErrorKindrust-analyzer cargo fluent-syntax 0.12.0 parser/errors/ErrorKind#::ExpectedTokenrust-analyzer cargo fluent-syntax 0.12.0 parser/errors/ErrorKind#ExpectedToken#(b as char), self.ptrrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#ptr.); |
| 121 | } |
| 122 | self.ptrrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#ptr. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().1; |
| 123 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()) |
| 124 | } |
| 125 | |
| 126 | pub(superrust-analyzer cargo fluent-syntax 0.12.0 parser/) fn is_number_startrust-analyzer cargo fluent-syntax 0.12.0 parser/helper/impl#[`Parser<S>`]is_number_start().(&self) -> bool { |
| 127 | matchesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/matches!!(get_current_byterust-analyzer cargo fluent-syntax 0.12.0 parser/macros/get_current_byte!!(self), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(b) if b.is_ascii_digitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u8]is_ascii_digit().() || b == &b'-') |
| 128 | } |
| 129 | |
| 130 | pub(superrust-analyzer cargo fluent-syntax 0.12.0 parser/) fn is_eolrust-analyzer cargo fluent-syntax 0.12.0 parser/helper/impl#[`Parser<S>`]is_eol().(&self) -> bool { |
| 131 | match get_current_byterust-analyzer cargo fluent-syntax 0.12.0 parser/macros/get_current_byte!!(self) { |
| 132 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(b'\n') => true, |
| 133 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(b'\r') if self.is_byte_atrust-analyzer cargo fluent-syntax 0.12.0 parser/helper/impl#[`Parser<S>`]is_byte_at().(b'\n', self.ptrrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#ptr. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().1) => true, |
| 134 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# => true, |
| 135 | _ => false, |
| 136 | } |
| 137 | } |
| 138 | |
| 139 | pub(superrust-analyzer cargo fluent-syntax 0.12.0 parser/) fn skip_digitsrust-analyzer cargo fluent-syntax 0.12.0 parser/helper/impl#[`Parser<S>`]skip_digits().(&mut self) -> Resultrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Result#<()> { |
| 140 | let start = self.ptrrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#ptr.; |
| 141 | loop { |
| 142 | match get_current_byterust-analyzer cargo fluent-syntax 0.12.0 parser/macros/get_current_byte!!(self) { |
| 143 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(b) if b.is_ascii_digitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u8]is_ascii_digit().() => self.ptrrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#ptr. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().1, |
| 144 | _ => break, |
| 145 | } |
| 146 | } |
| 147 | if start rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().self.ptrrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#ptr. { |
| 148 | errorrust-analyzer cargo fluent-syntax 0.12.0 parser/errors/error!!( |
| 149 | ErrorKindrust-analyzer cargo fluent-syntax 0.12.0 parser/errors/ErrorKind#::ExpectedCharRangerust-analyzer cargo fluent-syntax 0.12.0 parser/errors/ErrorKind#ExpectedCharRange# { |
| 150 | rangerust-analyzer cargo fluent-syntax 0.12.0 parser/errors/ErrorKind#ExpectedCharRange#range.: "0-9".to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().() |
| 151 | }, |
| 152 | self.ptrrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#ptr. |
| 153 | ) |
| 154 | } else { |
| 155 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()) |
| 156 | } |
| 157 | } |
| 158 | |
| 159 | pub(superrust-analyzer cargo fluent-syntax 0.12.0 parser/) fn get_number_literalrust-analyzer cargo fluent-syntax 0.12.0 parser/helper/impl#[`Parser<S>`]get_number_literal().(&mut self) -> Resultrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Result#<S> { |
| 160 | let start = self.ptrrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#ptr.; |
| 161 | self.take_byte_ifrust-analyzer cargo fluent-syntax 0.12.0 parser/helper/impl#[`Parser<S>`]take_byte_if().(b'-'); |
| 162 | self.skip_digitsrust-analyzer cargo fluent-syntax 0.12.0 parser/helper/impl#[`Parser<S>`]skip_digits().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 163 | if self.take_byte_ifrust-analyzer cargo fluent-syntax 0.12.0 parser/helper/impl#[`Parser<S>`]take_byte_if().(b'.') { |
| 164 | self.skip_digitsrust-analyzer cargo fluent-syntax 0.12.0 parser/helper/impl#[`Parser<S>`]skip_digits().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 165 | } |
| 166 | |
| 167 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(self.sourcerust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#source..slicerust-analyzer cargo fluent-syntax 0.12.0 parser/slice/Slice#slice().(start..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#self.ptrrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#ptr.)) |
| 168 | } |
| 169 | } |