Go to file
dependabot[bot] 89a606b23f
chore(deps): bump lodash from 4.17.15 to 4.17.19 (#3)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.19)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-19 14:24:19 +08:00
corpus chore: use tree-sitter-cli@0.15.9-custom 2019-09-30 14:33:07 +08:00
docs chore: upgrade to tree-sitter-playground@0.15.9 2019-09-30 15:01:55 +08:00
scripts chore(deps): upgrade to tree-sitter@0.16.7 2020-05-24 17:29:51 +08:00
src chore(deps): upgrade to tree-sitter@0.16.7 2020-05-24 17:29:51 +08:00
yaml-test-suite@053b73a9c1 feat: initial implementation 2019-08-31 19:14:13 +08:00
.editorconfig feat: initial implementation 2019-08-31 19:14:13 +08:00
.gitattributes chore: add playground 2019-09-01 02:06:30 +08:00
.gitignore chore: use tree-sitter-cli@0.15.9-custom 2019-09-30 14:33:07 +08:00
.gitmodules feat: initial implementation 2019-08-31 19:14:13 +08:00
.npmignore feat: initial implementation 2019-08-31 19:14:13 +08:00
.travis.yml chore: use tree-sitter-cli@0.15.9-custom 2019-09-30 14:33:07 +08:00
binding.gyp feat: initial implementation 2019-08-31 19:14:13 +08:00
CHANGELOG.md chore(release): 0.1.0 2019-08-31 20:16:11 +08:00
grammar.js feat: initial implementation 2019-08-31 19:14:13 +08:00
index.js feat: initial implementation 2019-08-31 19:14:13 +08:00
LICENSE feat: initial implementation 2019-08-31 19:14:13 +08:00
package.json chore: use tree-sitter-cli@0.15.9-custom 2019-09-30 14:33:07 +08:00
README.md feat: initial implementation 2019-08-31 19:14:13 +08:00
yarn.lock chore(deps): bump lodash from 4.17.15 to 4.17.19 (#3) 2020-07-19 14:24:19 +08:00

tree-sitter-yaml

npm build

YAML (YAML Spec v1.2) grammar for tree-sitter

Changelog

Install

npm install tree-sitter-yaml tree-sitter

Usage

const Parser = require("tree-sitter");
const YAML = require("tree-sitter-yaml");

const parser = new Parser();
parser.setLanguage(YAML);

const sourceCode = `
!!map
hello: &anchor
- world
`;

const tree = parser.parse(sourceCode);
console.log(tree.rootNode.toString());
// (stream
//   (document
//     (block_node
//       (tag)
//       (block_mapping
//         (block_mapping_pair
//           key: (flow_node
//             (plain_scalar))
//           value: (block_node
//             (anchor)
//             (block_sequence
//               (block_sequence_item
//                 (flow_node
//                   (plain_scalar))))))))))

License

MIT © Ika