You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add SelectQueryParser.analyze method with character-level error positioning
Added analyze() method to SelectQueryParser that provides non-throwing parsing
with detailed error information including precise character positions instead
of token indices.
Features:
- ParseAnalysisResult interface with success status, query, and error details
- Character-level error positioning for better IDE integration
- Support for remaining tokens detection after complete queries
- Comprehensive error handling with fallback position calculation
- Maintains backward compatibility with existing parse() method
The analyze method enables better error reporting and debugging capabilities
for SQL parsing, making it easier to integrate with editors and IDEs.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
error: `Syntax error: Unexpected token "${errorLexeme.value}" at character position ${errorPosition}. The SELECT query is complete but there are additional tokens.`,
101
+
errorPosition: errorPosition,
102
+
remainingTokens: remainingTokens
103
+
};
104
+
}
105
+
106
+
return{
107
+
success: true,
108
+
query: result.value
109
+
};
110
+
}catch(error){
111
+
// Extract position information from error message if available
0 commit comments