diff options
Diffstat (limited to 'js/scripting-lang/FIXME.md')
-rw-r--r-- | js/scripting-lang/FIXME.md | 100 |
1 files changed, 0 insertions, 100 deletions
diff --git a/js/scripting-lang/FIXME.md b/js/scripting-lang/FIXME.md deleted file mode 100644 index 40045c1..0000000 --- a/js/scripting-lang/FIXME.md +++ /dev/null @@ -1,100 +0,0 @@ -# FIXME - Issues and Fixes - -## ✅ FIXED: Stack Overflow with Unary Minus Operator - -### Problem Summary -The comprehensive test file (`test.txt`) was causing a "Maximum call stack size exceeded" error when run. Through systematic isolation, the issue was pinpointed to expressions involving negative numbers (e.g., `0 > -1`). - -### Root Cause -The lexer correctly tokenized negative numbers as `MINUS` and `NUMBER` tokens, but the parser lacked specific handling for the unary minus operator. This caused infinite recursion when trying to parse expressions like `-1`. - -### Solution Implemented -1. **Parser Enhancement**: Added `UnaryMinusExpression` parsing logic in `parsePrimary()`: - ```javascript - if (token.type === TokenType.MINUS) { - current++; - const operand = parsePrimary(); - return { type: 'UnaryMinusExpression', operand }; - } - ``` - -2. **Interpreter Enhancement**: Added evaluation logic for `UnaryMinusExpression` in all three interpreter functions: - ```javascript - case 'UnaryMinusExpression': - return -evalNode(node.operand); - ``` - -### Status: ✅ RESOLVED -- All unit tests pass -- All integration tests pass -- Negative numbers now work correctly in arithmetic and comparison operations - ---- - -## 🔄 CURRENT ISSUE: Multi-Parameter Case Expressions in Function Bodies - -### Problem Summary -When running the full `test.txt` file, a parsing error occurs: `Error executing file: Unexpected token in parsePrimary: OF`. This error is specifically triggered by multi-parameter case expressions when they appear inside function bodies. - -### Observations -- Multi-parameter case expressions work correctly when used outside function bodies -- The error occurs specifically within function contexts -- Single-parameter case expressions work fine in all contexts -- The issue appears to be related to parsing context and scope - -### What's Currently In Place -- Case expression parsing logic is in `parsePrimary()` function -- Multi-parameter support was added but may have scope/context issues -- Function parsing and case expression parsing may have conflicting expectations - -### Step-by-Step Plan to Fix - -1. **Isolate the Issue** - - Create a minimal test case with multi-parameter case expressions inside functions - - Compare with working cases outside functions - -2. **Analyze Parser Context** - - Understand how function parsing affects the token stream - - Identify if there are token consumption issues - -3. **Fix Multi-Parameter Case Parsing** - - Ensure proper token consumption for multiple values/patterns - - Verify scope handling within function contexts - -4. **Test and Validate** - - Run comprehensive test suite - - Ensure no regressions in existing functionality - -### Status: 🔄 IN PROGRESS -- Issue identified and isolated -- Root cause analysis needed -- Fix implementation pending - ---- - -## Previous Issues (Resolved) - -### ✅ IO Operation Parsing Bug -- **Problem**: IO operations (`..in`, `..out`, `..assert`) were being parsed in `parsePrimary()` instead of at the expression level -- **Solution**: Moved IO parsing to `walk()` function for proper precedence handling -- **Status**: ✅ RESOLVED - -### ✅ Decimal Number Support -- **Problem**: Lexer didn't handle decimal numbers properly -- **Solution**: Updated lexer to use `parseFloat()` for number tokens -- **Status**: ✅ RESOLVED - -### ✅ Case Expression Parsing -- **Problem**: Case expressions had parsing issues with pattern matching -- **Solution**: Fixed case expression parsing logic and wildcard support -- **Status**: ✅ RESOLVED - -### ✅ Function Definition Issues -- **Problem**: Function definitions had scope and parsing problems -- **Solution**: Fixed function parsing and scope handling -- **Status**: ✅ RESOLVED - -### ✅ Wildcard Support -- **Problem**: Wildcard (`_`) wasn't properly recognized in case expressions -- **Solution**: Added `WILDCARD` token type and parsing support -- **Status**: ✅ RESOLVED \ No newline at end of file |