tree-sitter-vue
Vue (Vue v2.6.0 Template Syntax) grammar for tree-sitter
Note: This grammar is not responsible for parsing embedded languages, see Multi-language Documents for more info.
Changelog
Install
npm install tree-sitter-vue tree-sitter
Usage
const Parser = require("tree-sitter");
const Vue = require("tree-sitter-vue");
const parser = new Parser();
parser.setLanguage(Vue);
const sourceCode = `
<template>
Hello, <a :[key]="url">{{ name }}</a>!
</template>
`;
const tree = parser.parse(sourceCode);
console.log(tree.rootNode.toString());
License
MIT © Ika