mirror of
				https://gitee.com/BDWare/common
				synced 2025-10-30 20:32:17 +00:00 
			
		
		
		
	feat: support fork annotation
This commit is contained in:
		
							parent
							
								
									bb71895f6e
								
							
						
					
					
						commit
						be4d25d260
					
				| @ -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); | ||||
|             } | ||||
| 
 | ||||
|         } | ||||
|  | ||||
| @ -24,12 +24,15 @@ public class FunctionDependencyVisitor extends YJSParserBaseVisitor<FunctionNode | ||||
|     public FunctionNode visitArgumentsExpression(YJSParser.ArgumentsExpressionContext ctx) { | ||||
|         super.visitArgumentsExpression(ctx); | ||||
|         String funText = ctx.singleExpression().getText(); | ||||
|         if (funText.endsWith(APPLY)) funText = funText.replaceAll(APPLY + "$", ""); | ||||
|         if (funText.endsWith(CALL)) funText = funText.replaceAll(CALL + "$", ""); | ||||
|         if (funText.endsWith(APPLY)) | ||||
|             funText = funText.replaceAll(APPLY + "$", ""); | ||||
|         if (funText.endsWith(CALL)) | ||||
|             funText = funText.replaceAll(CALL + "$", ""); | ||||
|         if (cn.getFunction(funText) != null) | ||||
|             fn.addDependentFunctions(funText); | ||||
|         if (ctx.arguments() != null) { | ||||
|             List<YJSParser.SingleExpressionContext> singleExpress = ctx.arguments().singleExpression(); | ||||
|             List<YJSParser.SingleExpressionContext> singleExpress = | ||||
|                     ctx.arguments().singleExpression(); | ||||
|             if (singleExpress != null && singleExpress.size() > 0) { | ||||
|                 for (YJSParser.SingleExpressionContext sin : singleExpress) { | ||||
|                     funText = sin.getText(); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user