Skip to content

Commit d2af3f6

Browse files
committed
refactor(aparser): 移除宏定义相关的代码
- 删除了 QvmInstructionVisitor 类中关于宏定义处理的代码 -简化了 visitVarIdExpr 方法,仅处理常规变量访问 - 这个改动减少了代码复杂度,但可能会影响使用宏定义的功能
1 parent 32a300c commit d2af3f6

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

src/main/java/com/alibaba/qlexpress4/aparser/QvmInstructionVisitor.java

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -864,25 +864,8 @@ private List<Map.Entry<Class<?>, QLambdaDefinition>> parseExceptionTable(int try
864864

865865
@Override
866866
public Void visitVarIdExpr(VarIdExprContext ctx) {
867-
String varName = ctx.varId().getText();
868-
869-
// Check if this is a macro call
870-
MacroDefine macroDefine = generatorScope.getMacroInstructions(varName);
871-
if (macroDefine != null) {
872-
// Expand macro instructions inline
873-
macroDefine.getMacroInstructions().forEach(this::pureAddInstruction);
874-
addTimeoutInstruction();
875-
876-
// If the macro's last statement is an expression, it should leave a value on the stack
877-
if (!macroDefine.isLastStmtExpress()) {
878-
// If not an expression, push null to maintain stack balance
879-
addInstruction(new ConstInstruction(newReporterWithToken(ctx.getStart()), null, null));
880-
}
881-
} else {
882-
// Regular variable access
883-
addInstruction(new LoadInstruction(newReporterWithToken(ctx.getStart()), varName,
884-
ctx.getStart().getStartIndex()));
885-
}
867+
addInstruction(new LoadInstruction(newReporterWithToken(ctx.getStart()), ctx.varId().getText(),
868+
ctx.getStart().getStartIndex()));
886869
return null;
887870
}
888871

0 commit comments

Comments
 (0)