@@ -1877,55 +1877,55 @@ extension Parser {
1877
1877
/// postfix-operator-declaration → 'postfix' 'operator' operator
1878
1878
/// infix-operator-declaration → 'infix' 'operator' operator infix-operator-group?
1879
1879
/// infix-operator-group → ':' precedence-group-name
1880
-
1880
+
1881
1881
struct OperatorDeclarationIntroducer {
1882
1882
var unexpectedBeforeIntroducer : RawUnexpectedNodesSyntax ?
1883
1883
var operatorModifier : RawTokenSyntax
1884
1884
var unexpectedBetweenModifierAndOperatorKeyword : RawUnexpectedNodesSyntax ?
1885
1885
var operatorKeyword : RawTokenSyntax
1886
1886
}
1887
-
1888
-
1887
+
1889
1888
mutating func parseOperatorDeclarationIntroducer(
1890
1889
_ attrs: DeclAttributes ,
1891
- _ handle: RecoveryConsumptionHandle ) -> OperatorDeclarationIntroducer {
1892
- var modifier = attrs. modifiers? . elements. first? . name ?? self . missingToken ( . prefix)
1893
-
1894
- if ![ Keyword . prefix, . infix, . postfix]
1895
- . map ( { $0. defaultText} ) . contains ( modifier. tokenText) {
1896
- modifier = self . missingToken ( . prefix)
1897
- }
1898
-
1899
- let ( unexpectedBeforeOperator, operatorKeyword) = self . eat ( handle)
1900
-
1901
- let unexpectedBeforeIntroducer = RawUnexpectedNodesSyntax ( attrs. attributes? . elements, arena: self . arena)
1902
-
1903
- var unexpectedBetweenModifierAndOperatorKeyword = unexpectedBeforeOperator
1904
-
1905
- if modifier. presence == . missing {
1906
- unexpectedBetweenModifierAndOperatorKeyword = RawUnexpectedNodesSyntax ( combining: unexpectedBeforeOperator, RawUnexpectedNodesSyntax ( attrs. modifiers? . elements, arena: self . arena) , arena: self . arena)
1907
- } else {
1908
- unexpectedBetweenModifierAndOperatorKeyword = RawUnexpectedNodesSyntax ( combining: unexpectedBeforeOperator, RawUnexpectedNodesSyntax ( Array ( ( attrs. modifiers? . elements. dropFirst ( ) ) ?? [ ] ) , arena: self . arena) , arena: self . arena)
1909
- }
1910
-
1911
-
1912
- return OperatorDeclarationIntroducer (
1913
- unexpectedBeforeIntroducer: unexpectedBeforeIntroducer,
1914
- operatorModifier: modifier,
1915
- unexpectedBetweenModifierAndOperatorKeyword: unexpectedBetweenModifierAndOperatorKeyword,
1916
- operatorKeyword: operatorKeyword
1917
- )
1918
-
1890
+ _ handle: RecoveryConsumptionHandle
1891
+ ) -> OperatorDeclarationIntroducer {
1892
+ var modifier = attrs. modifiers? . elements. first? . name ?? self . missingToken ( . prefix)
1893
+
1894
+ if ![ Keyword . prefix, . infix, . postfix]
1895
+ . map ( { $0. defaultText } ) . contains ( modifier. tokenText)
1896
+ {
1897
+ modifier = self . missingToken ( . prefix)
1898
+ }
1899
+
1900
+ let ( unexpectedBeforeOperator, operatorKeyword) = self . eat ( handle)
1901
+
1902
+ let unexpectedBeforeIntroducer = RawUnexpectedNodesSyntax ( attrs. attributes? . elements, arena: self . arena)
1903
+
1904
+ var unexpectedBetweenModifierAndOperatorKeyword = unexpectedBeforeOperator
1905
+
1906
+ if modifier. presence == . missing {
1907
+ unexpectedBetweenModifierAndOperatorKeyword = RawUnexpectedNodesSyntax ( combining: unexpectedBeforeOperator, RawUnexpectedNodesSyntax ( attrs. modifiers? . elements, arena: self . arena) , arena: self . arena)
1908
+ } else {
1909
+ unexpectedBetweenModifierAndOperatorKeyword = RawUnexpectedNodesSyntax ( combining: unexpectedBeforeOperator, RawUnexpectedNodesSyntax ( Array ( ( attrs. modifiers? . elements. dropFirst ( ) ) ?? [ ] ) , arena: self . arena) , arena: self . arena)
1910
+ }
1911
+
1912
+ return OperatorDeclarationIntroducer (
1913
+ unexpectedBeforeIntroducer: unexpectedBeforeIntroducer,
1914
+ operatorModifier: modifier,
1915
+ unexpectedBetweenModifierAndOperatorKeyword: unexpectedBetweenModifierAndOperatorKeyword,
1916
+ operatorKeyword: operatorKeyword
1917
+ )
1918
+
1919
1919
}
1920
-
1920
+
1921
1921
@_spi ( RawSyntax)
1922
1922
public mutating func parseOperatorDeclaration(
1923
1923
_ attrs: DeclAttributes ,
1924
1924
_ handle: RecoveryConsumptionHandle
1925
1925
) -> RawOperatorDeclSyntax {
1926
-
1926
+
1927
1927
let introducer = parseOperatorDeclarationIntroducer ( attrs, handle)
1928
-
1928
+
1929
1929
let unexpectedBeforeName : RawUnexpectedNodesSyntax ?
1930
1930
let name : RawTokenSyntax
1931
1931
switch self . canRecoverTo ( anyIn: OperatorLike . self) {
0 commit comments