Skip to content

Commit 94d7137

Browse files
committed
add test suite timeout
1 parent 36747be commit 94d7137

18 files changed

+407
-369
lines changed

src/main/java/com/alibaba/qlexpress4/Express4Runner.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -343,14 +343,14 @@ public void addOrReplaceMacro(String name, String macroScript) {
343343
private MacroDefine parseMacroDefine(String name, String macroScript) {
344344
ProgramNode macroProgram = parseToSyntaxTree(macroScript);
345345
ImportManager importManager = inheritDefaultImport();
346-
346+
347347
try {
348348
// Compile the macro using the new AST compiler
349349
QLambdaDefinitionInner macroLambdaDef =
350350
(QLambdaDefinitionInner)ASTCompiler.compile(macroProgram, operatorManager, importManager);
351351
QLInstruction[] macroInstructionsArray = macroLambdaDef.getInstructions();
352352
List<QLInstruction> macroInstructions = java.util.Arrays.asList(macroInstructionsArray);
353-
353+
354354
// Determine if the last statement is an expression
355355
// The new AST's ProgramNode has a list of statements
356356
boolean lastStmtExpress = false;
@@ -360,7 +360,7 @@ private MacroDefine parseMacroDefine(String name, String macroScript) {
360360
// Check if the last statement is an expression (implements ExpressionNode)
361361
lastStmtExpress = lastStmt instanceof com.alibaba.qlexpress4.parser.ast.ExpressionNode;
362362
}
363-
363+
364364
return new MacroDefine(macroInstructions, lastStmtExpress);
365365
}
366366
catch (Exception e) {
@@ -684,7 +684,7 @@ private Future<QCompileCache> getParseFuture(String script) {
684684
private QCompileCache parseDefinition(String script) {
685685
ProgramNode programNode = parseToSyntaxTree(script);
686686
ImportManager importManager = inheritDefaultImport();
687-
687+
688688
try {
689689
if (initOptions.isTraceExpression()) {
690690
// Compile with trace points

src/main/java/com/alibaba/qlexpress4/parser/ASTCompiler.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public static QLambdaDefinition compile(ProgramNode programNode, OperatorManager
5252
throws Exception {
5353
return compile(programNode, operatorManager, null);
5454
}
55-
55+
5656
/**
5757
* Compiles a ProgramNode to a QLambdaDefinition with ImportManager support.
5858
* <p>
@@ -74,19 +74,19 @@ public static QLambdaDefinition compile(ProgramNode programNode, OperatorManager
7474
if (operatorManager == null) {
7575
throw new IllegalArgumentException("operatorManager cannot be null");
7676
}
77-
77+
7878
// Create instruction generator
7979
InstructionGenerator generator = new InstructionGenerator(operatorManager, importManager);
80-
80+
8181
// Generate instructions from AST
8282
GenerationResult result = ((ASTNode)programNode).accept(generator, new GenerationContext());
83-
83+
8484
// Extract instructions
8585
List<QLInstruction> instructions = result.getInstructions();
86-
86+
8787
// Calculate max stack size
8888
int maxStackSize = calculateMaxStackSize(instructions);
89-
89+
9090
// Create main lambda definition
9191
return new QLambdaDefinitionInner("main", instructions, Collections.emptyList(), maxStackSize);
9292
}
@@ -106,7 +106,7 @@ public static CompilationResult compileWithTrace(ProgramNode programNode, Operat
106106
throws Exception {
107107
return compileWithTrace(programNode, operatorManager, null);
108108
}
109-
109+
110110
/**
111111
* Compiles a ProgramNode to a QLambdaDefinition with trace points and ImportManager support.
112112
* <p>
@@ -128,13 +128,13 @@ public static CompilationResult compileWithTrace(ProgramNode programNode, Operat
128128
if (operatorManager == null) {
129129
throw new IllegalArgumentException("operatorManager cannot be null");
130130
}
131-
131+
132132
// Compile to lambda definition
133133
QLambdaDefinition lambdaDefinition = compile(programNode, operatorManager, importManager);
134-
134+
135135
// Generate trace points
136136
List<TracePointTree> tracePoints = generateTracePoints(programNode);
137-
137+
138138
return new CompilationResult(lambdaDefinition, tracePoints);
139139
}
140140

src/main/java/com/alibaba/qlexpress4/parser/ast/ASTVisitor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,13 +176,13 @@ R visit(CastNode node, C context)
176176
*/
177177
R visit(ArrayAccessNode node, C context)
178178
throws Exception;
179-
179+
180180
/**
181181
* Visits an array slice node.
182182
*/
183183
R visit(ArraySliceNode node, C context)
184184
throws Exception;
185-
185+
186186
/**
187187
* Visits an array literal node.
188188
*/

src/main/java/com/alibaba/qlexpress4/parser/ast/ArraySliceNode.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,43 +13,45 @@
1313
*/
1414
public class ArraySliceNode extends ASTNode implements ExpressionNode {
1515
private final ExpressionNode array;
16+
1617
private final ExpressionNode start;
18+
1719
private final ExpressionNode end;
18-
19-
public ArraySliceNode(int line, int column, String source,
20-
ExpressionNode array, ExpressionNode start, ExpressionNode end) {
20+
21+
public ArraySliceNode(int line, int column, String source, ExpressionNode array, ExpressionNode start,
22+
ExpressionNode end) {
2123
super(line, column, source);
2224
this.array = array;
2325
this.start = start;
2426
this.end = end;
2527
}
26-
28+
2729
@Override
2830
public <R, C> R accept(ASTVisitor<R, C> visitor, C context)
2931
throws Exception {
3032
return visitor.visit(this, context);
3133
}
32-
34+
3335
public ExpressionNode getArray() {
3436
return array;
3537
}
36-
38+
3739
/**
3840
* Get the start index expression (may be null for [:end] or [:]).
3941
* @return the start index expression or null if not specified
4042
*/
4143
public ExpressionNode getStart() {
4244
return start;
4345
}
44-
46+
4547
/**
4648
* Get the end index expression (may be null for [start:] or [:]).
4749
* @return the end index expression or null if not specified
4850
*/
4951
public ExpressionNode getEnd() {
5052
return end;
5153
}
52-
54+
5355
@Override
5456
public String toString() {
5557
StringBuilder sb = new StringBuilder();

0 commit comments

Comments
 (0)