Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/colinkennedy/tree-sitter-objdump
Parse objdump files using tree-sitter
https://github.com/colinkennedy/tree-sitter-objdump
neovim objdump tree-sitter
Last synced: about 1 month ago
JSON representation
Parse objdump files using tree-sitter
- Host: GitHub
- URL: https://github.com/colinkennedy/tree-sitter-objdump
- Owner: ColinKennedy
- License: gpl-3.0
- Created: 2023-10-10T05:16:39.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2023-11-22T13:19:55.000Z (about 1 year ago)
- Last Synced: 2024-10-12T22:54:03.548Z (2 months ago)
- Topics: neovim, objdump, tree-sitter
- Language: C
- Homepage:
- Size: 183 KB
- Stars: 12
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tree-sitter-objdump
This library parses objdump text using
[tree-sitter](https://tree-sitter.github.io/tree-sitter) to produce
a light-weight grammar of the file.![tree-sitter-objdump-highlights](https://github.com/ColinKennedy/tree-sitter-objdump/assets/10103049/184c535b-7a58-4726-82c1-d252e5174c15)
## Disclaimer
This repository's parsing rules are subject to change.## Building + Using
### Neovim
Make sure you include the following somewhere in your `init.lua` file.```lua
require("nvim-treesitter.configs").setup {
ensure_installed = {"objdump"},
parser_install_dir = installation_directory,
highlight = { enable = true },-- More stuff
}
```## Testing
### Unittests
- Install the [tree-sitter-cli](https://www.npmjs.com/package/tree-sitter-cli)
```sh
cd {root}
tree-sitter test
```All tests should pass.
### Actual Objdump Files
The best way to test tree-sitter-objdump is to parse Objdump files in-action.A quick way to do that is to run `check.sh`
```sh
check.sh # Searches the current directory
check.sh /path/to/place
```This outputs objdump text to `/tmp/objdump_files`
Then run
```sh
cat /tmp/objdumps | xargs -I{} sh -c 'tree-sitter parse {} > /dev/null || echo "{}"' > /tmp/fails
```If all is going well, the output file `/tmp/fails` should be empty!