From be4d25d260c74d70fae324dbb8f8aa1b88ddb65f Mon Sep 17 00:00:00 2001 From: CaiHQ Date: Wed, 23 Aug 2023 16:00:47 +0800 Subject: [PATCH] feat: support fork annotation --- src/main/base/org/bdware/sc/node/ContractNode.java | 10 +++++----- .../bdware/sc/visitor/FunctionDependencyVisitor.java | 9 ++++++--- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/main/base/org/bdware/sc/node/ContractNode.java b/src/main/base/org/bdware/sc/node/ContractNode.java index 9970279..0f61c59 100644 --- a/src/main/base/org/bdware/sc/node/ContractNode.java +++ b/src/main/base/org/bdware/sc/node/ContractNode.java @@ -254,7 +254,7 @@ public class ContractNode { packSourceFunctionAndDependentFunctions(getFunction(routeInfo.funcName), dependentFunctions); methodRouteInfoMap.add(doipOperationInfo.operationName, - JsonUtil.parseObjectAsJsonObject(routeInfo)); + JsonUtil.parseObjectAsJsonObject(routeInfo)); } if (joinInfo != null) { packSourceFunctionAndDependentFunctions(getFunction(joinInfo.joinCountFuncName), @@ -299,7 +299,7 @@ public class ContractNode { packSourceFunctionAndDependentFunctions(getFunction(forkInfo.funcName), dependentFunctions); methodForkInfoMap.add(doipOperationInfo.operationName, - JsonUtil.parseObjectAsJsonObject(routeInfo)); + JsonUtil.parseObjectAsJsonObject(forkInfo)); } } } @@ -333,9 +333,9 @@ public class ContractNode { } functionNode.annotations.addAll(node.annotations); } else { - //now we accept only interfaces. - //just ignore! - // throw new RuntimeException("unimplemented functions:" + node.functionName); + // now we accept only interfaces. + // just ignore! + // throw new RuntimeException("unimplemented functions:" + node.functionName); } } diff --git a/src/main/base/org/bdware/sc/visitor/FunctionDependencyVisitor.java b/src/main/base/org/bdware/sc/visitor/FunctionDependencyVisitor.java index a0632d9..40c99a9 100644 --- a/src/main/base/org/bdware/sc/visitor/FunctionDependencyVisitor.java +++ b/src/main/base/org/bdware/sc/visitor/FunctionDependencyVisitor.java @@ -24,12 +24,15 @@ public class FunctionDependencyVisitor extends YJSParserBaseVisitor singleExpress = ctx.arguments().singleExpression(); + List singleExpress = + ctx.arguments().singleExpression(); if (singleExpress != null && singleExpress.size() > 0) { for (YJSParser.SingleExpressionContext sin : singleExpress) { funText = sin.getText();