Skip to content

Commit

Permalink
Handle record pseudo-keywords earlier
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 400071735
  • Loading branch information
cushon authored and Javac Team committed Oct 1, 2021
1 parent cb60060 commit e5a1173
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions java/com/google/turbine/parse/Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,15 @@ private ImmutableList<Tree> classMembers() {
}

case IDENT:
Ident ident = ident();
if (ident.value().equals("record")) {
eat(Token.IDENT);
acc.add(recordDeclaration(access, annos.build()));
access = EnumSet.noneOf(TurbineModifier.class);
annos = ImmutableList.builder();
break;
}
// fall through
case BOOLEAN:
case BYTE:
case SHORT:
Expand Down Expand Up @@ -750,9 +759,6 @@ private ImmutableList<Tree> classMember(
{
int pos = position;
Ident ident = eatIdent();
if (ident.value().equals("record")) {
return ImmutableList.of(recordDeclaration(access, annos));
}
switch (token) {
case LPAREN:
{
Expand Down

0 comments on commit e5a1173

Please sign in to comment.