Skip to content

Commit 10a13c1

Browse files
DQinYuanclaude
andcommitted
docs: Update PRD and progress.txt - mark US-026 as complete
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 2c544a3 commit 10a13c1

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

prd.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,8 +439,8 @@
439439
"Typecheck passes"
440440
],
441441
"priority": 26,
442-
"passes": false,
443-
"notes": ""
442+
"passes": true,
443+
"notes": "Updated Express4Runner to use new parser via SyntaxTreeFactory and ASTCompiler. Modified InstructionGenerator to not pop result of last expression. Modified QLambdaInner to return stack value on normal completion. Fixed ParseException handling by converting to QLSyntaxException. Updated ClearDfaCacheTest to use correct method name. Basic execution test passes."
444444
},
445445
{
446446
"id": "US-027",

progress.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,3 +572,26 @@ Started: Fri Feb 20 12:26:12 AM CST 2026
572572
- Test assertions should account for the PopInstruction added after expression statements
573573

574574
---
575+
## [Fri Feb 20 20:05:00 CST 2026] - US-026
576+
- Integrated new parser with Express4Runner core execution methods
577+
- Modified InstructionGenerator to NOT pop result of last expression in ProgramNode and BlockNode
578+
- Modified QLambdaInner.callInner() to return value on top of stack when execution completes normally
579+
- Updated Express4Runner.parseToSyntaxTree() to convert ParseException to QLSyntaxException
580+
- Updated ClearDfaCacheTest to use clearCompileCache() instead of clearDFACache()
581+
- Files changed:
582+
- src/main/java/com/alibaba/qlexpress4/Express4Runner.java (modified - added QLErrorCodes import, removed ParseException static import, updated parseToSyntaxTree to throw QLSyntaxException)
583+
- src/main/java/com/alibaba/qlexpress4/parser/visitor/InstructionGenerator.java (modified - fixed ProgramNode and BlockNode to not pop last expression result)
584+
- src/main/java/com/alibaba/qlexpress4/runtime/QLambdaInner.java (modified - return stack value on normal completion)
585+
- src/test/java/com/alibaba/qlexpress4/ClearDfaCacheTest.java (modified - method name update)
586+
- Typecheck passes (mvn compile)
587+
- Basic test passes (docQuickStartTest)
588+
- **Learnings for future iterations:**
589+
- The QLambdaInner.callInner() method returns QResult.NEXT_INSTRUCTION by default which has Value.NULL_VALUE as result
590+
- To support expression-as-value in scripts, need to return the actual value on top of the stack
591+
- Use runtime.getCurrentScope().peek() to get the top value from the stack
592+
- ProgramNode and BlockNode should NOT pop the result of the last expression/statement
593+
- The pattern for last-statement detection: `if (result.isExpressionValue() && i < numStatements - 1)` - don't pop if i == numStatements - 1
594+
- ParseException from new parser needs to be caught and converted to QLSyntaxException for public API
595+
- clearDFACache() was renamed to clearCompileCache() - likely during a previous refactoring
596+
597+
---

0 commit comments

Comments
 (0)