@@ -112,8 +112,8 @@ File ::= [ SHEBANG_LINE ] InnerAttr* Items
112
112
ExprCodeFragment ::= Expr?
113
113
StmtCodeFragment ::= Stmt?
114
114
TypeRefCodeFragment ::= TypeReference?
115
- PathWithColonsCodeFragment ::= PathGenericArgsWithColons ?
116
- PathWithoutColonsCodeFragment ::= PathGenericArgsWithoutColons ?
115
+ ValuePathCodeFragment ::= ValuePathGenericArgs ?
116
+ TypePathCodeFragment ::= TypePathGenericArgs ?
117
117
118
118
///////////////////////////////////////////////////////////////////////////////////////////////////
119
119
// Attributes
@@ -194,20 +194,20 @@ TypeQual ::= '<' TypeReference [ as TraitRef] '>' '::' {
194
194
195
195
left PathSegment ::= '::' PathIdent PathTypeArguments? { elementType = Path }
196
196
197
- private PathTypeArguments ::= <<isPathMode 'COLONS '>> ColonTypeArgumentList
198
- | <<isPathMode 'NO_COLONS '>> ( TypeArgumentList | PathParameters RetType? ) // Fn(i32) -> i32 sugar
197
+ private PathTypeArguments ::= <<isPathMode 'VALUE '>> ColonTypeArgumentList
198
+ | <<isPathMode 'TYPE '>> ( TypeArgumentList | PathParameters RetType? ) // Fn(i32) -> i32 sugar
199
199
200
200
TypeArgumentList ::= TypeArgumentListImpl {
201
201
extends = "org.rust.lang.core.psi.ext.RsStubbedElementImpl<?>"
202
202
stubClass = "org.rust.lang.core.stubs.RsPlaceholderStub"
203
203
elementTypeFactory = "org.rust.lang.core.stubs.StubImplementationsKt.factory"
204
204
}
205
- ColonTypeArgumentList ::= '::' TypeArgumentListImpl { elementType = TypeArgumentList }
205
+ ColonTypeArgumentList ::= & '::' TypeArgumentListImpl { elementType = TypeArgumentList }
206
206
207
- private TypeArgumentListImpl ::= '<' !'=' ( <<list_element Lifetime>>*
208
- <<list_element (!(identifier ('='|':')) !'>' TypeReference)>>*
209
- <<list_element (!'>' (BlockExpr | LitExpr | &('-' LitExpr) UnaryExpr))>>*
210
- <<list_element AssocTypeBinding>>*) '>' { pin = 2 }
207
+ private TypeArgumentListImpl ::= '::'? ' <' !'=' ( <<list_element Lifetime>>*
208
+ <<list_element (!(identifier ('='|':')) !'>' TypeReference)>>*
209
+ <<list_element (!'>' (BlockExpr | LitExpr | &('-' LitExpr) UnaryExpr))>>*
210
+ <<list_element AssocTypeBinding>>*) '>' { pin = 3 }
211
211
AssocTypeBinding ::= identifier (AssocTypeBindingType | AssocTypeBindingBound) {
212
212
implements = [ "org.rust.lang.core.psi.ext.RsNameIdentifierOwner"
213
213
"org.rust.lang.core.psi.ext.RsReferenceElement" ]
@@ -225,20 +225,20 @@ private AssocTypeBindingBound ::= ':' TypeBounds { pin = 1 }
225
225
// a::b<T,U>::c<V,W>
226
226
// std::Fn(V) -> W
227
227
// std::Fn(V)
228
- PathGenericArgsWithoutColons ::= <<typeQuals 'ON' <<pathMode 'NO_COLONS ' PathImpl>>>> { elementType = Path }
229
- PathGenericArgsWithoutColonsNoTypeQual ::= <<typeQuals 'OFF' <<pathMode 'NO_COLONS ' PathImpl>>>> { elementType = Path }
228
+ TypePathGenericArgs ::= <<typeQuals 'ON' <<pathMode 'TYPE ' PathImpl>>>> { elementType = Path }
229
+ TypePathGenericArgsNoTypeQual ::= <<typeQuals 'OFF' <<pathMode 'TYPE ' PathImpl>>>> { elementType = Path }
230
230
231
231
// Paths without type arguments, for use declarations:
232
232
// a::b::c
233
- PathWithoutTypes ::= <<typeQuals 'OFF' <<pathMode 'NO_TYPES ' PathImpl>>>> { elementType = Path }
233
+ PathWithoutTypeArgs ::= <<typeQuals 'OFF' <<pathMode 'NO_TYPE_ARGS ' PathImpl>>>> { elementType = Path }
234
234
235
235
// Paths for expressions:
236
236
// a::b::<T,U>::c
237
- PathGenericArgsWithColons ::= <<typeQuals 'ON' <<pathMode 'COLONS ' PathImpl>>>> { elementType = Path }
238
- PathGenericArgsWithColonsNoTypeQual ::= <<typeQuals 'OFF' <<pathMode 'COLONS ' PathImpl>>>> { elementType = Path }
237
+ ValuePathGenericArgs ::= <<typeQuals 'ON' <<pathMode 'VALUE ' PathImpl>>>> { elementType = Path }
238
+ ValuePathGenericArgsNoTypeQual ::= <<typeQuals 'OFF' <<pathMode 'VALUE ' PathImpl>>>> { elementType = Path }
239
239
240
240
// Path semantically constrained to resolve to a trait
241
- TraitRef ::= PathGenericArgsWithoutColonsNoTypeQual {
241
+ TraitRef ::= TypePathGenericArgsNoTypeQual {
242
242
extends = "org.rust.lang.core.psi.ext.RsStubbedElementImpl<?>"
243
243
stubClass = "org.rust.lang.core.stubs.RsPlaceholderStub"
244
244
elementTypeFactory = "org.rust.lang.core.stubs.StubImplementationsKt.factory"
@@ -253,7 +253,7 @@ Vis ::= crate | pub VisRestriction? {
253
253
stubClass = "org.rust.lang.core.stubs.RsVisStub"
254
254
elementTypeFactory = "org.rust.lang.core.stubs.StubImplementationsKt.factory"
255
255
}
256
- VisRestriction ::= '(' in? PathWithoutTypes ')' {
256
+ VisRestriction ::= '(' in? PathWithoutTypeArgs ')' {
257
257
extends = "org.rust.lang.core.psi.ext.RsStubbedElementImpl<?>"
258
258
stubClass = "org.rust.lang.core.stubs.RsPlaceholderStub"
259
259
elementTypeFactory = "org.rust.lang.core.stubs.StubImplementationsKt.factory"
@@ -349,7 +349,7 @@ FnParameters ::= '(' !',' [ SelfParameter (',' | &')') ]
349
349
LambdaParameters ::= '|' !',' [ <<comma_separated_list LambdaParameter>> ] '|'
350
350
351
351
FnTypeParameters ::= <<variadic_params_impl AnonParameter>>
352
- PathParameters ::= '(' [ <<comma_separated_list PathParameter>> ] ')' { pin = 1 }
352
+ PathParameters ::= '::'? ' (' [ <<comma_separated_list PathParameter>> ] ')' { pin = 2 }
353
353
354
354
355
355
private meta variadic_params_impl ::= '(' [ <<param>> (',' <<param>>)* [ ',' '...'? ] ] ')' { pin = 1 }
@@ -496,8 +496,8 @@ PatBox ::= box Pat
496
496
// }
497
497
PatIdent ::= PatBinding [ '@' Pat ]
498
498
499
- PatStruct ::= PathGenericArgsWithColonsNoTypeQual '{' PatField_with_recover* '..'? '}'
500
- PatTupleStruct ::= PathGenericArgsWithColonsNoTypeQual '(' SeqPat ')'
499
+ PatStruct ::= ValuePathGenericArgsNoTypeQual '{' PatField_with_recover* '..'? '}'
500
+ PatTupleStruct ::= ValuePathGenericArgsNoTypeQual '(' SeqPat ')'
501
501
502
502
// TODO: actual recover
503
503
private Pat_with_recover ::= Pat (',' | &(')' | ']' | '..'))
@@ -561,7 +561,7 @@ UseItem ::= AttrsAndVis use UseSpeck ';' {
561
561
// foo::bar::{self, foo};
562
562
// foo::{};
563
563
// ::foo::*;
564
- UseSpeck ::= PathWithoutTypes [ Alias | '::' UseSpeckProjection ]
564
+ UseSpeck ::= PathWithoutTypeArgs [ Alias | '::' UseSpeckProjection ]
565
565
| '::'? UseSpeckProjection {
566
566
extends = "org.rust.lang.core.psi.ext.RsUseSpeckImplMixin"
567
567
stubClass = "org.rust.lang.core.stubs.RsUseSpeckStub"
@@ -808,7 +808,7 @@ private TypeReferenceInner ::= ArrayType
808
808
| ExplicitTraitType
809
809
| TrivialBaseType
810
810
// External rule to find the difference between `T` and `T+T`
811
- | <<baseOrTraitType PathGenericArgsWithoutColons ImplicitTraitType TraitType_upper>>
811
+ | <<baseOrTraitType TypePathGenericArgs ImplicitTraitType TraitType_upper>>
812
812
| MacroType
813
813
| ForInType // FIXME O(2^n) for types like `for<'a> A<for<'b> B<for<'c> C<...>>>`
814
814
@@ -889,7 +889,7 @@ ForInType ::= ForLifetimes (FnPointerType | TraitRef) {
889
889
elementTypeFactory = "org.rust.lang.core.stubs.StubImplementationsKt.factory"
890
890
}
891
891
892
- BaseType ::= TrivialBaseTypeInner | PathGenericArgsWithoutColons {
892
+ BaseType ::= TrivialBaseTypeInner | TypePathGenericArgs {
893
893
implements = "org.rust.lang.core.psi.ext.RsTypeElement"
894
894
extends = "org.rust.lang.core.psi.ext.RsStubbedElementImpl<?>"
895
895
stubClass = "org.rust.lang.core.stubs.RsBaseTypeStub"
@@ -1070,7 +1070,7 @@ LambdaExpr ::= OuterAttr* [asyncBlock | static] move? LambdaParameters RetType?
1070
1070
elementTypeFactory = "org.rust.lang.core.stubs.StubImplementationsKt.factory"
1071
1071
}
1072
1072
1073
- StructLiteral ::= <<checkStructAllowed>> OuterAttr* PathGenericArgsWithColonsNoTypeQual StructLiteralBody {
1073
+ StructLiteral ::= <<checkStructAllowed>> OuterAttr* ValuePathGenericArgsNoTypeQual StructLiteralBody {
1074
1074
implements = [ "org.rust.lang.core.psi.ext.RsOuterAttributeOwner" ]
1075
1075
elementTypeFactory = "org.rust.lang.core.stubs.StubImplementationsKt.factory"
1076
1076
}
@@ -1092,7 +1092,7 @@ private StructLiteralField_with_recover ::= StructLiteralField (',' | &'}') {
1092
1092
1093
1093
private StructLiteralField_recover ::= !(identifier | INTEGER_LITERAL | ',' | '}' | '..' | '#')
1094
1094
1095
- PathExpr ::= OuterAttr* PathGenericArgsWithColons {
1095
+ PathExpr ::= OuterAttr* ValuePathGenericArgs {
1096
1096
implements = [ "org.rust.lang.core.psi.ext.RsOuterAttributeOwner" ]
1097
1097
elementTypeFactory = "org.rust.lang.core.stubs.StubImplementationsKt.factory"
1098
1098
}
@@ -1318,7 +1318,7 @@ Macro2 ::= AttrsAndVis MACRO_KW identifier ( Macro2FunctionLikeBody | Macro2Matc
1318
1318
private Macro2FunctionLikeBody ::= '(' MacroPatternContents ')' '{' MacroExpansionContents '}'
1319
1319
private Macro2MatchLikeBody ::= '{' (MacroCase ','?)* '}'
1320
1320
1321
- fake MacroCall ::= AttrsAndVis PathWithoutTypes '!' identifier? (
1321
+ fake MacroCall ::= AttrsAndVis PathWithoutTypeArgs '!' identifier? (
1322
1322
MacroArgument | ExprMacroArgument | FormatMacroArgument | AssertMacroArgument |
1323
1323
VecMacroArgument | LogMacroArgument | IncludeMacroArgument | ConcatMacroArgument | EnvMacroArgument
1324
1324
) ';'? {
0 commit comments