tree-sitter-naturalengine
v0.0.1
Published
Tree-sitter grammar for the Natural Engine language (`.ne` files).
Maintainers
Readme
tree-sitter-naturalengine
A Tree-sitter grammar for the
Natural Engine language, the .ne files that
describe maps: declarations, styles, layers, labels, and the expressions over
zoom, feature data, and conditions that drive them.
The package contains the grammar, the generated C parser, and the highlight, indent, bracket, and injection queries.
Use it
With the Tree-sitter CLI:
npm install tree-sitter-naturalengine
npx tree-sitter parse path/to/map.neThe queries live in queries/ and use the standard capture names, so an
editor that already consumes Tree-sitter queries can load them as they are.
What it is for
This grammar is built for editors: highlighting, indentation, and structural
navigation. It is deliberately more permissive than the language itself, so
it can accept a file the engine rejects. To find out whether a file is valid,
use naturalengine check or the language server, both of which come with the
Natural Engine command line tool.
Contributing
grammar.js is the source. src/ is generated from it:
npm install
npx tree-sitter generate
npx tree-sitter parse some-file.neCommit the regenerated src/, so editors that clone this repo can compile
the parser without running the generator themselves.
License
MIT. See LICENSE.
