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
Add devicetree parser #683
Closed
Closed
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
Define comment syntax rule ahead of node identifier
…odes Define labeled items recursively
Added support for the following features, which Zephyr's parser handles, but which aren't documented in the devicetree specification: /plugin/ /omit-if-no-ref/ node /bits/ size <value> /incbin/ (filename) /incbin/ (filename, offset, size)
Define 'name' field for /delete-node/ and /delete-property/
Support `#include` directives in nodes
Removed Node latest from the build matrix, since tree-sitter is failing to build on it. Split up the GitHub workflow into separate build and linting workflows. Added Mac and Windows builds to the tests, and added eslint.
"dts" is a much more common abbreviation for devicetree than "dt"
The other tree-sitter grammars I used as reference use a different main branch name than I do. Fixed the branch name.
With the GitHub actions extension installed, these files are identified as github-actions-workflow instead of yml.
Reworked labels to be a field on the labeled node instead of a separate node type. Added support for labels on property names and /memreserve/.
The Devicetree Specification v0.4, section 2.2.1 "Node Names", says > The unit-address component of the name is specific to the bus type on > which the node sits. It consists of one or more ASCII characters from > the set of characters in Table 2.1. Table 2.1 allows for all a-z characters, ',', '.', '_', '+', and '-'. In normal use the unit-address is just a hex number and the devicetree spec technically requires this by saying > The unit-address must match the first address specified in the reg > property of the node. However the devicetree compiler supports the full ASCII table, and there are a significant number of devicetrees in the Linux kernel that use the unit-address as a "name" field. For example see https://elixir.bootlin.com/linux/v6.7.4/source/arch/arm/boot/dts/marvell/armada-xp-crs328-4c-20s-4s.dtsi#L91
Changes based on tree-sitter-c as of 371fd0b
I've just merged #642, but thanks for the PR :) |
Derp, should've searched first. Thanks! |
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.