mirror of
https://gitee.com/BDWare/common
synced 2025-01-10 01:44:16 +00:00
feat: support fork annotation
This commit is contained in:
parent
bb71895f6e
commit
be4d25d260
@ -299,7 +299,7 @@ public class ContractNode {
|
|||||||
packSourceFunctionAndDependentFunctions(getFunction(forkInfo.funcName),
|
packSourceFunctionAndDependentFunctions(getFunction(forkInfo.funcName),
|
||||||
dependentFunctions);
|
dependentFunctions);
|
||||||
methodForkInfoMap.add(doipOperationInfo.operationName,
|
methodForkInfoMap.add(doipOperationInfo.operationName,
|
||||||
JsonUtil.parseObjectAsJsonObject(routeInfo));
|
JsonUtil.parseObjectAsJsonObject(forkInfo));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -333,8 +333,8 @@ public class ContractNode {
|
|||||||
}
|
}
|
||||||
functionNode.annotations.addAll(node.annotations);
|
functionNode.annotations.addAll(node.annotations);
|
||||||
} else {
|
} else {
|
||||||
//now we accept only interfaces.
|
// now we accept only interfaces.
|
||||||
//just ignore!
|
// just ignore!
|
||||||
// throw new RuntimeException("unimplemented functions:" + node.functionName);
|
// throw new RuntimeException("unimplemented functions:" + node.functionName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,12 +24,15 @@ public class FunctionDependencyVisitor extends YJSParserBaseVisitor<FunctionNode
|
|||||||
public FunctionNode visitArgumentsExpression(YJSParser.ArgumentsExpressionContext ctx) {
|
public FunctionNode visitArgumentsExpression(YJSParser.ArgumentsExpressionContext ctx) {
|
||||||
super.visitArgumentsExpression(ctx);
|
super.visitArgumentsExpression(ctx);
|
||||||
String funText = ctx.singleExpression().getText();
|
String funText = ctx.singleExpression().getText();
|
||||||
if (funText.endsWith(APPLY)) funText = funText.replaceAll(APPLY + "$", "");
|
if (funText.endsWith(APPLY))
|
||||||
if (funText.endsWith(CALL)) funText = funText.replaceAll(CALL + "$", "");
|
funText = funText.replaceAll(APPLY + "$", "");
|
||||||
|
if (funText.endsWith(CALL))
|
||||||
|
funText = funText.replaceAll(CALL + "$", "");
|
||||||
if (cn.getFunction(funText) != null)
|
if (cn.getFunction(funText) != null)
|
||||||
fn.addDependentFunctions(funText);
|
fn.addDependentFunctions(funText);
|
||||||
if (ctx.arguments() != null) {
|
if (ctx.arguments() != null) {
|
||||||
List<YJSParser.SingleExpressionContext> singleExpress = ctx.arguments().singleExpression();
|
List<YJSParser.SingleExpressionContext> singleExpress =
|
||||||
|
ctx.arguments().singleExpression();
|
||||||
if (singleExpress != null && singleExpress.size() > 0) {
|
if (singleExpress != null && singleExpress.size() > 0) {
|
||||||
for (YJSParser.SingleExpressionContext sin : singleExpress) {
|
for (YJSParser.SingleExpressionContext sin : singleExpress) {
|
||||||
funText = sin.getText();
|
funText = sin.getText();
|
||||||
|
Loading…
Reference in New Issue
Block a user