Conversation
Separate query bodies from statement-level parentheses and retain nested table subqueries through explicit ambiguity handling. Add regressions for both forms. Verified: 514 corpus tests, 27 highlight assertions, keyword inventory.
Recognize colon-prefixed parameters and dollar signs within unquoted identifiers. Update three malformed PostgreSQL recovery snapshots for the broader identifier token; their inputs remain rejected. Verified: 515 corpus tests, 27 highlight assertions, keyword inventory.
Add procedures, triggers, declarations, control flow, exception handling, EXECUTE PROCEDURE, trailing INTO, ROWS, generators, and BLOB attributes. Keep PSQL statement bodies separate from top-level DDL and add matching highlight captures. This commit uses ordinary semicolon script delimiters; caret support is layered separately. Verified: 517 corpus tests, 49 highlight assertions, keyword inventory.
Add caret statement terminators and SET TERM syntax. Use an external arithmetic-caret token to preserve operator precedence while recognizing statement boundaries, including comments and REPLACE statements. Document the multi-dialect ambiguity before parenthesized queries and the non-stateful delimiter policy for upstream discussion. Verified: 522 corpus tests, 49 highlight assertions, keyword inventory.
Provide current Neovim captures and an early-loading preview helper that survives Lazy.nvim runtimepath resets. Document build, startup, and delimiter limitations. Verified with the existing Neovim configuration: procedure, parameter, variable, control-flow, and built-in type captures; incremental edits match fresh parses.
Author
|
Tf I was working on this with Claude and it opened the PR... I haven't reviewed any of this so I am closing it, I may eventually open smaller PRs for these items but not before I have gone through a few iterations myself. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add InterBase procedural SQL support while reusing the existing expression, type, and DML grammar. This is a draft for review of the dialect and delimiter policy.
The branch is intentionally organized into five focused commits. Each parser revision was generated and tested in its own source snapshot before the next layer was committed.
Suggested review order
WHERE ((SELECT id FROM t) = 1).:parameterreferences and identifiers such asRDB$DATABASE.EXECUTE PROCEDURE.INTO,ROWS, generators, BLOB attributes, and highlight captures.^script terminators and syntacticSET TERMsupport.REPLACE.Validation
scripts/test-keywords.shpassed for each revision; its inventory comparison now deduplicates context-specific captures.Delimiter policy requiring upstream agreement
SET TERMis parsed syntactically; this implementation does not keep an active delimiter setting or implement arbitrary custom delimiters. Both;and^can terminate top-level statements.The shared grammar also supports arithmetic
^. Lookahead treats EOF or a recognized statement-start keyword after trivia as a delimiter boundary; otherwise it allows an arithmetic operand. In particular, the following currently remains one arithmetic expression:A parenthesized query is a legal arithmetic operand in other dialects, so that spelling cannot be interpreted both ways without a dialect/delimiter policy. This behavior and the semicolon alternative are documented in
docs/interbase.md. The draft status is intentional so this policy can be agreed before merging the caret layer.