Commit 26b5e04
fix: Fix panic in string functions and add CEL string extension support (fixes #85)
This commit fixes the panic that occurred when CEL string extension functions
(size, upperAscii, lowerAscii) were called as methods in comprehensions.
Changes:
- Fix size() handler to properly handle both method calls (target) and function calls (args)
- Implement 10 CEL string extension functions with PostgreSQL SQL conversion
* lowerAscii() → LOWER()
* upperAscii() → UPPER()
* trim() → TRIM()
* charAt() → SUBSTRING()
* indexOf() → POSITION()
* lastIndexOf() → REVERSE() logic
* substring() → SUBSTRING()
* replace() → REPLACE()
* reverse() → REVERSE()
- Add error handlers for unsupported functions (split, join, format, quote)
- Add defensive checks to prevent panics in callCasting, visitCallIndex,
visitCallMapIndex, visitCallListIndex, visitCallUnary
- Add ErrUnsupportedOperation error constant
Tests:
- Add comprehensive test suite in string_functions_test.go
- All 6 failing test cases from issue #85 now pass
- Tests for all implemented string functions
- Tests for error cases and panic prevention
- All tests pass (make test)
- All lint checks pass (make lint)
Fixes #85
🤖 Generated with Claude Code
Co-Authored-By: Claude <[email protected]>1 parent f31443e commit 26b5e04
3 files changed
+1150
-24
lines changed
0 commit comments