Debian Codegraph @

src/parser/expression.rs

raw symbols SCIP
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 use craterust-analyzer cargo fluent-syntax 0.12.0 crate/::astrust-analyzer cargo fluent-syntax 0.12.0 ast/;
4
5 impl<'s, S> Parserrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#<S>
6 where
7 S: Slicerust-analyzer cargo fluent-syntax 0.12.0 parser/slice/Slice#<'s>,
8 {
9 pub(superrust-analyzer cargo fluent-syntax 0.12.0 parser/) fn get_expressionrust-analyzer cargo fluent-syntax 0.12.0 parser/expression/impl#[`Parser<S>`]get_expression().(&mut self) -> Resultrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Result#<astrust-analyzer cargo fluent-syntax 0.12.0 ast/::Expressionrust-analyzer cargo fluent-syntax 0.12.0 ast/Expression#<S>> {
10 let exp = self.get_inline_expressionrust-analyzer cargo fluent-syntax 0.12.0 parser/expression/impl#[`Parser<S>`]get_inline_expression().(false)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
11
12 self.skip_blankrust-analyzer cargo fluent-syntax 0.12.0 parser/helper/impl#[`Parser<S>`]skip_blank().();
13
14 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'-') || !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().self.is_byte_atrust-analyzer cargo fluent-syntax 0.12.0 parser/helper/impl#[`Parser<S>`]is_byte_at().(b'>', 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) {
15 if let astrust-analyzer cargo fluent-syntax 0.12.0 ast/::InlineExpressionrust-analyzer cargo fluent-syntax 0.12.0 ast/InlineExpression#::TermReferencerust-analyzer cargo fluent-syntax 0.12.0 ast/InlineExpression#TermReference# { ref attributerust-analyzer cargo fluent-syntax 0.12.0 ast/InlineExpression#TermReference#attribute., .. } = exp {
16 if attribute.is_somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_some().() {
17 return errorrust-analyzer cargo fluent-syntax 0.12.0 parser/errors/error!!(ErrorKindrust-analyzer cargo fluent-syntax 0.12.0 parser/errors/ErrorKind#::TermAttributeAsPlaceablerust-analyzer cargo fluent-syntax 0.12.0 parser/errors/ErrorKind#TermAttributeAsPlaceable#, self.ptrrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#ptr.);
18 }
19 }
20 return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(astrust-analyzer cargo fluent-syntax 0.12.0 ast/::Expressionrust-analyzer cargo fluent-syntax 0.12.0 ast/Expression#::Inlinerust-analyzer cargo fluent-syntax 0.12.0 ast/Expression#Inline#(exp));
21 }
22
23 match exp {
24 astrust-analyzer cargo fluent-syntax 0.12.0 ast/::InlineExpressionrust-analyzer cargo fluent-syntax 0.12.0 ast/InlineExpression#::MessageReferencerust-analyzer cargo fluent-syntax 0.12.0 ast/InlineExpression#MessageReference# { ref attributerust-analyzer cargo fluent-syntax 0.12.0 ast/InlineExpression#MessageReference#attribute., .. } => {
25 if attribute.is_nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_none().() {
26 return errorrust-analyzer cargo fluent-syntax 0.12.0 parser/errors/error!!(ErrorKindrust-analyzer cargo fluent-syntax 0.12.0 parser/errors/ErrorKind#::MessageReferenceAsSelectorrust-analyzer cargo fluent-syntax 0.12.0 parser/errors/ErrorKind#MessageReferenceAsSelector#, self.ptrrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#ptr.);
27 } else {
28 return errorrust-analyzer cargo fluent-syntax 0.12.0 parser/errors/error!!(ErrorKindrust-analyzer cargo fluent-syntax 0.12.0 parser/errors/ErrorKind#::MessageAttributeAsSelectorrust-analyzer cargo fluent-syntax 0.12.0 parser/errors/ErrorKind#MessageAttributeAsSelector#, self.ptrrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#ptr.);
29 }
30 }
31 astrust-analyzer cargo fluent-syntax 0.12.0 ast/::InlineExpressionrust-analyzer cargo fluent-syntax 0.12.0 ast/InlineExpression#::TermReferencerust-analyzer cargo fluent-syntax 0.12.0 ast/InlineExpression#TermReference# { ref attributerust-analyzer cargo fluent-syntax 0.12.0 ast/InlineExpression#TermReference#attribute., .. } => {
32 if attribute.is_nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_none().() {
33 return errorrust-analyzer cargo fluent-syntax 0.12.0 parser/errors/error!!(ErrorKindrust-analyzer cargo fluent-syntax 0.12.0 parser/errors/ErrorKind#::TermReferenceAsSelectorrust-analyzer cargo fluent-syntax 0.12.0 parser/errors/ErrorKind#TermReferenceAsSelector#, self.ptrrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#ptr.);
34 }
35 }
36 astrust-analyzer cargo fluent-syntax 0.12.0 ast/::InlineExpressionrust-analyzer cargo fluent-syntax 0.12.0 ast/InlineExpression#::StringLiteralrust-analyzer cargo fluent-syntax 0.12.0 ast/InlineExpression#StringLiteral# { .. }
37 | astrust-analyzer cargo fluent-syntax 0.12.0 ast/::InlineExpressionrust-analyzer cargo fluent-syntax 0.12.0 ast/InlineExpression#::NumberLiteralrust-analyzer cargo fluent-syntax 0.12.0 ast/InlineExpression#NumberLiteral# { .. }
38 | astrust-analyzer cargo fluent-syntax 0.12.0 ast/::InlineExpressionrust-analyzer cargo fluent-syntax 0.12.0 ast/InlineExpression#::VariableReferencerust-analyzer cargo fluent-syntax 0.12.0 ast/InlineExpression#VariableReference# { .. }
39 | astrust-analyzer cargo fluent-syntax 0.12.0 ast/::InlineExpressionrust-analyzer cargo fluent-syntax 0.12.0 ast/InlineExpression#::FunctionReferencerust-analyzer cargo fluent-syntax 0.12.0 ast/InlineExpression#FunctionReference# { .. } => {}
40 _ => {
41 return errorrust-analyzer cargo fluent-syntax 0.12.0 parser/errors/error!!(ErrorKindrust-analyzer cargo fluent-syntax 0.12.0 parser/errors/ErrorKind#::ExpectedSimpleExpressionAsSelectorrust-analyzer cargo fluent-syntax 0.12.0 parser/errors/ErrorKind#ExpectedSimpleExpressionAsSelector#, self.ptrrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#ptr.);
42 }
43 };
44
45 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; // ->
46
47 self.skip_blank_inlinerust-analyzer cargo fluent-syntax 0.12.0 parser/helper/impl#[`Parser<S>`]skip_blank_inline().();
48 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().() {
49 return errorrust-analyzer cargo fluent-syntax 0.12.0 parser/errors/error!!(
50 ErrorKindrust-analyzer cargo fluent-syntax 0.12.0 parser/errors/ErrorKind#::ExpectedCharRangerust-analyzer cargo fluent-syntax 0.12.0 parser/errors/ErrorKind#ExpectedCharRange# {
51 rangerust-analyzer cargo fluent-syntax 0.12.0 parser/errors/ErrorKind#ExpectedCharRange#range.: "\n | \r\n".to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().()
52 },
53 self.ptrrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#ptr.
54 );
55 }
56 self.skip_blankrust-analyzer cargo fluent-syntax 0.12.0 parser/helper/impl#[`Parser<S>`]skip_blank().();
57
58 let variants = self.get_variantsrust-analyzer cargo fluent-syntax 0.12.0 parser/core/impl#[`Parser<S>`]get_variants().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
59
60 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(astrust-analyzer cargo fluent-syntax 0.12.0 ast/::Expressionrust-analyzer cargo fluent-syntax 0.12.0 ast/Expression#::Selectrust-analyzer cargo fluent-syntax 0.12.0 ast/Expression#Select# {
61 selectorrust-analyzer cargo fluent-syntax 0.12.0 ast/Expression#Select#selector.: exp,
62 variantsrust-analyzer cargo fluent-syntax 0.12.0 ast/Expression#Select#variants.,
63 })
64 }
65
66 pub(superrust-analyzer cargo fluent-syntax 0.12.0 parser/) fn get_inline_expressionrust-analyzer cargo fluent-syntax 0.12.0 parser/expression/impl#[`Parser<S>`]get_inline_expression().(
67 &mut self,
68 only_literal: bool,
69 ) -> Resultrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Result#<astrust-analyzer cargo fluent-syntax 0.12.0 ast/::InlineExpressionrust-analyzer cargo fluent-syntax 0.12.0 ast/InlineExpression#<S>> {
70 match get_current_byterust-analyzer cargo fluent-syntax 0.12.0 parser/macros/get_current_byte!!(self) {
71 Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(b'"') => {
72 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; // "
73 let start = self.ptrrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#ptr.;
74 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) {
75 match b {
76 b'\\' => match 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) {
77 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'{') | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(b'"') => 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,
78 Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(b'u') => {
79 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;
80 self.skip_unicode_escape_sequencerust-analyzer cargo fluent-syntax 0.12.0 parser/helper/impl#[`Parser<S>`]skip_unicode_escape_sequence().(4)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
81 }
82 Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(b'U') => {
83 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;
84 self.skip_unicode_escape_sequencerust-analyzer cargo fluent-syntax 0.12.0 parser/helper/impl#[`Parser<S>`]skip_unicode_escape_sequence().(6)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
85 }
86 b => {
87 let seq = b.unwrap_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap_or().(&b' ').to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().();
88 return errorrust-analyzer cargo fluent-syntax 0.12.0 parser/errors/error!!(ErrorKindrust-analyzer cargo fluent-syntax 0.12.0 parser/errors/ErrorKind#::UnknownEscapeSequencerust-analyzer cargo fluent-syntax 0.12.0 parser/errors/ErrorKind#UnknownEscapeSequence#(seq), self.ptrrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#ptr.);
89 }
90 },
91 b'"' => {
92 break;
93 }
94 b'\n' => {
95 return errorrust-analyzer cargo fluent-syntax 0.12.0 parser/errors/error!!(ErrorKindrust-analyzer cargo fluent-syntax 0.12.0 parser/errors/ErrorKind#::UnterminatedStringLiteralrust-analyzer cargo fluent-syntax 0.12.0 parser/errors/ErrorKind#UnterminatedStringLiteral#, self.ptrrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#ptr.);
96 }
97 _ => 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,
98 }
99 }
100
101 self.expect_byterust-analyzer cargo fluent-syntax 0.12.0 parser/helper/impl#[`Parser<S>`]expect_byte().(b'"')?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
102 let slice = 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. 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().1);
103 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(astrust-analyzer cargo fluent-syntax 0.12.0 ast/::InlineExpressionrust-analyzer cargo fluent-syntax 0.12.0 ast/InlineExpression#::StringLiteralrust-analyzer cargo fluent-syntax 0.12.0 ast/InlineExpression#StringLiteral# { valuerust-analyzer cargo fluent-syntax 0.12.0 ast/InlineExpression#StringLiteral#value.: slice })
104 }
105 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().() => {
106 let num = self.get_number_literalrust-analyzer cargo fluent-syntax 0.12.0 parser/helper/impl#[`Parser<S>`]get_number_literal().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
107 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(astrust-analyzer cargo fluent-syntax 0.12.0 ast/::InlineExpressionrust-analyzer cargo fluent-syntax 0.12.0 ast/InlineExpression#::NumberLiteralrust-analyzer cargo fluent-syntax 0.12.0 ast/InlineExpression#NumberLiteral# { valuerust-analyzer cargo fluent-syntax 0.12.0 ast/InlineExpression#NumberLiteral#value.: num })
108 }
109 Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(b'-') if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().only_literal => {
110 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; // -
111 if self.is_identifier_startrust-analyzer cargo fluent-syntax 0.12.0 parser/helper/impl#[`Parser<S>`]is_identifier_start().() {
112 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;
113 let id = self.get_identifier_uncheckedrust-analyzer cargo fluent-syntax 0.12.0 parser/core/impl#[`Parser<S>`]get_identifier_unchecked().();
114 let attribute = self.get_attribute_accessorrust-analyzer cargo fluent-syntax 0.12.0 parser/core/impl#[`Parser<S>`]get_attribute_accessor().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
115 let arguments = self.get_call_argumentsrust-analyzer cargo fluent-syntax 0.12.0 parser/expression/impl#[`Parser<S>`]get_call_arguments().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
116 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(astrust-analyzer cargo fluent-syntax 0.12.0 ast/::InlineExpressionrust-analyzer cargo fluent-syntax 0.12.0 ast/InlineExpression#::TermReferencerust-analyzer cargo fluent-syntax 0.12.0 ast/InlineExpression#TermReference# {
117 idrust-analyzer cargo fluent-syntax 0.12.0 ast/InlineExpression#TermReference#id.,
118 attributerust-analyzer cargo fluent-syntax 0.12.0 ast/InlineExpression#TermReference#attribute.,
119 argumentsrust-analyzer cargo fluent-syntax 0.12.0 ast/InlineExpression#TermReference#arguments.,
120 })
121 } else {
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][`SubAssign<Self>`]sub_assign().-=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`SubAssign<Self>`]sub_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`SubAssign<Self>`]sub_assign().1;
123 let num = self.get_number_literalrust-analyzer cargo fluent-syntax 0.12.0 parser/helper/impl#[`Parser<S>`]get_number_literal().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
124 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(astrust-analyzer cargo fluent-syntax 0.12.0 ast/::InlineExpressionrust-analyzer cargo fluent-syntax 0.12.0 ast/InlineExpression#::NumberLiteralrust-analyzer cargo fluent-syntax 0.12.0 ast/InlineExpression#NumberLiteral# { valuerust-analyzer cargo fluent-syntax 0.12.0 ast/InlineExpression#NumberLiteral#value.: num })
125 }
126 }
127 Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(b'$') if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().only_literal => {
128 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; // $
129 let id = self.get_identifierrust-analyzer cargo fluent-syntax 0.12.0 parser/core/impl#[`Parser<S>`]get_identifier().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
130 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(astrust-analyzer cargo fluent-syntax 0.12.0 ast/::InlineExpressionrust-analyzer cargo fluent-syntax 0.12.0 ast/InlineExpression#::VariableReferencerust-analyzer cargo fluent-syntax 0.12.0 ast/InlineExpression#VariableReference# { idrust-analyzer cargo fluent-syntax 0.12.0 ast/InlineExpression#VariableReference#id. })
131 }
132 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().() => {
133 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;
134 let id = self.get_identifier_uncheckedrust-analyzer cargo fluent-syntax 0.12.0 parser/core/impl#[`Parser<S>`]get_identifier_unchecked().();
135 let arguments = self.get_call_argumentsrust-analyzer cargo fluent-syntax 0.12.0 parser/expression/impl#[`Parser<S>`]get_call_arguments().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
136 if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(arguments) = arguments {
137 if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().Selfrust-analyzer cargo fluent-syntax 0.12.0 parser/expression/impl#[`Parser<S>`]::is_calleerust-analyzer cargo fluent-syntax 0.12.0 parser/helper/impl#[`Parser<S>`]is_callee().(&id.namerust-analyzer cargo fluent-syntax 0.12.0 ast/Identifier#name.) {
138 return errorrust-analyzer cargo fluent-syntax 0.12.0 parser/errors/error!!(ErrorKindrust-analyzer cargo fluent-syntax 0.12.0 parser/errors/ErrorKind#::ForbiddenCalleerust-analyzer cargo fluent-syntax 0.12.0 parser/errors/ErrorKind#ForbiddenCallee#, self.ptrrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#ptr.);
139 }
140
141 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(astrust-analyzer cargo fluent-syntax 0.12.0 ast/::InlineExpressionrust-analyzer cargo fluent-syntax 0.12.0 ast/InlineExpression#::FunctionReferencerust-analyzer cargo fluent-syntax 0.12.0 ast/InlineExpression#FunctionReference# { idrust-analyzer cargo fluent-syntax 0.12.0 ast/InlineExpression#FunctionReference#id., argumentsrust-analyzer cargo fluent-syntax 0.12.0 ast/InlineExpression#FunctionReference#arguments. })
142 } else {
143 let attribute = self.get_attribute_accessorrust-analyzer cargo fluent-syntax 0.12.0 parser/core/impl#[`Parser<S>`]get_attribute_accessor().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
144 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(astrust-analyzer cargo fluent-syntax 0.12.0 ast/::InlineExpressionrust-analyzer cargo fluent-syntax 0.12.0 ast/InlineExpression#::MessageReferencerust-analyzer cargo fluent-syntax 0.12.0 ast/InlineExpression#MessageReference# { idrust-analyzer cargo fluent-syntax 0.12.0 ast/InlineExpression#MessageReference#id., attributerust-analyzer cargo fluent-syntax 0.12.0 ast/InlineExpression#MessageReference#attribute. })
145 }
146 }
147 Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(b'{') if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().only_literal => {
148 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; // {
149 let exp = self.get_placeablerust-analyzer cargo fluent-syntax 0.12.0 parser/core/impl#[`Parser<S>`]get_placeable().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
150 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(astrust-analyzer cargo fluent-syntax 0.12.0 ast/::InlineExpressionrust-analyzer cargo fluent-syntax 0.12.0 ast/InlineExpression#::Placeablerust-analyzer cargo fluent-syntax 0.12.0 ast/InlineExpression#Placeable# {
151 expressionrust-analyzer cargo fluent-syntax 0.12.0 ast/InlineExpression#Placeable#expression.: Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/impl#[`Box<T>`]new().(exp),
152 })
153 }
154 _ if only_literal => errorrust-analyzer cargo fluent-syntax 0.12.0 parser/errors/error!!(ErrorKindrust-analyzer cargo fluent-syntax 0.12.0 parser/errors/ErrorKind#::ExpectedLiteralrust-analyzer cargo fluent-syntax 0.12.0 parser/errors/ErrorKind#ExpectedLiteral#, self.ptrrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#ptr.),
155 _ => errorrust-analyzer cargo fluent-syntax 0.12.0 parser/errors/error!!(ErrorKindrust-analyzer cargo fluent-syntax 0.12.0 parser/errors/ErrorKind#::ExpectedInlineExpressionrust-analyzer cargo fluent-syntax 0.12.0 parser/errors/ErrorKind#ExpectedInlineExpression#, self.ptrrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#ptr.),
156 }
157 }
158
159 pub fn get_call_argumentsrust-analyzer cargo fluent-syntax 0.12.0 parser/expression/impl#[`Parser<S>`]get_call_arguments().(&mut self) -> Resultrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Result#<Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<astrust-analyzer cargo fluent-syntax 0.12.0 ast/::CallArgumentsrust-analyzer cargo fluent-syntax 0.12.0 ast/CallArguments#<S>>> {
160 self.skip_blankrust-analyzer cargo fluent-syntax 0.12.0 parser/helper/impl#[`Parser<S>`]skip_blank().();
161 if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().self.take_byte_ifrust-analyzer cargo fluent-syntax 0.12.0 parser/helper/impl#[`Parser<S>`]take_byte_if().(b'(') {
162 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#);
163 }
164
165 let mut positional = vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![];
166 let mut named = vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![];
167 let mut argument_names = vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![];
168
169 self.skip_blankrust-analyzer cargo fluent-syntax 0.12.0 parser/helper/impl#[`Parser<S>`]skip_blank().();
170
171 while 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>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt().self.lengthrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#length. {
172 if self.is_current_byterust-analyzer cargo fluent-syntax 0.12.0 parser/helper/impl#[`Parser<S>`]is_current_byte().(b')') {
173 break;
174 }
175
176 let expr = self.get_inline_expressionrust-analyzer cargo fluent-syntax 0.12.0 parser/expression/impl#[`Parser<S>`]get_inline_expression().(false)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
177
178 if let astrust-analyzer cargo fluent-syntax 0.12.0 ast/::InlineExpressionrust-analyzer cargo fluent-syntax 0.12.0 ast/InlineExpression#::MessageReferencerust-analyzer cargo fluent-syntax 0.12.0 ast/InlineExpression#MessageReference# {
179 ref idrust-analyzer cargo fluent-syntax 0.12.0 ast/InlineExpression#MessageReference#id.,
180 attributerust-analyzer cargo fluent-syntax 0.12.0 ast/InlineExpression#MessageReference#attribute.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#,
181 } = expr
182 {
183 self.skip_blankrust-analyzer cargo fluent-syntax 0.12.0 parser/helper/impl#[`Parser<S>`]skip_blank().();
184 if self.is_current_byterust-analyzer cargo fluent-syntax 0.12.0 parser/helper/impl#[`Parser<S>`]is_current_byte().(b':') {
185 if argument_names.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]contains().(&id.namerust-analyzer cargo fluent-syntax 0.12.0 ast/Identifier#name.) {
186 return errorrust-analyzer cargo fluent-syntax 0.12.0 parser/errors/error!!(
187 ErrorKindrust-analyzer cargo fluent-syntax 0.12.0 parser/errors/ErrorKind#::DuplicatedNamedArgumentrust-analyzer cargo fluent-syntax 0.12.0 parser/errors/ErrorKind#DuplicatedNamedArgument#(id.namerust-analyzer cargo fluent-syntax 0.12.0 ast/Identifier#name..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().()),
188 self.ptrrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#ptr.
189 );
190 }
191 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;
192 self.skip_blankrust-analyzer cargo fluent-syntax 0.12.0 parser/helper/impl#[`Parser<S>`]skip_blank().();
193 let val = self.get_inline_expressionrust-analyzer cargo fluent-syntax 0.12.0 parser/expression/impl#[`Parser<S>`]get_inline_expression().(true)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
194
195 argument_names.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(id.namerust-analyzer cargo fluent-syntax 0.12.0 ast/Identifier#name..clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#clone().());
196 named.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(astrust-analyzer cargo fluent-syntax 0.12.0 ast/::NamedArgumentrust-analyzer cargo fluent-syntax 0.12.0 ast/NamedArgument# {
197 namerust-analyzer cargo fluent-syntax 0.12.0 ast/NamedArgument#name.: astrust-analyzer cargo fluent-syntax 0.12.0 ast/::Identifierrust-analyzer cargo fluent-syntax 0.12.0 ast/Identifier# {
198 namerust-analyzer cargo fluent-syntax 0.12.0 ast/Identifier#name.: id.namerust-analyzer cargo fluent-syntax 0.12.0 ast/Identifier#name..clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#clone().(),
199 },
200 valuerust-analyzer cargo fluent-syntax 0.12.0 ast/NamedArgument#value.: val,
201 });
202 } else {
203 if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().argument_names.is_emptyrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]is_empty().() {
204 return errorrust-analyzer cargo fluent-syntax 0.12.0 parser/errors/error!!(ErrorKindrust-analyzer cargo fluent-syntax 0.12.0 parser/errors/ErrorKind#::PositionalArgumentFollowsNamedrust-analyzer cargo fluent-syntax 0.12.0 parser/errors/ErrorKind#PositionalArgumentFollowsNamed#, self.ptrrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#ptr.);
205 }
206 positional.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(expr);
207 }
208 } else {
209 if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().argument_names.is_emptyrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]is_empty().() {
210 return errorrust-analyzer cargo fluent-syntax 0.12.0 parser/errors/error!!(ErrorKindrust-analyzer cargo fluent-syntax 0.12.0 parser/errors/ErrorKind#::PositionalArgumentFollowsNamedrust-analyzer cargo fluent-syntax 0.12.0 parser/errors/ErrorKind#PositionalArgumentFollowsNamed#, self.ptrrust-analyzer cargo fluent-syntax 0.12.0 parser/core/Parser#ptr.);
211 }
212 positional.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(expr);
213 }
214
215 self.skip_blankrust-analyzer cargo fluent-syntax 0.12.0 parser/helper/impl#[`Parser<S>`]skip_blank().();
216 self.take_byte_ifrust-analyzer cargo fluent-syntax 0.12.0 parser/helper/impl#[`Parser<S>`]take_byte_if().(b',');
217 self.skip_blankrust-analyzer cargo fluent-syntax 0.12.0 parser/helper/impl#[`Parser<S>`]skip_blank().();
218 }
219
220 self.expect_byterust-analyzer cargo fluent-syntax 0.12.0 parser/helper/impl#[`Parser<S>`]expect_byte().(b')')?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
221
222 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#(astrust-analyzer cargo fluent-syntax 0.12.0 ast/::CallArgumentsrust-analyzer cargo fluent-syntax 0.12.0 ast/CallArguments# { positionalrust-analyzer cargo fluent-syntax 0.12.0 ast/CallArguments#positional., namedrust-analyzer cargo fluent-syntax 0.12.0 ast/CallArguments#named. }))
223 }
224 }