Commit 6274819
fix: correct NOT token handling with look-ahead parsing
Address NOT token handling issue (same fix as PR #117).
Changes:
- Add peekToken() helper for look-ahead without advancing position
- Fix parseComparisonExpression() to only consume NOT when followed by
BETWEEN, LIKE, ILIKE, or IN operators
- Update NOT case in parsePrimaryExpression() to use UnaryExpression
with parseComparisonExpression for proper precedence
This properly handles all NOT use cases:
- NOT LIKE: WHERE name NOT LIKE '%Admin%'
- NOT BETWEEN: WHERE price NOT BETWEEN 10 AND 100
- NOT IN: WHERE status NOT IN ('cancelled', 'deleted')
- Boolean negation: WHERE NOT active AND name LIKE '%'
- NOT EXISTS: WHERE NOT EXISTS (SELECT ...)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 9d7244b commit 6274819
1 file changed
Lines changed: 23 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
241 | 251 | | |
242 | 252 | | |
243 | 253 | | |
| |||
361 | 371 | | |
362 | 372 | | |
363 | 373 | | |
| 374 | + | |
| 375 | + | |
364 | 376 | | |
365 | 377 | | |
366 | | - | |
367 | | - | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
368 | 383 | | |
369 | 384 | | |
370 | 385 | | |
| |||
734 | 749 | | |
735 | 750 | | |
736 | 751 | | |
737 | | - | |
738 | | - | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
739 | 755 | | |
740 | 756 | | |
741 | 757 | | |
742 | | - | |
743 | | - | |
744 | | - | |
745 | | - | |
746 | | - | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
747 | 761 | | |
748 | 762 | | |
749 | 763 | | |
| |||
0 commit comments