From 7bb99d3da9016afefb45087883bdc0061870e17e Mon Sep 17 00:00:00 2001 From: CaiHQ Date: Tue, 6 Jun 2023 14:53:36 +0800 Subject: [PATCH] support importNode --- build.gradle | 2 +- src/main/base/org/bdware/sc/node/ImportNode.java | 2 ++ src/main/base/org/bdware/sc/visitor/ContractReader.java | 1 - 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index f83a45a..6e064a0 100644 --- a/build.gradle +++ b/build.gradle @@ -52,7 +52,7 @@ dependencies { } group = "org.bdware.sc" -version = "1.7.3" +version = "1.7.4" tasks.processResources.setDuplicatesStrategy(DuplicatesStrategy.INCLUDE) task copyLibs(type: Copy) { diff --git a/src/main/base/org/bdware/sc/node/ImportNode.java b/src/main/base/org/bdware/sc/node/ImportNode.java index db421a8..47920d5 100644 --- a/src/main/base/org/bdware/sc/node/ImportNode.java +++ b/src/main/base/org/bdware/sc/node/ImportNode.java @@ -14,6 +14,8 @@ public class ImportNode { } public String getPath() { + if (path.startsWith("@")) + path.replaceAll("@", "/.depyjs/"); return path; } } diff --git a/src/main/base/org/bdware/sc/visitor/ContractReader.java b/src/main/base/org/bdware/sc/visitor/ContractReader.java index facaf73..e0ff5fe 100644 --- a/src/main/base/org/bdware/sc/visitor/ContractReader.java +++ b/src/main/base/org/bdware/sc/visitor/ContractReader.java @@ -119,7 +119,6 @@ public class ContractReader extends YJSParserBaseVisitor { // ctx.getSourceInterval() discoverFunctionDependency(node, contractDelcar); discoverContractDependency(node, contractDelcar); - return node; }