optimize dependent function parse

support merge importNodes
This commit is contained in:
CaiHQ 2023-07-24 11:35:51 +08:00
parent 374451dd5b
commit 6d5f005f6e
2 changed files with 6 additions and 6 deletions

View File

@ -51,7 +51,7 @@ dependencies {
//api 'org.apache.velocity:velocity-engine-core:2.3'
api 'org.rocksdb:rocksdbjni:7.3.1'
testImplementation 'junit:junit:4.13.2'
implementation 'org.bdware.doip:doip-sdk:1.4.6'
implementation 'org.bdware.doip:doip-sdk:1.4.9'
}
group = "org.bdware.sc"

View File

@ -23,17 +23,17 @@ public class FunctionDependencyVisitor extends YJSParserBaseVisitor<FunctionNode
@Override
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 (cn.getFunction(funText)!=null)
String funText = ctx.singleExpression().getText();
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();
if (singleExpress != null && singleExpress.size() > 0) {
for (YJSParser.SingleExpressionContext sin : singleExpress) {
funText = sin.getText();
if (cn.getFunction(funText)!=null)
if (cn.getFunction(funText) != null)
fn.addDependentFunctions(funText);
}
}