Skip to content

ColinKennedy/tree-sitter-objdump

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tree-sitter-objdump

This library parses objdump text using tree-sitter to produce a light-weight grammar of the file.

tree-sitter-objdump-highlights

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.

require("nvim-treesitter.configs").setup {
    ensure_installed = {"objdump"},
    parser_install_dir = installation_directory,
    highlight = { enable = true },

    -- More stuff
}

Testing

Unittests

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

check.sh  # Searches the current directory
check.sh  /path/to/place

This outputs objdump text to /tmp/objdump_files

Then run

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!