#tree-sitter #parser #incremental #fast-build

tree-sitter-fastbuild

FASTBuild grammar for the tree-sitter parsing library

1 unstable release

new 0.0.1 Dec 15, 2024

#331 in #incremental

MIT license

225KB
9K SLoC

C 9K SLoC // 0.0% comments JavaScript 226 SLoC Scheme 194 SLoC // 0.1% comments Rust 36 SLoC // 0.4% comments

tree-sitter-fastbuild

FASTBuild grammar for tree-sitter

Usage

It's not published on grammar lists yet

NeoVim (using nvim-treesitter)

local parsers = require 'nvim-treesitter.parsers'.get_parser_configs()
vim.filetype.add {
  extension = {
    bff = 'fastbuild',
  },
}
parsers.fastbuild = {
  install_info = {
    url = 'https://github.com/pinbraerts/tree-sitter-fastbuild.git',
    branch = 'main',
    files = {
      'src/parser.c',
      'src/scanner.c',
    },
    generate_requires_npm = false,
    requires_generate_from_grammar = false,
  },
  filetype = 'fastbuild',
}

And then

:TSInstall fastbuild

Queries

You need to copy queries to some nvim runtime path directory

shell

ln -s /path/to/cloned/tree-sitter-fastbuild/queries ~/.config/nvim/after/queries/fastbuild

powershell

New-Item -Type SymbolicLink -Value path\to\cloned\tree-sitter-fastbuild\queries -Path $env:LOCALAPPDATA\nvim\after\queries\fastbuild

Features

Example

examples/example.bff

Dependencies

~2.8–4MB
~77K SLoC