Skip to content

feat: recursive-descent SOQL parser replacing regex engine - #14

Merged
razkevich merged 1 commit into
mainfrom
009-soql-engine
Apr 9, 2026
Merged

razkevich merged 1 commit into
mainfrom
009-soql-engine

Conversation

@razkevich

Copy link
Copy Markdown
Owner

Summary

  • Replaced regex-based SOQL parser with proper lexer → parser → AST → executor pipeline
  • New: SoqlLexer, SoqlToken, SoqlParser, SoqlAst (sealed interface hierarchy)
  • Supports: IN/NOT IN, LIKE wildcards, IS NULL/IS NOT NULL, AND/OR with precedence, parentheses, multi-field ORDER BY (ASC/DESC/NULLS FIRST/LAST), OFFSET, comparison operators with type coercion
  • Position-aware parse error messages
  • Removed superseded SoqlQueryModel and SoqlCondition
  • Fixed .gitignore: data/ → /data/ (root-only match)

Test plan

  • 135 tests pass (114 existing + 21 new SOQL tests)
  • All existing SOQL queries produce same results (backward compatible)
  • IN, LIKE, IS NULL, AND/OR, parentheses, ORDER BY DESC, OFFSET all tested
  • Parse errors include character position

🤖 Generated with Claude Code

New pipeline: SOQL string → SoqlLexer → SoqlToken[] → SoqlParser → SoqlAst → SoqlEngine

New capabilities:
- WHERE: IN/NOT IN, LIKE (% and _ wildcards), IS NULL/IS NOT NULL
- Logical: AND/OR with correct precedence, parenthesized groups
- Comparison: =, !=, <>, <, >, <=, >= with type coercion
- ORDER BY: multi-field, ASC/DESC, NULLS FIRST/LAST
- OFFSET support
- Relationship dot notation in WHERE and ORDER BY
- Position-aware parse error messages

Removed: SoqlQueryModel.java, SoqlCondition.java (superseded by SoqlAst)
Fixed: .gitignore data/ pattern to /data/ (root-only)

135 tests pass (114 existing + 21 new SOQL tests)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@razkevich
razkevich merged commit 5fe3bff into main Apr 9, 2026
1 check passed
@razkevich
razkevich deleted the 009-soql-engine branch April 9, 2026 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants