Merge branch 'java-grammar' into typeres-jtypes
This commit is contained in:
@ -2202,10 +2202,10 @@ void BlockStatement() #void:
|
||||
// or a local variable declaration follows.
|
||||
// This allows more modifiers for local variables than actually allowed
|
||||
|
||||
// The ModifierList is adopted by the next class to open
|
||||
// The ModifierList is adopted by the next node to open
|
||||
ModifierList() (
|
||||
LOOKAHEAD({localTypeDeclAfterModifiers()}) LocalTypeDecl()
|
||||
| LOOKAHEAD({true}) LocalVariableDeclaration() ";" { fixLastToken(); }
|
||||
| LOOKAHEAD({true}) LocalVariableDeclarationPendingModifiers() ";" { fixLastToken(); }
|
||||
)
|
||||
| LOOKAHEAD(1, <IDENTIFIER>)
|
||||
(
|
||||
@ -2262,6 +2262,15 @@ void LocalVariableDeclaration() :
|
||||
( "," VariableDeclarator() )*
|
||||
}
|
||||
|
||||
void LocalVariableDeclarationPendingModifiers() #LocalVariableDeclaration:
|
||||
{}
|
||||
{
|
||||
// no ModifierList, it's pending at this time
|
||||
LocalVariableType()
|
||||
VariableDeclarator()
|
||||
( "," VariableDeclarator() )*
|
||||
}
|
||||
|
||||
private void LocalVarModifierList() #ModifierList:
|
||||
{Set<JModifier> set = Collections.emptySet(); }
|
||||
{
|
||||
|
@ -55,7 +55,6 @@
|
||||
+- Block[@Size = "5", @containsComment = "false"]
|
||||
+- LocalVariableDeclaration[@TypeInferred = "false", @Visibility = "local"]
|
||||
| +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"]
|
||||
| +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
|
||||
| +- ClassOrInterfaceType[@FullyQualified = "false", @SimpleName = "String"]
|
||||
| +- VariableDeclarator[@Initializer = "true", @Name = "key"]
|
||||
| +- VariableDeclaratorId[@ArrayType = "false", @EnumConstant = "false", @ExceptionBlockParameter = "false", @Field = "false", @FormalParameter = "false", @LambdaParameter = "false", @LocalVariable = "true", @Name = "key", @PatternBinding = "false", @RecordComponent = "false", @ResourceDeclaration = "false", @TypeInferred = "false", @Visibility = "package"]
|
||||
@ -64,7 +63,6 @@
|
||||
| +- VariableAccess[@AccessType = "READ", @CompileTimeConstant = "false", @Image = "obj", @Name = "obj", @ParenthesisDepth = "0", @Parenthesized = "false"]
|
||||
+- LocalVariableDeclaration[@TypeInferred = "false", @Visibility = "local"]
|
||||
| +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"]
|
||||
| +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
|
||||
| +- ClassOrInterfaceType[@FullyQualified = "false", @SimpleName = "String"]
|
||||
| +- VariableDeclarator[@Initializer = "true", @Name = "value"]
|
||||
| +- VariableDeclaratorId[@ArrayType = "false", @EnumConstant = "false", @ExceptionBlockParameter = "false", @Field = "false", @FormalParameter = "false", @LambdaParameter = "false", @LocalVariable = "true", @Name = "value", @PatternBinding = "false", @RecordComponent = "false", @ResourceDeclaration = "false", @TypeInferred = "false", @Visibility = "package"]
|
||||
|
@ -96,7 +96,6 @@
|
||||
| +- Block[@Size = "2", @containsComment = "false"]
|
||||
| +- LocalVariableDeclaration[@TypeInferred = "false", @Visibility = "local"]
|
||||
| | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"]
|
||||
| | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
|
||||
| | +- PrimitiveType[@Kind = "int"]
|
||||
| | +- VariableDeclarator[@Initializer = "true", @Name = "register"]
|
||||
| | +- VariableDeclaratorId[@ArrayType = "false", @EnumConstant = "false", @ExceptionBlockParameter = "false", @Field = "false", @FormalParameter = "false", @LambdaParameter = "false", @LocalVariable = "true", @Name = "register", @PatternBinding = "false", @RecordComponent = "false", @ResourceDeclaration = "false", @TypeInferred = "false", @Visibility = "package"]
|
||||
|
Reference in New Issue
Block a user