Coder Social home page Coder Social logo

meysius / tree-sitter-yaml Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ikatyang/tree-sitter-yaml

0.0 0.0 0.0 1.19 MB

YAML grammar for tree-sitter

Home Page: https://ikatyang.github.io/tree-sitter-yaml/

License: MIT License

Shell 0.53% JavaScript 52.79% C++ 43.17% Rust 3.51%

tree-sitter-yaml's Introduction

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
//               (string_scalar)))
//           value: (block_node
//             (anchor)
//             (block_sequence
//               (block_sequence_item
//                 (flow_node
//                   (plain_scalar
//                     (string_scalar)))))))))))

License

MIT © Ika

tree-sitter-yaml's People

Contributors

ikatyang avatar dependabot[bot] avatar meysius avatar dimbleby avatar iwanabethatguy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.