Merge pull request #330 from andycraig/update-file-locations-in-docs

Update doc example program file locations
This commit is contained in:
Max Brunsfeld 2019-05-08 08:41:39 -07:00 committed by GitHub
commit 7de4985a27
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -103,14 +103,14 @@ int main() {
}
```
This program uses the Tree-sitter C API, which is declared in the header file `tree_sitter/api.h`, so we need to add the `tree_sitter/include` directory to the include path. We also need to link `libtree-sitter.a` into the binary. We compile the source code of the JSON language directly into the binary as well.
This program uses the Tree-sitter C API, which is declared in the header file `tree-sitter/api.h`, so we need to add the `tree-sitter/lib/include` directory to the include path. We also need to link `libtree-sitter.a` into the binary. We compile the source code of the JSON language directly into the binary as well.
```sh
clang \
-I tree-sitter/include \
-I tree-sitter/lib/include \
test-json-parser.c \
tree-sitter-json/src/parser.c \
tree-sitter/libtree-sitter.a \
tree-sitter/libtree-sitter.a \
-o test-json-parser
./test-json-parser