mirror of
https://gitee.com/BDWare/common
synced 2025-01-10 09:54:13 +00:00
feat: sharable var integration
This commit is contained in:
parent
3bf508b088
commit
5598a2ba8c
@ -122,7 +122,8 @@ public class ContractReader extends YJSParserBaseVisitor<ContractNode> {
|
|||||||
SharableDeclarationContext sharableCtx = clzOrFunction.sharableDeclaration();
|
SharableDeclarationContext sharableCtx = clzOrFunction.sharableDeclaration();
|
||||||
sharableCtx.sharableStatement().variableDeclarationList();
|
sharableCtx.sharableStatement().variableDeclarationList();
|
||||||
SharableReader reader = new SharableReader(fileName);
|
SharableReader reader = new SharableReader(fileName);
|
||||||
SharableNode sharable = reader.visitVariableDeclarationList(sharableCtx.sharableStatement().variableDeclarationList());
|
SharableNode sharable = reader.visitVariableDeclarationList(
|
||||||
|
sharableCtx.sharableStatement().variableDeclarationList());
|
||||||
node.addSharable(sharable);
|
node.addSharable(sharable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,8 @@ public class SharableReader extends YJSParserBaseVisitor<SharableNode> {
|
|||||||
public SharableNode visitVariableDeclarationList(YJSParser.VariableDeclarationListContext ctx) {
|
public SharableNode visitVariableDeclarationList(YJSParser.VariableDeclarationListContext ctx) {
|
||||||
SharableNode sharableNode = new SharableNode();
|
SharableNode sharableNode = new SharableNode();
|
||||||
List<String> statements = new ArrayList<>();
|
List<String> statements = new ArrayList<>();
|
||||||
for (YJSParser.VariableDeclarationContext variableDeclarationContext : ctx.variableDeclaration()) {
|
for (YJSParser.VariableDeclarationContext variableDeclarationContext : ctx
|
||||||
|
.variableDeclaration()) {
|
||||||
statements.add(variableDeclarationContext.getText());
|
statements.add(variableDeclarationContext.getText());
|
||||||
}
|
}
|
||||||
sharableNode.setVariableStatements(statements);
|
sharableNode.setVariableStatements(statements);
|
||||||
|
Loading…
Reference in New Issue
Block a user