-
Notifications
You must be signed in to change notification settings - Fork 29
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
Support dynamically linking grammars #177
Merged
Merged
Conversation
This file contains 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
Add a build flag that allows toggling support for dynamic and static linking of grammars and add tests for dynamic grammar loading.
Update the github actions so we specify each feature for debug builds, tests, and release builds. We can't enable dynamic libraries when testing release builds because the libraries won't be found on the system, but we still want to make sure the code for the libraries builds.
`libloading` doesn't supply the extension for you so we need to add the extension based on the platform.
Add a compilation flag for static grammars so the binary doesn't attempt to compile any of the grammars unless the compilation flag is selected.
* Add a proper config for grammars * Add configs to set the dynamic library paths for different languages * Refactor extension overrides into this config (breaking change for the configs) * Update sample config to reflect this change * Disable dynamic grammar test by default * Derive the `default` trait for configs instead of using a manual implementation
Don't include the codegen file if the static grammar flag hasn't been set, because the file won't exist.
11 tasks
Ignore a clippy lint about unused arguments since it's valid with certain build flags.
I had to add to use tree_sitter::Language;
use phf::phf_map; and I still have:
|
Move everything behind the proper feature gates so each combination of build flags compiles correctly and address clippy warnings.
Hey sorry about that, I realized I tested without enabling |
Remove an unused line
Leak the symbol table pointer so there aren't any segfaults when working with the gramamr throughout the program.
`c` should be `cpp`
Enable the feature so tests are run in the CI
This addresses a clippy lint
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.
Add a build flag that allows toggling support for dynamic and static
linking of grammars and add tests for dynamic grammar loading.
Fixes #167.