Skip to content

Commit 5ca3973

Browse files
committed
Fix grammar to handle optional annotations and the begin range
1 parent 4ea9b52 commit 5ca3973

File tree

1 file changed

+1
-1
lines changed
  • javaparser-core/src/main/javacc

1 file changed

+1
-1
lines changed

javaparser-core/src/main/javacc/java.jj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1160,7 +1160,7 @@ PackageDeclaration PackageDeclaration():
11601160
AnnotationExpr ann;
11611161
}
11621162
{
1163-
ann = Annotation() { annotations = add(annotations, ann); begin = orIfInvalid(begin, ann); }
1163+
( ann = Annotation() { annotations = add(annotations, ann); begin = orIfInvalid(begin, ann); } )*
11641164
"package" {begin = orIfInvalid(begin, token());} name = Name() ";"
11651165
{ return new PackageDeclaration(range(begin, token()), annotations, name); }
11661166
}

0 commit comments

Comments
 (0)