From ce30fa9929fa200521f1df0a9c0c5f824cb969df Mon Sep 17 00:00:00 2001 From: Mohammed Ibrahim Date: Wed, 14 Feb 2024 16:15:11 -0500 Subject: [PATCH] Fix parsing and roundtrip (#2630) * add serviceloader file * fix file path * Refactor ownership * Refactor ownership * Refactor ownership * Fix tests * Fix tests * uplift grammar * uplift grammar * fix tests * fix tests * fix tests * Add properties to result * Add properties to result * fix style * fix style * remove property * move property * Cleanup artifact generation * fix style * Fix dependencies * Cleanup grammar * Change artifact generation content * add quotes in transformer * fix parsing --- .../hostedService/grammar/from/HostedServiceTreeWalker.java | 2 +- .../hostedService/grammar/to/HostedServiceGrammarComposer.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/legend-engine-xts-hostedService/legend-engine-xt-hostedService-grammar/src/main/java/org/finos/legend/engine/language/hostedService/grammar/from/HostedServiceTreeWalker.java b/legend-engine-xts-hostedService/legend-engine-xt-hostedService-grammar/src/main/java/org/finos/legend/engine/language/hostedService/grammar/from/HostedServiceTreeWalker.java index a27c05ca9ee..642c09178cc 100644 --- a/legend-engine-xts-hostedService/legend-engine-xt-hostedService-grammar/src/main/java/org/finos/legend/engine/language/hostedService/grammar/from/HostedServiceTreeWalker.java +++ b/legend-engine-xts-hostedService/legend-engine-xt-hostedService-grammar/src/main/java/org/finos/legend/engine/language/hostedService/grammar/from/HostedServiceTreeWalker.java @@ -107,7 +107,7 @@ private HostedService visitHostedService(HostedServiceParserGrammar.ServiceConte else { HostedServiceParserGrammar.DeploymentContext deploymentOwnerContext = ownerContext.deployment(); - hostedService.ownership = new DeploymentOwner((deploymentOwnerContext.STRING().getText())); + hostedService.ownership = new DeploymentOwner(PureGrammarParserUtility.fromGrammarString(deploymentOwnerContext.STRING().getText(), true)); } } HostedServiceParserGrammar.ServiceDocumentationContext descriptionContext = PureGrammarParserUtility.validateAndExtractOptionalField(ctx.serviceDocumentation(), "documentation", hostedService.sourceInformation); diff --git a/legend-engine-xts-hostedService/legend-engine-xt-hostedService-grammar/src/main/java/org/finos/legend/engine/language/hostedService/grammar/to/HostedServiceGrammarComposer.java b/legend-engine-xts-hostedService/legend-engine-xt-hostedService-grammar/src/main/java/org/finos/legend/engine/language/hostedService/grammar/to/HostedServiceGrammarComposer.java index f78136600c1..5c6162b4842 100644 --- a/legend-engine-xts-hostedService/legend-engine-xt-hostedService-grammar/src/main/java/org/finos/legend/engine/language/hostedService/grammar/to/HostedServiceGrammarComposer.java +++ b/legend-engine-xts-hostedService/legend-engine-xt-hostedService-grammar/src/main/java/org/finos/legend/engine/language/hostedService/grammar/to/HostedServiceGrammarComposer.java @@ -95,7 +95,7 @@ private static String renderServiceOwner(Ownership owner) } else if (owner instanceof DeploymentOwner) { - return "Deployment { identifier: " + ((DeploymentOwner)owner).id + " };\n"; + return "Deployment { identifier: '" + ((DeploymentOwner)owner).id + "' };\n"; } throw new RuntimeException("Owner type invalid"); }