| 1 | use craterust-analyzer cargo pp-rs 0.2.1 crate/::tokenrust-analyzer cargo pp-rs 0.2.1 token/::{Integerrust-analyzer cargo pp-rs 0.2.1 token/Integer#, PreprocessorErrorrust-analyzer cargo pp-rs 0.2.1 token/PreprocessorError#, Punctrust-analyzer cargo pp-rs 0.2.1 token/Punct#}; |
| 2 | |
| 3 | use superrust-analyzer cargo pp-rs 0.2.1 pp/::{Definerust-analyzer cargo pp-rs 0.2.1 pp/Define#, Locationrust-analyzer cargo pp-rs 0.2.1 token/Location#, MacroProcessorrust-analyzer cargo pp-rs 0.2.1 pp/MacroProcessor#, MeLexerrust-analyzer cargo pp-rs 0.2.1 pp/MeLexer#, Steprust-analyzer cargo pp-rs 0.2.1 pp/Step#, StepExitrust-analyzer cargo pp-rs 0.2.1 pp/StepExit#, Tokenrust-analyzer cargo pp-rs 0.2.1 token/Token#, TokenValuerust-analyzer cargo pp-rs 0.2.1 token/TokenValue#}; |
| 4 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::{collectionsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/::HashMaprust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/HashMap#, convertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/::TryIntorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/TryInto#, rcrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc rc/::Rcrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc rc/Rc#, vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/}; |
| 5 | |
| 6 | struct IfLexerrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/IfLexer#<'macros> { |
| 7 | tokensrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/IfLexer#tokens.: vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/::IntoIterrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/into_iter/IntoIter#<Tokenrust-analyzer cargo pp-rs 0.2.1 token/Token#>, |
| 8 | definesrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/IfLexer#defines.: &'macros HashMaprust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/HashMap#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#, Rcrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc rc/Rc#<Definerust-analyzer cargo pp-rs 0.2.1 pp/Define#>>, |
| 9 | } |
| 10 | |
| 11 | pub(superrust-analyzer cargo pp-rs 0.2.1 pp/) struct IfParserrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/IfParser#<'macros> { |
| 12 | lexerrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/IfParser#lexer.: IfLexerrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/IfLexer#<'macros>, |
| 13 | macro_processorrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/IfParser#macro_processor.: MacroProcessorrust-analyzer cargo pp-rs 0.2.1 pp/MacroProcessor#, |
| 14 | locationrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/IfParser#location.: Locationrust-analyzer cargo pp-rs 0.2.1 token/Location#, |
| 15 | |
| 16 | parsing_ifrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/IfParser#parsing_if.: bool, |
| 17 | carryrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/IfParser#carry.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Tokenrust-analyzer cargo pp-rs 0.2.1 token/Token#>, |
| 18 | } |
| 19 | |
| 20 | impl<'macros> IfParserrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/IfParser#<'macros> { |
| 21 | /// Builds a new IfParser that can be reused |
| 22 | /// |
| 23 | /// `parsing_if` indicates wether or not non defined macros should be |
| 24 | /// replaced with 0 |
| 25 | pub fn newrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]new().( |
| 26 | tokens: Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<Tokenrust-analyzer cargo pp-rs 0.2.1 token/Token#>, |
| 27 | defines: &'macros HashMaprust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/HashMap#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#, Rcrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc rc/Rc#<Definerust-analyzer cargo pp-rs 0.2.1 pp/Define#>>, |
| 28 | location: Locationrust-analyzer cargo pp-rs 0.2.1 token/Location#, |
| 29 | parsing_if: bool, |
| 30 | ) -> Selfrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`] { |
| 31 | IfParserrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/IfParser# { |
| 32 | lexerrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/IfParser#lexer.: IfLexerrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/IfLexer# { |
| 33 | tokensrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/IfLexer#tokens.: tokens.into_iterrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][IntoIterator]into_iter().(), |
| 34 | definesrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/IfLexer#defines., |
| 35 | }, |
| 36 | macro_processorrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/IfParser#macro_processor.: MacroProcessorrust-analyzer cargo pp-rs 0.2.1 pp/MacroProcessor#::defaultrust-analyzer cargo pp-rs 0.2.1 pp/impl#[MacroProcessor][Default]default().(), |
| 37 | locationrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/IfParser#location., |
| 38 | |
| 39 | parsing_ifrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/IfParser#parsing_if., |
| 40 | carryrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/IfParser#carry.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | /// Helper method to consume the next token without define expansion |
| 45 | fn raw_nextrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]raw_next().(&mut self) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Tokenrust-analyzer cargo pp-rs 0.2.1 token/Token#> { |
| 46 | self.carryrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/IfParser#carry. |
| 47 | .takerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]take().() |
| 48 | .or_elserust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]or_else().(|| self.macro_processorrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/IfParser#macro_processor..steprust-analyzer cargo pp-rs 0.2.1 pp/impl#[MacroProcessor]step().(&mut self.lexerrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/IfParser#lexer.).okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]ok().()) |
| 49 | } |
| 50 | |
| 51 | /// Helper method to consume the next token with define expansion |
| 52 | fn nextrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]next().(&mut self) -> Steprust-analyzer cargo pp-rs 0.2.1 pp/Step#<Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Tokenrust-analyzer cargo pp-rs 0.2.1 token/Token#>> { |
| 53 | let token = match self.raw_nextrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]raw_next().() { |
| 54 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(t) => t, |
| 55 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# => return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#), |
| 56 | }; |
| 57 | |
| 58 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(match token.valuerust-analyzer cargo pp-rs 0.2.1 token/Token#value. { |
| 59 | TokenValuerust-analyzer cargo pp-rs 0.2.1 token/TokenValue#::Identrust-analyzer cargo pp-rs 0.2.1 token/TokenValue#Ident#(ref name) if name rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]ne()."defined" => { |
| 60 | match self.add_definerust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]add_define().(name, token.locationrust-analyzer cargo pp-rs 0.2.1 token/Token#location.)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). { |
| 61 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(t) => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(t), |
| 62 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# => self.nextrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]next().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()., |
| 63 | } |
| 64 | } |
| 65 | _ => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(token), |
| 66 | }) |
| 67 | } |
| 68 | |
| 69 | /// Helper method to get the next token with define expansion |
| 70 | pub fn peekrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]peek().(&mut self) -> Steprust-analyzer cargo pp-rs 0.2.1 pp/Step#<Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Tokenrust-analyzer cargo pp-rs 0.2.1 token/Token#>> { |
| 71 | self.carryrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/IfParser#carry. = self.nextrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]next().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 72 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(self.carryrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/IfParser#carry..clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`][Clone]clone().()) |
| 73 | } |
| 74 | |
| 75 | /// Helper method to consume the next token without define expansion |
| 76 | /// |
| 77 | /// Returns an EOI error if there are no further tokens |
| 78 | fn expect_raw_nextrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]expect_raw_next().(&mut self) -> Steprust-analyzer cargo pp-rs 0.2.1 pp/Step#<Tokenrust-analyzer cargo pp-rs 0.2.1 token/Token#> { |
| 79 | self.raw_nextrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]raw_next().().ok_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]ok_or().(StepExitrust-analyzer cargo pp-rs 0.2.1 pp/StepExit#::Errorrust-analyzer cargo pp-rs 0.2.1 pp/StepExit#Error#(( |
| 80 | PreprocessorErrorrust-analyzer cargo pp-rs 0.2.1 token/PreprocessorError#::UnexpectedEndOfInputrust-analyzer cargo pp-rs 0.2.1 token/PreprocessorError#UnexpectedEndOfInput#, |
| 81 | self.locationrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/IfParser#location., |
| 82 | ))) |
| 83 | } |
| 84 | |
| 85 | /// Helper method to consume the next token with define expansion |
| 86 | /// |
| 87 | /// Returns an EOI error if there are no further tokens |
| 88 | fn expect_nextrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]expect_next().(&mut self) -> Steprust-analyzer cargo pp-rs 0.2.1 pp/Step#<Tokenrust-analyzer cargo pp-rs 0.2.1 token/Token#> { |
| 89 | self.nextrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]next().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()..ok_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]ok_or().(StepExitrust-analyzer cargo pp-rs 0.2.1 pp/StepExit#::Errorrust-analyzer cargo pp-rs 0.2.1 pp/StepExit#Error#(( |
| 90 | PreprocessorErrorrust-analyzer cargo pp-rs 0.2.1 token/PreprocessorError#::UnexpectedEndOfInputrust-analyzer cargo pp-rs 0.2.1 token/PreprocessorError#UnexpectedEndOfInput#, |
| 91 | self.locationrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/IfParser#location., |
| 92 | ))) |
| 93 | } |
| 94 | |
| 95 | /// Helper method to get the next token with define expansion |
| 96 | /// |
| 97 | /// Returns an EOI error if there are no further tokens |
| 98 | fn expect_peekrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]expect_peek().(&mut self) -> Steprust-analyzer cargo pp-rs 0.2.1 pp/Step#<Tokenrust-analyzer cargo pp-rs 0.2.1 token/Token#> { |
| 99 | self.peekrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]peek().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()..ok_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]ok_or().(StepExitrust-analyzer cargo pp-rs 0.2.1 pp/StepExit#::Errorrust-analyzer cargo pp-rs 0.2.1 pp/StepExit#Error#(( |
| 100 | PreprocessorErrorrust-analyzer cargo pp-rs 0.2.1 token/PreprocessorError#::UnexpectedEndOfInputrust-analyzer cargo pp-rs 0.2.1 token/PreprocessorError#UnexpectedEndOfInput#, |
| 101 | self.locationrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/IfParser#location., |
| 102 | ))) |
| 103 | } |
| 104 | |
| 105 | fn add_definerust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]add_define().(&mut self, name: &str, location: Locationrust-analyzer cargo pp-rs 0.2.1 token/Location#) -> Steprust-analyzer cargo pp-rs 0.2.1 pp/Step#<Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Tokenrust-analyzer cargo pp-rs 0.2.1 token/Token#>> { |
| 106 | if self |
| 107 | .macro_processorrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/IfParser#macro_processor. |
| 108 | .start_define_invocationrust-analyzer cargo pp-rs 0.2.1 pp/impl#[MacroProcessor]start_define_invocation().(name, location, &mut self.lexerrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/IfParser#lexer.)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). |
| 109 | { |
| 110 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#) |
| 111 | } else if self.parsing_ifrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/IfParser#parsing_if. { |
| 112 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Tokenrust-analyzer cargo pp-rs 0.2.1 token/Token# { |
| 113 | valuerust-analyzer cargo pp-rs 0.2.1 token/Token#value.: TokenValuerust-analyzer cargo pp-rs 0.2.1 token/TokenValue#::Integerrust-analyzer cargo pp-rs 0.2.1 token/TokenValue#Integer#(Integerrust-analyzer cargo pp-rs 0.2.1 token/Integer# { |
| 114 | valuerust-analyzer cargo pp-rs 0.2.1 token/Integer#value.: 0, |
| 115 | signedrust-analyzer cargo pp-rs 0.2.1 token/Integer#signed.: true, |
| 116 | widthrust-analyzer cargo pp-rs 0.2.1 token/Integer#width.: 64, |
| 117 | }), |
| 118 | locationrust-analyzer cargo pp-rs 0.2.1 token/Token#location., |
| 119 | })) |
| 120 | } else { |
| 121 | Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(StepExitrust-analyzer cargo pp-rs 0.2.1 pp/StepExit#::Errorrust-analyzer cargo pp-rs 0.2.1 pp/StepExit#Error#(( |
| 122 | PreprocessorErrorrust-analyzer cargo pp-rs 0.2.1 token/PreprocessorError#::UnexpectedTokenrust-analyzer cargo pp-rs 0.2.1 token/PreprocessorError#UnexpectedToken#(TokenValuerust-analyzer cargo pp-rs 0.2.1 token/TokenValue#::Identrust-analyzer cargo pp-rs 0.2.1 token/TokenValue#Ident#(name.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().())), |
| 123 | location, |
| 124 | ))) |
| 125 | } |
| 126 | } |
| 127 | |
| 128 | fn handle_definedrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]handle_defined().(&mut self) -> Steprust-analyzer cargo pp-rs 0.2.1 pp/Step#<i64> { |
| 129 | let next = self.expect_raw_nextrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]expect_raw_next().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 130 | |
| 131 | match next.valuerust-analyzer cargo pp-rs 0.2.1 token/Token#value. { |
| 132 | TokenValuerust-analyzer cargo pp-rs 0.2.1 token/TokenValue#::Identrust-analyzer cargo pp-rs 0.2.1 token/TokenValue#Ident#(ref name) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(self.lexerrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/IfParser#lexer..definesrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/IfLexer#defines..getrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/impl#[`HashMap<K, V, S, A>`]get().(name).is_somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_some().() as i64), |
| 133 | TokenValuerust-analyzer cargo pp-rs 0.2.1 token/TokenValue#::Punctrust-analyzer cargo pp-rs 0.2.1 token/TokenValue#Punct#(Punctrust-analyzer cargo pp-rs 0.2.1 token/Punct#::LeftParenrust-analyzer cargo pp-rs 0.2.1 token/Punct#LeftParen#) => { |
| 134 | let name_token = self.expect_raw_nextrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]expect_raw_next().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 135 | let name = match name_token.valuerust-analyzer cargo pp-rs 0.2.1 token/Token#value. { |
| 136 | TokenValuerust-analyzer cargo pp-rs 0.2.1 token/TokenValue#::Identrust-analyzer cargo pp-rs 0.2.1 token/TokenValue#Ident#(name) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(name), |
| 137 | value => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(StepExitrust-analyzer cargo pp-rs 0.2.1 pp/StepExit#::Errorrust-analyzer cargo pp-rs 0.2.1 pp/StepExit#Error#(( |
| 138 | PreprocessorErrorrust-analyzer cargo pp-rs 0.2.1 token/PreprocessorError#::UnexpectedTokenrust-analyzer cargo pp-rs 0.2.1 token/PreprocessorError#UnexpectedToken#(value), |
| 139 | name_token.locationrust-analyzer cargo pp-rs 0.2.1 token/Token#location., |
| 140 | ))), |
| 141 | }?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 142 | |
| 143 | let close_brace = self.expect_nextrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]expect_next().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 144 | |
| 145 | match close_brace.valuerust-analyzer cargo pp-rs 0.2.1 token/Token#value. { |
| 146 | TokenValuerust-analyzer cargo pp-rs 0.2.1 token/TokenValue#::Punctrust-analyzer cargo pp-rs 0.2.1 token/TokenValue#Punct#(Punctrust-analyzer cargo pp-rs 0.2.1 token/Punct#::RightParenrust-analyzer cargo pp-rs 0.2.1 token/Punct#RightParen#) => { |
| 147 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(self.lexerrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/IfParser#lexer..definesrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/IfLexer#defines..getrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/impl#[`HashMap<K, V, S, A>`]get().(&name).is_somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_some().() as i64) |
| 148 | } |
| 149 | value => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(StepExitrust-analyzer cargo pp-rs 0.2.1 pp/StepExit#::Errorrust-analyzer cargo pp-rs 0.2.1 pp/StepExit#Error#(( |
| 150 | PreprocessorErrorrust-analyzer cargo pp-rs 0.2.1 token/PreprocessorError#::UnexpectedTokenrust-analyzer cargo pp-rs 0.2.1 token/PreprocessorError#UnexpectedToken#(value), |
| 151 | close_brace.locationrust-analyzer cargo pp-rs 0.2.1 token/Token#location., |
| 152 | ))), |
| 153 | } |
| 154 | } |
| 155 | value => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(StepExitrust-analyzer cargo pp-rs 0.2.1 pp/StepExit#::Errorrust-analyzer cargo pp-rs 0.2.1 pp/StepExit#Error#(( |
| 156 | PreprocessorErrorrust-analyzer cargo pp-rs 0.2.1 token/PreprocessorError#::UnexpectedTokenrust-analyzer cargo pp-rs 0.2.1 token/PreprocessorError#UnexpectedToken#(value), |
| 157 | next.locationrust-analyzer cargo pp-rs 0.2.1 token/Token#location., |
| 158 | ))), |
| 159 | } |
| 160 | } |
| 161 | |
| 162 | fn parse_atomrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]parse_atom().(&mut self) -> Steprust-analyzer cargo pp-rs 0.2.1 pp/Step#<i64> { |
| 163 | let token = self.expect_nextrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]expect_next().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 164 | |
| 165 | match token.valuerust-analyzer cargo pp-rs 0.2.1 token/Token#value. { |
| 166 | TokenValuerust-analyzer cargo pp-rs 0.2.1 token/TokenValue#::Identrust-analyzer cargo pp-rs 0.2.1 token/TokenValue#Ident#(name) => { |
| 167 | debug_assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/debug_assert_eq!!(name, "defined"); |
| 168 | |
| 169 | self.handle_definedrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]handle_defined().() |
| 170 | } |
| 171 | TokenValuerust-analyzer cargo pp-rs 0.2.1 token/TokenValue#::Integerrust-analyzer cargo pp-rs 0.2.1 token/TokenValue#Integer#(int) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(int.valuerust-analyzer cargo pp-rs 0.2.1 token/Integer#value. as i64), |
| 172 | TokenValuerust-analyzer cargo pp-rs 0.2.1 token/TokenValue#::Punctrust-analyzer cargo pp-rs 0.2.1 token/TokenValue#Punct#(Punctrust-analyzer cargo pp-rs 0.2.1 token/Punct#::LeftParenrust-analyzer cargo pp-rs 0.2.1 token/Punct#LeftParen#) => { |
| 173 | let val = self.parse_logical_orrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]parse_logical_or().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 174 | |
| 175 | let close_brace = self.expect_nextrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]expect_next().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 176 | |
| 177 | match close_brace.valuerust-analyzer cargo pp-rs 0.2.1 token/Token#value. { |
| 178 | TokenValuerust-analyzer cargo pp-rs 0.2.1 token/TokenValue#::Punctrust-analyzer cargo pp-rs 0.2.1 token/TokenValue#Punct#(Punctrust-analyzer cargo pp-rs 0.2.1 token/Punct#::RightParenrust-analyzer cargo pp-rs 0.2.1 token/Punct#RightParen#) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(val), |
| 179 | value => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(StepExitrust-analyzer cargo pp-rs 0.2.1 pp/StepExit#::Errorrust-analyzer cargo pp-rs 0.2.1 pp/StepExit#Error#(( |
| 180 | PreprocessorErrorrust-analyzer cargo pp-rs 0.2.1 token/PreprocessorError#::UnexpectedTokenrust-analyzer cargo pp-rs 0.2.1 token/PreprocessorError#UnexpectedToken#(value), |
| 181 | close_brace.locationrust-analyzer cargo pp-rs 0.2.1 token/Token#location., |
| 182 | ))), |
| 183 | } |
| 184 | } |
| 185 | value => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(StepExitrust-analyzer cargo pp-rs 0.2.1 pp/StepExit#::Errorrust-analyzer cargo pp-rs 0.2.1 pp/StepExit#Error#(( |
| 186 | PreprocessorErrorrust-analyzer cargo pp-rs 0.2.1 token/PreprocessorError#::UnexpectedTokenrust-analyzer cargo pp-rs 0.2.1 token/PreprocessorError#UnexpectedToken#(value), |
| 187 | token.locationrust-analyzer cargo pp-rs 0.2.1 token/Token#location., |
| 188 | ))), |
| 189 | } |
| 190 | } |
| 191 | |
| 192 | fn parse_unaryrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]parse_unary().(&mut self) -> Steprust-analyzer cargo pp-rs 0.2.1 pp/Step#<i64> { |
| 193 | match self.expect_peekrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]expect_peek().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()..valuerust-analyzer cargo pp-rs 0.2.1 token/Token#value. { |
| 194 | TokenValuerust-analyzer cargo pp-rs 0.2.1 token/TokenValue#::Punctrust-analyzer cargo pp-rs 0.2.1 token/TokenValue#Punct#(punct) => match punct { |
| 195 | Punctrust-analyzer cargo pp-rs 0.2.1 token/Punct#::Plusrust-analyzer cargo pp-rs 0.2.1 token/Punct#Plus# | Punctrust-analyzer cargo pp-rs 0.2.1 token/Punct#::Minusrust-analyzer cargo pp-rs 0.2.1 token/Punct#Minus# | Punctrust-analyzer cargo pp-rs 0.2.1 token/Punct#::Bangrust-analyzer cargo pp-rs 0.2.1 token/Punct#Bang# | Punctrust-analyzer cargo pp-rs 0.2.1 token/Punct#::Tilderust-analyzer cargo pp-rs 0.2.1 token/Punct#Tilde# => { |
| 196 | self.nextrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]next().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 197 | |
| 198 | let val = self.parse_unaryrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]parse_unary().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 199 | |
| 200 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(match punct { |
| 201 | Punctrust-analyzer cargo pp-rs 0.2.1 token/Punct#::Plusrust-analyzer cargo pp-rs 0.2.1 token/Punct#Plus# => val, |
| 202 | Punctrust-analyzer cargo pp-rs 0.2.1 token/Punct#::Minusrust-analyzer cargo pp-rs 0.2.1 token/Punct#Minus# => -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][Neg]neg().val, |
| 203 | Punctrust-analyzer cargo pp-rs 0.2.1 token/Punct#::Bangrust-analyzer cargo pp-rs 0.2.1 token/Punct#Bang# => (val rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialEq<Self>`]eq().0) as i64, |
| 204 | Punctrust-analyzer cargo pp-rs 0.2.1 token/Punct#::Tilderust-analyzer cargo pp-rs 0.2.1 token/Punct#Tilde# => !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i64][Not]not().val, |
| 205 | _ => unreachablerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/unreachable!!(), |
| 206 | }) |
| 207 | } |
| 208 | _ => self.parse_atomrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]parse_atom().(), |
| 209 | }, |
| 210 | _ => self.parse_atomrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]parse_atom().(), |
| 211 | } |
| 212 | } |
| 213 | |
| 214 | fn parse_multiplicativerust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]parse_multiplicative().(&mut self) -> Steprust-analyzer cargo pp-rs 0.2.1 pp/Step#<i64> { |
| 215 | let mut left = self.parse_unaryrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]parse_unary().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 216 | |
| 217 | while let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(TokenValuerust-analyzer cargo pp-rs 0.2.1 token/TokenValue#::Punctrust-analyzer cargo pp-rs 0.2.1 token/TokenValue#Punct#(punct)) = self.peekrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]peek().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()..maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]map().(|t| t.valuerust-analyzer cargo pp-rs 0.2.1 token/Token#value.) { |
| 218 | if let Punctrust-analyzer cargo pp-rs 0.2.1 token/Punct#::Starrust-analyzer cargo pp-rs 0.2.1 token/Punct#Star# | Punctrust-analyzer cargo pp-rs 0.2.1 token/Punct#::Slashrust-analyzer cargo pp-rs 0.2.1 token/Punct#Slash# | Punctrust-analyzer cargo pp-rs 0.2.1 token/Punct#::Percentrust-analyzer cargo pp-rs 0.2.1 token/Punct#Percent# = punct { |
| 219 | self.nextrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]next().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 220 | |
| 221 | let right = self.parse_unaryrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]parse_unary().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 222 | |
| 223 | match punct { |
| 224 | Punctrust-analyzer cargo pp-rs 0.2.1 token/Punct#::Starrust-analyzer cargo pp-rs 0.2.1 token/Punct#Star# => { |
| 225 | left = left.checked_mulrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[i64]checked_mul().(right).ok_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]ok_or().(StepExitrust-analyzer cargo pp-rs 0.2.1 pp/StepExit#::Errorrust-analyzer cargo pp-rs 0.2.1 pp/StepExit#Error#(( |
| 226 | PreprocessorErrorrust-analyzer cargo pp-rs 0.2.1 token/PreprocessorError#::IntegerOverflowrust-analyzer cargo pp-rs 0.2.1 token/PreprocessorError#IntegerOverflow#, |
| 227 | self.locationrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/IfParser#location., |
| 228 | )))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). |
| 229 | } |
| 230 | Punctrust-analyzer cargo pp-rs 0.2.1 token/Punct#::Slashrust-analyzer cargo pp-rs 0.2.1 token/Punct#Slash# => { |
| 231 | left = left.checked_divrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[i64]checked_div().(right).ok_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]ok_or().(StepExitrust-analyzer cargo pp-rs 0.2.1 pp/StepExit#::Errorrust-analyzer cargo pp-rs 0.2.1 pp/StepExit#Error#(( |
| 232 | PreprocessorErrorrust-analyzer cargo pp-rs 0.2.1 token/PreprocessorError#::DivisionByZerorust-analyzer cargo pp-rs 0.2.1 token/PreprocessorError#DivisionByZero#, |
| 233 | self.locationrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/IfParser#location., |
| 234 | )))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). |
| 235 | } |
| 236 | Punctrust-analyzer cargo pp-rs 0.2.1 token/Punct#::Percentrust-analyzer cargo pp-rs 0.2.1 token/Punct#Percent# => { |
| 237 | left = left.checked_remrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[i64]checked_rem().(right).ok_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]ok_or().(StepExitrust-analyzer cargo pp-rs 0.2.1 pp/StepExit#::Errorrust-analyzer cargo pp-rs 0.2.1 pp/StepExit#Error#(( |
| 238 | PreprocessorErrorrust-analyzer cargo pp-rs 0.2.1 token/PreprocessorError#::DivisionByZerorust-analyzer cargo pp-rs 0.2.1 token/PreprocessorError#DivisionByZero#, |
| 239 | self.locationrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/IfParser#location., |
| 240 | )))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). |
| 241 | } |
| 242 | _ => unreachablerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/unreachable!!(), |
| 243 | } |
| 244 | } else { |
| 245 | break; |
| 246 | } |
| 247 | } |
| 248 | |
| 249 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(left) |
| 250 | } |
| 251 | |
| 252 | fn parse_additiverust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]parse_additive().(&mut self) -> Steprust-analyzer cargo pp-rs 0.2.1 pp/Step#<i64> { |
| 253 | let mut left = self.parse_multiplicativerust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]parse_multiplicative().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 254 | |
| 255 | while let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(TokenValuerust-analyzer cargo pp-rs 0.2.1 token/TokenValue#::Punctrust-analyzer cargo pp-rs 0.2.1 token/TokenValue#Punct#(punct)) = self.peekrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]peek().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()..maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]map().(|t| t.valuerust-analyzer cargo pp-rs 0.2.1 token/Token#value.) { |
| 256 | if let Punctrust-analyzer cargo pp-rs 0.2.1 token/Punct#::Plusrust-analyzer cargo pp-rs 0.2.1 token/Punct#Plus# | Punctrust-analyzer cargo pp-rs 0.2.1 token/Punct#::Minusrust-analyzer cargo pp-rs 0.2.1 token/Punct#Minus# = punct { |
| 257 | self.nextrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]next().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 258 | |
| 259 | let right = self.parse_multiplicativerust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]parse_multiplicative().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 260 | |
| 261 | match punct { |
| 262 | Punctrust-analyzer cargo pp-rs 0.2.1 token/Punct#::Plusrust-analyzer cargo pp-rs 0.2.1 token/Punct#Plus# => { |
| 263 | left = left.checked_addrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[i64]checked_add().(right).ok_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]ok_or().(StepExitrust-analyzer cargo pp-rs 0.2.1 pp/StepExit#::Errorrust-analyzer cargo pp-rs 0.2.1 pp/StepExit#Error#(( |
| 264 | PreprocessorErrorrust-analyzer cargo pp-rs 0.2.1 token/PreprocessorError#::IntegerOverflowrust-analyzer cargo pp-rs 0.2.1 token/PreprocessorError#IntegerOverflow#, |
| 265 | self.locationrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/IfParser#location., |
| 266 | )))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). |
| 267 | } |
| 268 | Punctrust-analyzer cargo pp-rs 0.2.1 token/Punct#::Minusrust-analyzer cargo pp-rs 0.2.1 token/Punct#Minus# => { |
| 269 | left = left.checked_subrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[i64]checked_sub().(right).ok_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]ok_or().(StepExitrust-analyzer cargo pp-rs 0.2.1 pp/StepExit#::Errorrust-analyzer cargo pp-rs 0.2.1 pp/StepExit#Error#(( |
| 270 | PreprocessorErrorrust-analyzer cargo pp-rs 0.2.1 token/PreprocessorError#::IntegerOverflowrust-analyzer cargo pp-rs 0.2.1 token/PreprocessorError#IntegerOverflow#, |
| 271 | self.locationrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/IfParser#location., |
| 272 | )))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). |
| 273 | } |
| 274 | _ => unreachablerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/unreachable!!(), |
| 275 | } |
| 276 | } else { |
| 277 | break; |
| 278 | } |
| 279 | } |
| 280 | |
| 281 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(left) |
| 282 | } |
| 283 | |
| 284 | fn parse_shiftrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]parse_shift().(&mut self) -> Steprust-analyzer cargo pp-rs 0.2.1 pp/Step#<i64> { |
| 285 | let mut left = self.parse_additiverust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]parse_additive().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 286 | |
| 287 | while let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(TokenValuerust-analyzer cargo pp-rs 0.2.1 token/TokenValue#::Punctrust-analyzer cargo pp-rs 0.2.1 token/TokenValue#Punct#(punct)) = self.peekrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]peek().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()..maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]map().(|t| t.valuerust-analyzer cargo pp-rs 0.2.1 token/Token#value.) { |
| 288 | if let Punctrust-analyzer cargo pp-rs 0.2.1 token/Punct#::LeftShiftrust-analyzer cargo pp-rs 0.2.1 token/Punct#LeftShift# | Punctrust-analyzer cargo pp-rs 0.2.1 token/Punct#::RightShiftrust-analyzer cargo pp-rs 0.2.1 token/Punct#RightShift# = punct { |
| 289 | self.nextrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]next().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 290 | |
| 291 | let right = self.parse_additiverust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]parse_additive().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 292 | |
| 293 | match punct { |
| 294 | Punctrust-analyzer cargo pp-rs 0.2.1 token/Punct#::LeftShiftrust-analyzer cargo pp-rs 0.2.1 token/Punct#LeftShift# => { |
| 295 | let right = right.try_intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`TryInto<U>`]try_into().().map_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]map_err().(|_| { |
| 296 | StepExitrust-analyzer cargo pp-rs 0.2.1 pp/StepExit#::Errorrust-analyzer cargo pp-rs 0.2.1 pp/StepExit#Error#((PreprocessorErrorrust-analyzer cargo pp-rs 0.2.1 token/PreprocessorError#::IntegerOverflowrust-analyzer cargo pp-rs 0.2.1 token/PreprocessorError#IntegerOverflow#, self.locationrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/IfParser#location.)) |
| 297 | })?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 298 | left = left.checked_shlrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[i64]checked_shl().(right).ok_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]ok_or().(StepExitrust-analyzer cargo pp-rs 0.2.1 pp/StepExit#::Errorrust-analyzer cargo pp-rs 0.2.1 pp/StepExit#Error#(( |
| 299 | PreprocessorErrorrust-analyzer cargo pp-rs 0.2.1 token/PreprocessorError#::IntegerOverflowrust-analyzer cargo pp-rs 0.2.1 token/PreprocessorError#IntegerOverflow#, |
| 300 | self.locationrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/IfParser#location., |
| 301 | )))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). |
| 302 | } |
| 303 | Punctrust-analyzer cargo pp-rs 0.2.1 token/Punct#::RightShiftrust-analyzer cargo pp-rs 0.2.1 token/Punct#RightShift# => { |
| 304 | let right = right.try_intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`TryInto<U>`]try_into().().map_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]map_err().(|_| { |
| 305 | StepExitrust-analyzer cargo pp-rs 0.2.1 pp/StepExit#::Errorrust-analyzer cargo pp-rs 0.2.1 pp/StepExit#Error#((PreprocessorErrorrust-analyzer cargo pp-rs 0.2.1 token/PreprocessorError#::IntegerOverflowrust-analyzer cargo pp-rs 0.2.1 token/PreprocessorError#IntegerOverflow#, self.locationrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/IfParser#location.)) |
| 306 | })?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 307 | left = left.checked_shrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[i64]checked_shr().(right).ok_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]ok_or().(StepExitrust-analyzer cargo pp-rs 0.2.1 pp/StepExit#::Errorrust-analyzer cargo pp-rs 0.2.1 pp/StepExit#Error#(( |
| 308 | PreprocessorErrorrust-analyzer cargo pp-rs 0.2.1 token/PreprocessorError#::IntegerOverflowrust-analyzer cargo pp-rs 0.2.1 token/PreprocessorError#IntegerOverflow#, |
| 309 | self.locationrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/IfParser#location., |
| 310 | )))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). |
| 311 | } |
| 312 | _ => unreachablerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/unreachable!!(), |
| 313 | } |
| 314 | } else { |
| 315 | break; |
| 316 | } |
| 317 | } |
| 318 | |
| 319 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(left) |
| 320 | } |
| 321 | |
| 322 | fn parse_comparativerust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]parse_comparative().(&mut self) -> Steprust-analyzer cargo pp-rs 0.2.1 pp/Step#<i64> { |
| 323 | let mut left = self.parse_shiftrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]parse_shift().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 324 | |
| 325 | while let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(TokenValuerust-analyzer cargo pp-rs 0.2.1 token/TokenValue#::Punctrust-analyzer cargo pp-rs 0.2.1 token/TokenValue#Punct#(punct)) = self.peekrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]peek().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()..maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]map().(|t| t.valuerust-analyzer cargo pp-rs 0.2.1 token/Token#value.) { |
| 326 | if let Punctrust-analyzer cargo pp-rs 0.2.1 token/Punct#::LeftAnglerust-analyzer cargo pp-rs 0.2.1 token/Punct#LeftAngle# | Punctrust-analyzer cargo pp-rs 0.2.1 token/Punct#::RightAnglerust-analyzer cargo pp-rs 0.2.1 token/Punct#RightAngle# | Punctrust-analyzer cargo pp-rs 0.2.1 token/Punct#::LessEqualrust-analyzer cargo pp-rs 0.2.1 token/Punct#LessEqual# | Punctrust-analyzer cargo pp-rs 0.2.1 token/Punct#::GreaterEqualrust-analyzer cargo pp-rs 0.2.1 token/Punct#GreaterEqual# = |
| 327 | punct |
| 328 | { |
| 329 | self.nextrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]next().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 330 | |
| 331 | let right = self.parse_shiftrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]parse_shift().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 332 | |
| 333 | match punct { |
| 334 | Punctrust-analyzer cargo pp-rs 0.2.1 token/Punct#::LeftAnglerust-analyzer cargo pp-rs 0.2.1 token/Punct#LeftAngle# => left = (left rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialOrd<Self>`]lt().right) as i64, |
| 335 | Punctrust-analyzer cargo pp-rs 0.2.1 token/Punct#::RightAnglerust-analyzer cargo pp-rs 0.2.1 token/Punct#RightAngle# => left = (left rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialOrd<Self>`]gt().right) as i64, |
| 336 | Punctrust-analyzer cargo pp-rs 0.2.1 token/Punct#::LessEqualrust-analyzer cargo pp-rs 0.2.1 token/Punct#LessEqual# => left = (left rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialOrd<Self>`]le().<=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialOrd<Self>`]le(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialOrd<Self>`]le().right) as i64, |
| 337 | Punctrust-analyzer cargo pp-rs 0.2.1 token/Punct#::GreaterEqualrust-analyzer cargo pp-rs 0.2.1 token/Punct#GreaterEqual# => left = (left rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialOrd<Self>`]ge().>=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialOrd<Self>`]ge(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialOrd<Self>`]ge().right) as i64, |
| 338 | _ => unreachablerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/unreachable!!(), |
| 339 | } |
| 340 | } else { |
| 341 | break; |
| 342 | } |
| 343 | } |
| 344 | |
| 345 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(left) |
| 346 | } |
| 347 | |
| 348 | fn parse_equalityrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]parse_equality().(&mut self) -> Steprust-analyzer cargo pp-rs 0.2.1 pp/Step#<i64> { |
| 349 | let mut left = self.parse_comparativerust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]parse_comparative().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 350 | |
| 351 | while let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(TokenValuerust-analyzer cargo pp-rs 0.2.1 token/TokenValue#::Punctrust-analyzer cargo pp-rs 0.2.1 token/TokenValue#Punct#(punct)) = self.peekrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]peek().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()..maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]map().(|t| t.valuerust-analyzer cargo pp-rs 0.2.1 token/Token#value.) { |
| 352 | if let Punctrust-analyzer cargo pp-rs 0.2.1 token/Punct#::EqualEqualrust-analyzer cargo pp-rs 0.2.1 token/Punct#EqualEqual# | Punctrust-analyzer cargo pp-rs 0.2.1 token/Punct#::NotEqualrust-analyzer cargo pp-rs 0.2.1 token/Punct#NotEqual# = punct { |
| 353 | self.nextrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]next().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 354 | |
| 355 | let right = self.parse_comparativerust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]parse_comparative().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 356 | |
| 357 | match punct { |
| 358 | Punctrust-analyzer cargo pp-rs 0.2.1 token/Punct#::EqualEqualrust-analyzer cargo pp-rs 0.2.1 token/Punct#EqualEqual# => left = (left rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialEq<Self>`]eq().right) as i64, |
| 359 | Punctrust-analyzer cargo pp-rs 0.2.1 token/Punct#::NotEqualrust-analyzer cargo pp-rs 0.2.1 token/Punct#NotEqual# => left = (left rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialEq<Self>`]ne().right) as i64, |
| 360 | _ => unreachablerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/unreachable!!(), |
| 361 | } |
| 362 | } else { |
| 363 | break; |
| 364 | } |
| 365 | } |
| 366 | |
| 367 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(left) |
| 368 | } |
| 369 | |
| 370 | fn parse_bit_andrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]parse_bit_and().(&mut self) -> Steprust-analyzer cargo pp-rs 0.2.1 pp/Step#<i64> { |
| 371 | let mut left = self.parse_equalityrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]parse_equality().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 372 | |
| 373 | while let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(TokenValuerust-analyzer cargo pp-rs 0.2.1 token/TokenValue#::Punctrust-analyzer cargo pp-rs 0.2.1 token/TokenValue#Punct#(Punctrust-analyzer cargo pp-rs 0.2.1 token/Punct#::Ampersandrust-analyzer cargo pp-rs 0.2.1 token/Punct#Ampersand#)) = self.peekrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]peek().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()..maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]map().(|t| t.valuerust-analyzer cargo pp-rs 0.2.1 token/Token#value.) { |
| 374 | self.nextrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]next().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 375 | |
| 376 | let right = self.parse_equalityrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]parse_equality().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 377 | |
| 378 | left rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i64][`BitAndAssign<Self>`]bitand_assign().&=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i64][`BitAndAssign<Self>`]bitand_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i64][`BitAndAssign<Self>`]bitand_assign().right |
| 379 | } |
| 380 | |
| 381 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(left) |
| 382 | } |
| 383 | |
| 384 | fn parse_bit_xorrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]parse_bit_xor().(&mut self) -> Steprust-analyzer cargo pp-rs 0.2.1 pp/Step#<i64> { |
| 385 | let mut left = self.parse_bit_andrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]parse_bit_and().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 386 | |
| 387 | while let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(TokenValuerust-analyzer cargo pp-rs 0.2.1 token/TokenValue#::Punctrust-analyzer cargo pp-rs 0.2.1 token/TokenValue#Punct#(Punctrust-analyzer cargo pp-rs 0.2.1 token/Punct#::Caretrust-analyzer cargo pp-rs 0.2.1 token/Punct#Caret#)) = self.peekrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]peek().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()..maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]map().(|t| t.valuerust-analyzer cargo pp-rs 0.2.1 token/Token#value.) { |
| 388 | self.nextrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]next().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 389 | |
| 390 | let right = self.parse_bit_andrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]parse_bit_and().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 391 | |
| 392 | left rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i64][`BitXorAssign<Self>`]bitxor_assign().^=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i64][`BitXorAssign<Self>`]bitxor_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i64][`BitXorAssign<Self>`]bitxor_assign().right |
| 393 | } |
| 394 | |
| 395 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(left) |
| 396 | } |
| 397 | |
| 398 | fn parse_bit_orrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]parse_bit_or().(&mut self) -> Steprust-analyzer cargo pp-rs 0.2.1 pp/Step#<i64> { |
| 399 | let mut left = self.parse_bit_xorrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]parse_bit_xor().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 400 | |
| 401 | while let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(TokenValuerust-analyzer cargo pp-rs 0.2.1 token/TokenValue#::Punctrust-analyzer cargo pp-rs 0.2.1 token/TokenValue#Punct#(Punctrust-analyzer cargo pp-rs 0.2.1 token/Punct#::Piperust-analyzer cargo pp-rs 0.2.1 token/Punct#Pipe#)) = self.peekrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]peek().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()..maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]map().(|t| t.valuerust-analyzer cargo pp-rs 0.2.1 token/Token#value.) { |
| 402 | self.nextrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]next().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 403 | |
| 404 | let right = self.parse_bit_xorrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]parse_bit_xor().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 405 | |
| 406 | left rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i64][`BitOrAssign<Self>`]bitor_assign().|=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i64][`BitOrAssign<Self>`]bitor_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i64][`BitOrAssign<Self>`]bitor_assign().right |
| 407 | } |
| 408 | |
| 409 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(left) |
| 410 | } |
| 411 | |
| 412 | fn parse_logical_andrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]parse_logical_and().(&mut self) -> Steprust-analyzer cargo pp-rs 0.2.1 pp/Step#<i64> { |
| 413 | let mut left = self.parse_bit_orrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]parse_bit_or().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 414 | |
| 415 | while let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(TokenValuerust-analyzer cargo pp-rs 0.2.1 token/TokenValue#::Punctrust-analyzer cargo pp-rs 0.2.1 token/TokenValue#Punct#(Punctrust-analyzer cargo pp-rs 0.2.1 token/Punct#::LogicalAndrust-analyzer cargo pp-rs 0.2.1 token/Punct#LogicalAnd#)) = self.peekrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]peek().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()..maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]map().(|t| t.valuerust-analyzer cargo pp-rs 0.2.1 token/Token#value.) { |
| 416 | self.nextrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]next().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 417 | |
| 418 | let right = self.parse_bit_orrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]parse_bit_or().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 419 | |
| 420 | left = (left rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialEq<Self>`]ne().0 && right rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialEq<Self>`]ne().0) as i64; |
| 421 | } |
| 422 | |
| 423 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(left) |
| 424 | } |
| 425 | |
| 426 | fn parse_logical_orrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]parse_logical_or().(&mut self) -> Steprust-analyzer cargo pp-rs 0.2.1 pp/Step#<i64> { |
| 427 | let mut left = self.parse_logical_andrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]parse_logical_and().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 428 | |
| 429 | while let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(TokenValuerust-analyzer cargo pp-rs 0.2.1 token/TokenValue#::Punctrust-analyzer cargo pp-rs 0.2.1 token/TokenValue#Punct#(Punctrust-analyzer cargo pp-rs 0.2.1 token/Punct#::LogicalOrrust-analyzer cargo pp-rs 0.2.1 token/Punct#LogicalOr#)) = self.peekrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]peek().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()..maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]map().(|t| t.valuerust-analyzer cargo pp-rs 0.2.1 token/Token#value.) { |
| 430 | self.nextrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]next().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 431 | |
| 432 | let right = self.parse_logical_andrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]parse_logical_and().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 433 | |
| 434 | left = (left rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialEq<Self>`]ne().0 || right rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i64][`PartialEq<Self>`]ne().0) as i64; |
| 435 | } |
| 436 | |
| 437 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(left) |
| 438 | } |
| 439 | |
| 440 | pub fn evaluate_expressionrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]evaluate_expression().(&mut self) -> Steprust-analyzer cargo pp-rs 0.2.1 pp/Step#<i64> { |
| 441 | self.parse_logical_orrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfParser<'macros>`]parse_logical_or().() |
| 442 | } |
| 443 | } |
| 444 | |
| 445 | impl<'macros> MeLexerrust-analyzer cargo pp-rs 0.2.1 pp/MeLexer# for IfLexerrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/IfLexer#<'macros> { |
| 446 | fn steprust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfLexer<'macros>`][MeLexer]step().(&mut self) -> Steprust-analyzer cargo pp-rs 0.2.1 pp/Step#<Tokenrust-analyzer cargo pp-rs 0.2.1 token/Token#> { |
| 447 | self.tokensrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/IfLexer#tokens..nextrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/into_iter/impl#[`IntoIter<T, A>`][Iterator]next().().ok_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]ok_or().(StepExitrust-analyzer cargo pp-rs 0.2.1 pp/StepExit#::Finishedrust-analyzer cargo pp-rs 0.2.1 pp/StepExit#Finished#) |
| 448 | } |
| 449 | |
| 450 | fn get_definerust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfLexer<'macros>`][MeLexer]get_define().(&self, name: &str) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<&Rcrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc rc/Rc#<Definerust-analyzer cargo pp-rs 0.2.1 pp/Define#>> { |
| 451 | self.definesrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/IfLexer#defines..getrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/impl#[`HashMap<K, V, S, A>`]get().(name) |
| 452 | } |
| 453 | |
| 454 | fn apply_line_offsetrust-analyzer cargo pp-rs 0.2.1 pp/if_parser/impl#[`IfLexer<'macros>`][MeLexer]apply_line_offset().(&self, line: u32, _: Locationrust-analyzer cargo pp-rs 0.2.1 token/Location#) -> Steprust-analyzer cargo pp-rs 0.2.1 pp/Step#<u32> { |
| 455 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(line) |
| 456 | } |
| 457 | } |