Skip to content

Commit

Permalink
Fix grammar to handle optional annotations and the begin range
Browse files Browse the repository at this point in the history
  • Loading branch information
jlerbsc committed Feb 27, 2023
1 parent 4ea9b52 commit 5ca3973
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion javaparser-core/src/main/javacc/java.jj
Original file line number Diff line number Diff line change
Expand Up @@ -1160,7 +1160,7 @@ PackageDeclaration PackageDeclaration():
AnnotationExpr ann;
}
{
ann = Annotation() { annotations = add(annotations, ann); begin = orIfInvalid(begin, ann); }
( ann = Annotation() { annotations = add(annotations, ann); begin = orIfInvalid(begin, ann); } )*
"package" {begin = orIfInvalid(begin, token());} name = Name() ";"
{ return new PackageDeclaration(range(begin, token()), annotations, name); }
}
Expand Down

0 comments on commit 5ca3973

Please sign in to comment.