V language grammar for tree-sitter
This grammar is heavily derived from the following language grammars:
npm install tree-sitter-v
Usage (node-tree-sitter)
const Parser = require('tree-sitter');
const V = require('tree-sitter-v');
const parser = new Parser();
parser.setLanguage(V);
// TODO:
import treesitter
import tree_sitter_v.bindings.v
fn main() {
mut parser := treesitter.new_parser()
parser.set_language(v.language)
}
- It does not support all deprecated/outdated syntaxes to avoid any ambiguities and to enforce the one-way philosophy as much as possible.
- Assembly/SQL code in ASM/SQL block nodes are loosely checked and parsed immediately regardless of the content.
- Syntaxes specific for implementing JS and native compilation support are not and will not be implemented unless a consensus has been reached. Features from "Compiler magic" are being generalized into different nodes as much as possible.