Link to Semantic in node-types docs

This commit is contained in:
Max Brunsfeld 2020-02-24 11:21:05 -08:00
parent f1e4104d47
commit 3cd05a3d0c

View file

@ -583,7 +583,9 @@ This function will return `false` when there are no more matches. Otherwise, it
## Static Node Types
In languages with static typing, it can be helpful for syntax trees to provide specific type information about individual syntax nodes. Tree-sitter makes this information available via a generated file called `node-types.json`. This *node types* file provides structured data about every possible syntax node in a grammar. You can use this data to generate type declarations in a statically-typed programming language.
In languages with static typing, it can be helpful for syntax trees to provide specific type information about individual syntax nodes. Tree-sitter makes this information available via a generated file called `node-types.json`. This *node types* file provides structured data about every possible syntax node in a grammar.
You can use this data to generate type declarations in statically-typed programming languages. For example, GitHub's [Semantic](https://github.com/github/semantic) uses these node types files to [generate Haskell data types](https://github.com/github/semantic/pull/448) for every possible syntax node, which allows for code analysis algorithms to be structurally verified by the Haskell type system.
The node types file contains an array of objects, each of which describes a particular type of syntax node using the following entries: