-
Notifications
You must be signed in to change notification settings - Fork 111
feat: add Firebird SQL dialect support #362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
7558de4
feat: add Firebird SQL dialect support
4501ad8
chore: move local test scripts to local_test/ (gitignored)
a201695
fix: restore ^ binary operator; isolate Firebird body rules
bdbad8a
chore: update package-lock.json after adding tree-sitter-cli dev depe…
b1cf802
feat: Firebird 5 dialect support (COMPUTED BY, GRANT/REVOKE, triggers…
d147a50
fix: allow embedded dollar-quoted literals inside dollar-quoted funct…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| """Build script: regenerate parser, reinstall package, run integration test.""" | ||
| import subprocess, sys, os, pathlib, time, shutil | ||
|
|
||
| tree_dir = pathlib.Path(r'e:\temp\tree-sitter-sql') | ||
| ts_bin = tree_dir / 'tree-sitter.exe' | ||
| node_dir = r'e:\temp\node\node-v22.15.0-win-x64' | ||
| pyd_file = tree_dir / 'bindings' / 'python' / 'tree_sitter_sql' / '_binding.pyd' | ||
|
|
||
| env = os.environ.copy() | ||
| env['PATH'] = node_dir + ';' + env.get('PATH', '') | ||
|
|
||
| # Step 1: generate | ||
| print('1. Running tree-sitter generate ...') | ||
| r = subprocess.run([str(ts_bin), 'generate'], cwd=str(tree_dir), env=env, capture_output=True, text=True) | ||
| if r.returncode != 0: | ||
| print('FAIL:', r.stderr) | ||
| sys.exit(1) | ||
| print(' OK:', r.stderr.strip() or '(no warnings)') | ||
| print(' parser.c:', (tree_dir / 'src' / 'parser.c').stat().st_mtime) | ||
|
|
||
| # Step 2: delete old .pyd | ||
| if pyd_file.exists(): | ||
| pyd_file.unlink() | ||
| print('2. Deleted old _binding.pyd') | ||
|
|
||
| # Step 3: reinstall | ||
| print('3. pip install -e ...') | ||
| r = subprocess.run([sys.executable, '-m', 'pip', 'install', '-e', '.'], | ||
| cwd=str(tree_dir), capture_output=True, text=True) | ||
| if r.returncode != 0: | ||
| print('FAIL:', r.stderr[-500:]) | ||
| sys.exit(1) | ||
| print(' OK:', r.stdout.strip().split('\n')[-1]) | ||
| print(' _binding.pyd:', pyd_file.stat().st_mtime) | ||
|
|
||
| # Step 4: run test | ||
| print('4. Running test_speedy.py ...') | ||
| r = subprocess.run([sys.executable, str(tree_dir / 'test_speedy.py')], capture_output=True, text=True) | ||
| print(r.stdout) | ||
| if r.stderr: | ||
| print('STDERR:', r.stderr[:500]) | ||
| sys.exit(r.returncode) |
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -105,6 +105,8 @@ export default { | |
|
|
||
| _tsql_function_body_statement: $ => seq( | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Have you considered implementing a separate |
||
| optional($.keyword_as), | ||
| // Firebird: DECLARE VARIABLE name type; appears before BEGIN | ||
| repeat($.fb_var_declaration), | ||
| $.keyword_begin, | ||
| optional($.var_declarations), | ||
| choice( | ||
|
|
||
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.