B grammar for tree-sitter
Tsoding
Note
The provided queries only work for Neovim, thanks to the #has-ancestor? directive
since B has very little standard library, and the B compiler automatically links with stdlib when possible,
i have added the // -*- link: stdlib -*- comment. after this comment, lots of standard functions will
be highlighted as a builtin. this is especially handy for smaller platforms, like uxn, which has various
functions in its stdlib that other languages don't have.
if a link is found, it'll show up in the @diff.plus highlight group. otherwise, it remains @diff.minus
| link with stdlib.h | link with stdio.h |
|---|---|
![]() |
![]() |
(look at malloc and fprintf)
(eg // -*- link: assert.h -*-)
- c libraries
assert.hctype.hlanginfo.hlocale.hmath.hnl_types.hregex.hsetjmp.hsignal.hstdarg.hstdio.hstdlib.hstring.hstrings.htime.hwchar.hwctype.h
- uxn:
uxn
__asm__(...)highlighting- fasm/gas assembly by default
- use the
// -*- link: uxn -*-directive to highlight asm in uxntal

