Add support for D #856
Open
baruch wants to merge 176 commits intoWilfred:masterfrom
Open
Conversation
This covers the entire corpus of the our source code. A rather incomplete test suite (contributions are welcome!) is provided as well as some initial working queries. D is a very complex language, without a good consistent specification -- much of the work here was arrived at by trial and error, working from the specification, and also validating with actual source code. There are still no doubt some omissions.
This enables special formatting of TODO, etc.
Note that there is still a problem with strings that have embedded comments at the start.
The htmlentity is tokenized now as an escape sequence, and is n longer differentiated from other escape sequences. Update your queries accordingly.
While here add support for escape characters and htmlentities to the base highlights.
This essentially returns the !in and !is handling to the scanner, which is necessary to avoid confusing the parser since these are not "words".
Brings back htmlentity, adds tags queries, a few bugs in the parser for comments. This limits nesting comments to 5 levels deep.
Implement support in difftastic for the D programming language using the treesitter grammar provided in https://github.com/gdamore/tree-sitter-d
Author
|
Resolved conflicts |
Wilfred
requested changes
Apr 20, 2026
Owner
Wilfred
left a comment
There was a problem hiding this comment.
Thanks for the PR! I'd be up for adding D support, but I'm moving to using crates.io libraries for all the parsers. Could you switch to using https://crates.io/crates/tree-sitter-d instead? It's the same library.
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.
No description provided.