Odin grammar for tree-sitter
The repository includes an ast-grep integration for structural search and source-accurate symbol navigation. It requires ast-grep 0.44.1 or newer, Odin, and a GCC-compatible C compiler.
./tools/odin-ast/install
./tools/odin-ast/testThe installer compiles the committed generated parser and native odin-ast
command, checks the staged installation, then installs it under the current
user's config and local-bin directories. Run it again after changing the
parser, wrapper, or outline rules. The separate test command uses the
development dependencies to regenerate the parser and run the full corpus,
Node binding, lint, and navigation test suite.
odin-ast outline path/to/file.odin
odin-ast map path/to/source
odin-ast find Symbol_Name path/to/source
odin-ast show path/to/file.odin Symbol_Name
odin-ast run --pattern '$NAME :: $VALUE' --lang odin path/to/sourcemap, find, and show include private declarations. find returns every
exact item or member match; show refuses missing or ambiguous names rather
than selecting one silently. Other subcommands are forwarded to ast-grep with
the installed Odin configuration. Set ODIN_AST_GREP, ODIN_AST_CONFIG_DIR,
or ODIN_AST_BIN_DIR to override installation/runtime locations; a specific
runtime config file can be selected with ODIN_AST_CONFIG.