mirror of
				https://gitee.com/BDWare/cp.git
				synced 2025-06-12 10:44:02 +00:00 
			
		
		
		
	support interface
This commit is contained in:
		
							parent
							
								
									7e8076e075
								
							
						
					
					
						commit
						eb91d17982
					
				| @ -14,6 +14,7 @@ public abstract class AnnotationProcessor { | ||||
|             FunctionNode functionNode) throws Exception { | ||||
|         return; | ||||
|     } | ||||
| 
 | ||||
|     public void processInterface(AnnotationNode anno, ContractNode contractNode, | ||||
|             InterfaceNode functionNode) throws Exception { | ||||
|         return; | ||||
|  | ||||
| @ -34,8 +34,7 @@ public class YJSCompiler { | ||||
|     ContractNode contract; | ||||
|     private static final Logger LOGGER = LogManager.getLogger(YJSCompiler.class); | ||||
| 
 | ||||
|     public YJSCompiler() { | ||||
|     } | ||||
|     public YJSCompiler() {} | ||||
| 
 | ||||
|     public static ScriptFunction compileWithGlobal(Source source, Global global, Context context) { | ||||
|         Global oldGlobal = Context.getGlobal(); | ||||
| @ -140,7 +139,8 @@ public class YJSCompiler { | ||||
|                 String cnPath = entry.getName(); | ||||
|                 int i = cnPath.lastIndexOf("/"); | ||||
|                 String cnDir = ""; | ||||
|                 if (i != -1) cnDir = cnPath.substring(0, i); | ||||
|                 if (i != -1) | ||||
|                     cnDir = cnPath.substring(0, i); | ||||
|                 czb.put(str, cn); | ||||
|                 for (ImportNode in : cn.getImports()) { | ||||
|                     String path = in.getPath(); | ||||
| @ -157,7 +157,8 @@ public class YJSCompiler { | ||||
|                 else { | ||||
|                     // TODO parse manifest.json first? | ||||
|                     for (String entry : allEntries) | ||||
|                         if (!czb.containsPath(entry) && entry.startsWith(str) && entry.endsWith(".yjs")) { | ||||
|                         if (!czb.containsPath(entry) && entry.startsWith(str) | ||||
|                                 && entry.endsWith(".yjs")) { | ||||
|                             toParse.add(entry); | ||||
|                         } | ||||
|                 } | ||||
|  | ||||
| @ -18,6 +18,7 @@ public class DOOP extends AnnotationProcessor { | ||||
|         functionNode.setIsDoipOperation(true); | ||||
|         functionNode.setDoipOperationInfo(DoipOperationInfo.create(anno, contractNode)); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public void processInterface(AnnotationNode anno, ContractNode contractNode, | ||||
|             InterfaceNode interfaceNode) throws Exception { | ||||
|  | ||||
| @ -15,6 +15,7 @@ public class Join extends AnnotationProcessor { | ||||
|         // 增加标记,在ContractNode中记录Join相关的函数和Join规则 | ||||
|         functionNode.setJoinInfo(JoinInfo.create(anno, contractNode)); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public void processInterface(AnnotationNode anno, ContractNode contractNode, | ||||
|             InterfaceNode interfaceNode) { | ||||
|  | ||||
| @ -13,6 +13,7 @@ public class Route extends AnnotationProcessor { | ||||
|             FunctionNode functionNode) { | ||||
|         functionNode.setRouteInfo(RouteInfo.create(anno, contractNode)); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public void processInterface(AnnotationNode anno, ContractNode contractNode, | ||||
|             InterfaceNode interfaceNode) { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user