From d6cc98c6440d424465734d1f35115c84fdbee40e Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Sun, 9 Sep 2018 14:22:00 -0700 Subject: [PATCH] Remove leading $ from shell code blocks --- docs/section-3-creating-parsers.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/docs/section-3-creating-parsers.md b/docs/section-3-creating-parsers.md index 2d7aa88f..a586bd93 100644 --- a/docs/section-3-creating-parsers.md +++ b/docs/section-3-creating-parsers.md @@ -50,16 +50,19 @@ module.exports = grammar({ Then run the the following command: ```sh -$ tree-sitter generate -$ npm install +tree-sitter generate +npm install ``` This will generate the C code required to parse this trivial language, as well as all of the files needed to compile and load this native parser as a Node.js module. You can test this parser by creating a source file with the contents `hello;` and parsing it: ```sh -$ tree-sitter parse ./the-file +tree-sitter parse ./the-file +``` -(compilation_unit [0, 0] - [0, 5]) +This should print: +``` +(source_file [0, 0] - [0, 5]) ``` When you make changes to the grammar, you can update the parser simply by re-running `tree-sitter generate`. The best way to recompile the C-code is to run the command `node-gyp build`. You may have to install the [`node-gyp`][node-gyp] tool separately by running `npm install -g node-gyp`. @@ -194,7 +197,7 @@ The name of the test is written between two lines containing only `=` characters These tests are important. They serve as the parser's API documentation, and they can be run every time you change the grammar to verify that everything still parses correctly. You can run these tests using this command: ```sh -$ tree-sitter test +tree-sitter test ``` To run a particular test, you can use the the `-f` flag: