mirror of
https://gitee.com/BDWare/common
synced 2025-01-10 09:54:13 +00:00
optimize dependent function parse
support merge importNodes
This commit is contained in:
parent
374451dd5b
commit
6d5f005f6e
@ -51,7 +51,7 @@ dependencies {
|
|||||||
//api 'org.apache.velocity:velocity-engine-core:2.3'
|
//api 'org.apache.velocity:velocity-engine-core:2.3'
|
||||||
api 'org.rocksdb:rocksdbjni:7.3.1'
|
api 'org.rocksdb:rocksdbjni:7.3.1'
|
||||||
testImplementation 'junit:junit:4.13.2'
|
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"
|
group = "org.bdware.sc"
|
||||||
|
|
||||||
|
@ -24,16 +24,16 @@ 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)) funText = funText.replaceAll(APPLY + "$", "");
|
||||||
if (funText.endsWith(CALL)) funText = funText.replaceAll(CALL+"$","");
|
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();
|
||||||
if (cn.getFunction(funText)!=null)
|
if (cn.getFunction(funText) != null)
|
||||||
fn.addDependentFunctions(funText);
|
fn.addDependentFunctions(funText);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user