From 21ff82a03ab89fca4cb31c1cc98081dffd1de97c Mon Sep 17 00:00:00 2001 From: Enaium Date: Thu, 19 Dec 2024 09:38:10 +0800 Subject: [PATCH] Fix typo in the antlr grammar --- .../main/antlr/org/babyfish/jimmer/dto/compiler/Dto.g4 | 6 +++--- .../babyfish/jimmer/dto/compiler/DtoTypeBuilder.java | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/project/jimmer-dto-compiler/src/main/antlr/org/babyfish/jimmer/dto/compiler/Dto.g4 b/project/jimmer-dto-compiler/src/main/antlr/org/babyfish/jimmer/dto/compiler/Dto.g4 index c68eb97b7..5010f614e 100644 --- a/project/jimmer-dto-compiler/src/main/antlr/org/babyfish/jimmer/dto/compiler/Dto.g4 +++ b/project/jimmer-dto-compiler/src/main/antlr/org/babyfish/jimmer/dto/compiler/Dto.g4 @@ -53,10 +53,10 @@ dtoBody explicitProp : - micro | aliasGroup | positiveProp | negativeProp | userProp + macro | aliasGroup | positiveProp | negativeProp | userProp ; -micro +macro : '#' name=Identifier ( @@ -83,7 +83,7 @@ aliasPattern aliasGroupProp : - micro | positiveProp + macro | positiveProp ; positiveProp diff --git a/project/jimmer-dto-compiler/src/main/java/org/babyfish/jimmer/dto/compiler/DtoTypeBuilder.java b/project/jimmer-dto-compiler/src/main/java/org/babyfish/jimmer/dto/compiler/DtoTypeBuilder.java index 47d1ccf09..f1890d45e 100644 --- a/project/jimmer-dto-compiler/src/main/java/org/babyfish/jimmer/dto/compiler/DtoTypeBuilder.java +++ b/project/jimmer-dto-compiler/src/main/java/org/babyfish/jimmer/dto/compiler/DtoTypeBuilder.java @@ -118,8 +118,8 @@ class DtoTypeBuilder { } for (DtoParser.ExplicitPropContext prop : body.explicitProps) { - if (prop.micro() != null) { - handleMicro(prop.micro()); + if (prop.macro() != null) { + handleMicro(prop.macro()); } else if (prop.aliasGroup() != null) { handleAliasGroup(prop.aliasGroup()); } else if (prop.positiveProp() != null) { @@ -163,7 +163,7 @@ private DtoTypeBuilder(DtoTypeBuilder base, Set> remo this.aliasPositivePropMap = aliasPositiveMap; } - private void handleMicro(DtoParser.MicroContext micro) { + private void handleMicro(DtoParser.MacroContext micro) { boolean isAllReferences = micro.name.getText().equals("allReferences"); if (!micro.name.getText().equals("allScalars") && !isAllReferences) { throw ctx.exception( @@ -377,8 +377,8 @@ private void handleAliasGroup(DtoParser.AliasGroupContext group) { currentAliasGroup = new AliasPattern(ctx, group.pattern); try { for (DtoParser.AliasGroupPropContext prop : group.props) { - if (prop.micro() != null) { - handleMicro(prop.micro()); + if (prop.macro() != null) { + handleMicro(prop.macro()); } else { handlePositiveProp(prop.positiveProp()); }