build: update bindings

This commit is contained in:
ObserverOfTime 2024-03-31 16:45:34 +03:00 committed by Amaan Qureshi
parent c9ee63b15c
commit f5d3ac2be1
26 changed files with 661 additions and 1440 deletions

View file

@ -3,10 +3,38 @@ root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
max_line_length = 120
insert_final_newline = true
trim_trailing_whitespace = true
[corpus/*]
trim_trailing_whitespace = false
[*.{json,toml,yml,gyp}]
indent_style = space
indent_size = 2
[*.js]
indent_style = space
indent_size = 2
[*.rs]
indent_style = space
indent_size = 4
[*.{c,cc,h}]
indent_style = space
indent_size = 4
[*.{py,pyi}]
indent_style = space
indent_size = 4
[*.swift]
indent_style = space
indent_size = 4
[*.go]
indent_style = tab
indent_size = 8
[Makefile]
indent_style = tab
indent_size = 8

14
.gitattributes vendored
View file

@ -1,7 +1,11 @@
* text eol=lf
*.wasm binary
/src/** linguist-generated
/src/scanner.cc linguist-generated=false
/index.js linguist-generated
/binding.gyp linguist-detectable=false
src/*.json linguist-generated
src/parser.c linguist-generated
src/tree_sitter/* linguist-generated
bindings/** linguist-generated
binding.gyp linguist-generated
setup.py linguist-generated
Makefile linguist-generated
Package.swift linguist-generated

42
.gitignore vendored
View file

@ -1,5 +1,39 @@
/build
/node_modules
# Rust artifacts
Cargo.lock
target/
/bindings/rust
/Cargo.toml
# Node artifacts
build/
prebuilds/
node_modules/
# Swift artifacts
.build/
Package.resolved
# Go artifacts
go.sum
_obj/
# Python artifacts
.venv/
dist/
*.egg-info
*.whl
# C artifacts
*.a
*.so
*.so.*
*.dylib
*.dll
*.pc
# Example dirs
/examples/*/
# Grammar volatiles
dsl.d.ts
*.wasm
*.obj
*.o

View file

27
Cargo.toml Normal file
View file

@ -0,0 +1,27 @@
[package]
name = "tree-sitter-yaml"
description = "YAML grammar for tree-sitter"
version = "0.6.0"
license = "MIT"
readme = "README.md"
keywords = ["incremental", "parsing", "tree-sitter", "yaml"]
categories = ["parsing", "text-editors"]
authors = [
"Ika <ikatyang@gmail.com>",
"Amaan Qureshi <amaanq12@gmail.com>"
]
repository = "https://github.com/tree-sitter-grammars/tree-sitter-yaml"
edition = "2021"
autoexamples = false
build = "bindings/rust/build.rs"
include = ["bindings/rust/*", "grammar.js", "queries/*", "src/*"]
[lib]
path = "bindings/rust/lib.rs"
[dependencies]
tree-sitter = ">=0.21.0"
[build-dependencies]
cc = "1.0.92"

View file

@ -1,6 +1,5 @@
The MIT License (MIT)
Copyright (c) Ika <ikatyang@gmail.com> (https://github.com/ikatyang)
Copyright (c) 2024 tree-sitter-grammars contributors
Copyright (c) 2019-2021 Ika
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

3
Makefile generated
View file

@ -1,4 +1,4 @@
VERSION := 0.0.1
VERSION := 0.6.0
LANGUAGE_NAME := tree-sitter-yaml
@ -106,5 +106,6 @@ clean:
test:
$(TS) test
$(TS) parse examples/* --quiet --time
.PHONY: all install uninstall clean test

9
Package.swift generated
View file

@ -2,14 +2,13 @@
import PackageDescription
let package = Package(
name: "TreeSitterYaml",
platforms: [.macOS(.v10_13), .iOS(.v11)],
name: "TreeSitterYAML",
products: [
.library(name: "TreeSitterYaml", targets: ["TreeSitterYaml"]),
.library(name: "TreeSitterYAML", targets: ["TreeSitterYAML"]),
],
dependencies: [],
targets: [
.target(name: "TreeSitterYaml",
.target(name: "TreeSitterYAML",
path: ".",
exclude: [
"Cargo.toml",
@ -36,7 +35,7 @@ let package = Package(
],
sources: [
"src/parser.c",
// NOTE: if your language has an external scanner, add it here.
"src/scanner.c",
],
resources: [
.copy("queries")

View file

@ -1,53 +1,21 @@
# tree-sitter-yaml
[![npm](https://img.shields.io/npm/v/tree-sitter-yaml.svg)](https://www.npmjs.com/package/tree-sitter-yaml)
[![build](https://img.shields.io/travis/com/ikatyang/tree-sitter-yaml/master.svg)](https://travis-ci.com/ikatyang/tree-sitter-yaml/builds)
[![CI][ci]](https://github.com/tree-sitter-grammars/tree-sitter-yaml/actions)
[![discord][discord]](https://discord.gg/w7nTvsVJhm)
[![matrix][matrix]](https://matrix.to/#/#tree-sitter-chat:matrix.org)
[![npm][npm]](https://www.npmjs.com/package/@tree-sitter-grammars/tree-sitter-yaml)
[![crates][crates]](https://crates.io/crates/tree-sitter-yaml)
[![pypi][pypi]](https://pypi.org/project/tree-sitter-yaml/)
YAML ([YAML Spec v1.2](https://yaml.org/spec/1.2/spec.html)) grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter)
A tree-sitter parser for YAML files.
[Changelog](https://github.com/ikatyang/tree-sitter-yaml/blob/master/CHANGELOG.md)
## References
## Install
- [YAML version 1.2](https://yaml.org/spec/1.2/spec.html)
```sh
npm install tree-sitter-yaml tree-sitter
```
## Usage
```js
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](https://github.com/ikatyang)
[ci]: https://img.shields.io/github/actions/workflow/status/tree-sitter-grammars/tree-sitter-yaml/ci.yml?logo=github&label=CI
[discord]: https://img.shields.io/discord/1063097320771698699?logo=discord&label=discord
[matrix]: https://img.shields.io/matrix/tree-sitter-chat%3Amatrix.org?logo=matrix&label=matrix
[npm]: https://img.shields.io/npm/v/%40tree-sitter-grammars%2Ftree-sitter-yaml?logo=npm
[crates]: https://img.shields.io/crates/v/tree-sitter-yaml?logo=rust
[pypi]: https://img.shields.io/pypi/v/tree-sitter-yaml?logo=pypi&logoColor=ffd242

2
binding.gyp generated
View file

@ -11,7 +11,7 @@
"sources": [
"bindings/node/binding.cc",
"src/parser.c",
# NOTE: if your language has an external scanner, add it here.
"src/scanner.c",
],
"cflags_c": [
"-std=c11",

View file

@ -3,7 +3,7 @@ libdir=@LIBDIR@
includedir=@INCLUDEDIR@
Name: tree-sitter-yaml
Description: Yaml grammar for tree-sitter
Description: YAML grammar for tree-sitter
URL: @URL@
Version: @VERSION@
Requires: @REQUIRES@

View file

@ -2,7 +2,7 @@ package tree_sitter_yaml
// #cgo CFLAGS: -std=c11 -fPIC
// #include "../../src/parser.c"
// // NOTE: if your language has an external scanner, add it here.
// #include "../../src/scanner.c"
import "C"
import "unsafe"

View file

@ -10,6 +10,6 @@ import (
func TestCanLoadGrammar(t *testing.T) {
language := tree_sitter.NewLanguage(tree_sitter_yaml.Language())
if language == nil {
t.Errorf("Error loading Yaml grammar")
t.Errorf("Error loading YAML grammar")
}
}

2
bindings/go/go.mod generated
View file

@ -1,4 +1,4 @@
module github.com/tree-sitter/tree-sitter-yaml
module github.com/tree-sitter-grammars/tree-sitter-yaml
go 1.22

View file

@ -1,4 +1,4 @@
"Yaml grammar for tree-sitter"
"YAML grammar for tree-sitter"
from ._binding import language

17
bindings/rust/build.rs generated Normal file
View file

@ -0,0 +1,17 @@
fn main() {
let src_dir = std::path::Path::new("src");
let mut c_config = cc::Build::new();
c_config.flag("-Wno-unused-but-set-variable").flag("-Wno-unused-value").flag("-Wno-implicit-fallthrough");
c_config.std("c11").include(src_dir);
let parser_path = src_dir.join("parser.c");
c_config.file(&parser_path);
println!("cargo:rerun-if-changed={}", parser_path.to_str().unwrap());
let scanner_path = src_dir.join("scanner.c");
c_config.file(&scanner_path);
println!("cargo:rerun-if-changed={}", scanner_path.to_str().unwrap());
c_config.compile("tree-sitter-yaml");
}

58
bindings/rust/lib.rs generated Normal file
View file

@ -0,0 +1,58 @@
//! This crate provides YAML language support for the [tree-sitter][] parsing library.
//!
//! Typically, you will use the [language][language func] function to add this language to a
//! tree-sitter [Parser][], and then use the parser to parse some code:
//!
//! ```
//! let code = r#"
//! key: value
//! list:
//! - item1
//! - item2
//! "#;
//! let mut parser = tree_sitter::Parser::new();
//! parser.set_language(&tree_sitter_yaml::language()).expect("Error loading YAML grammar");
//! let tree = parser.parse(code, None).unwrap();
//! assert!(!tree.root_node().has_error());
//! ```
//!
//! [Language]: https://docs.rs/tree-sitter/*/tree_sitter/struct.Language.html
//! [language func]: fn.language.html
//! [Parser]: https://docs.rs/tree-sitter/*/tree_sitter/struct.Parser.html
//! [tree-sitter]: https://tree-sitter.github.io/
use tree_sitter::Language;
extern "C" {
fn tree_sitter_yaml() -> Language;
}
/// Get the tree-sitter [Language][] for this grammar.
///
/// [Language]: https://docs.rs/tree-sitter/*/tree_sitter/struct.Language.html
pub fn language() -> Language {
unsafe { tree_sitter_yaml() }
}
/// The content of the [`node-types.json`][] file for this grammar.
///
/// [`node-types.json`]: https://tree-sitter.github.io/tree-sitter/using-parsers#static-node-types
pub const NODE_TYPES: &str = include_str!("../../src/node-types.json");
// Uncomment these to include any queries that this grammar contains
// pub const HIGHLIGHTS_QUERY: &str = include_str!("../../queries/highlights.scm");
// pub const INJECTIONS_QUERY: &str = include_str!("../../queries/injections.scm");
// pub const LOCALS_QUERY: &str = include_str!("../../queries/locals.scm");
// pub const TAGS_QUERY: &str = include_str!("../../queries/tags.scm");
#[cfg(test)]
mod tests {
#[test]
fn test_can_load_grammar() {
let mut parser = tree_sitter::Parser::new();
parser
.set_language(&super::language())
.expect("Error loading YAML grammar");
}
}

View file

@ -1,3 +1,11 @@
/**
* @file YAML grammar for tree-sitter
* @author Ika <ikatyang@gmail.com>
* @license MIT
*/
/// <reference types="tree-sitter-cli/dsl" />
module.exports = grammar({
name: "yaml",

387
package-lock.json generated Normal file
View file

@ -0,0 +1,387 @@
{
"name": "@tree-sitter-grammars/tree-sitter-yaml",
"version": "0.6.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@tree-sitter-grammars/tree-sitter-yaml",
"version": "0.6.0",
"hasInstallScript": true,
"license": "MIT",
"dependencies": {
"node-addon-api": "^8.0.0",
"node-gyp-build": "^4.8.0"
},
"devDependencies": {
"prebuildify": "^6.0.0",
"tree-sitter-cli": "^0.22.2"
},
"peerDependencies": {
"tree-sitter": "^0.21.1"
},
"peerDependenciesMeta": {
"tree_sitter": {
"optional": true
}
}
},
"node_modules/base64-js": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
"integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
"dev": true,
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/feross"
},
{
"type": "patreon",
"url": "https://www.patreon.com/feross"
},
{
"type": "consulting",
"url": "https://feross.org/support"
}
]
},
"node_modules/bl": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz",
"integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==",
"dev": true,
"dependencies": {
"buffer": "^5.5.0",
"inherits": "^2.0.4",
"readable-stream": "^3.4.0"
}
},
"node_modules/buffer": {
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz",
"integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==",
"dev": true,
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/feross"
},
{
"type": "patreon",
"url": "https://www.patreon.com/feross"
},
{
"type": "consulting",
"url": "https://feross.org/support"
}
],
"dependencies": {
"base64-js": "^1.3.1",
"ieee754": "^1.1.13"
}
},
"node_modules/chownr": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz",
"integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==",
"dev": true
},
"node_modules/end-of-stream": {
"version": "1.4.4",
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz",
"integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==",
"dev": true,
"dependencies": {
"once": "^1.4.0"
}
},
"node_modules/execspawn": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/execspawn/-/execspawn-1.0.1.tgz",
"integrity": "sha512-s2k06Jy9i8CUkYe0+DxRlvtkZoOkwwfhB+Xxo5HGUtrISVW2m98jO2tr67DGRFxZwkjQqloA3v/tNtjhBRBieg==",
"dev": true,
"dependencies": {
"util-extend": "^1.0.1"
}
},
"node_modules/fs-constants": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz",
"integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==",
"dev": true
},
"node_modules/ieee754": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
"integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==",
"dev": true,
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/feross"
},
{
"type": "patreon",
"url": "https://www.patreon.com/feross"
},
{
"type": "consulting",
"url": "https://feross.org/support"
}
]
},
"node_modules/inherits": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
"dev": true
},
"node_modules/lru-cache": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
"dev": true,
"dependencies": {
"yallist": "^4.0.0"
},
"engines": {
"node": ">=10"
}
},
"node_modules/minimist": {
"version": "1.2.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
"integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
"dev": true,
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/mkdirp-classic": {
"version": "0.5.3",
"resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz",
"integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==",
"dev": true
},
"node_modules/node-abi": {
"version": "3.56.0",
"resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.56.0.tgz",
"integrity": "sha512-fZjdhDOeRcaS+rcpve7XuwHBmktS1nS1gzgghwKUQQ8nTy2FdSDr6ZT8k6YhvlJeHmmQMYiT/IH9hfco5zeW2Q==",
"dev": true,
"dependencies": {
"semver": "^7.3.5"
},
"engines": {
"node": ">=10"
}
},
"node_modules/node-addon-api": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-8.0.0.tgz",
"integrity": "sha512-ipO7rsHEBqa9STO5C5T10fj732ml+5kLN1cAG8/jdHd56ldQeGj3Q7+scUS+VHK/qy1zLEwC4wMK5+yM0btPvw==",
"engines": {
"node": "^18 || ^20 || >= 21"
}
},
"node_modules/node-gyp-build": {
"version": "4.8.0",
"resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.0.tgz",
"integrity": "sha512-u6fs2AEUljNho3EYTJNBfImO5QTo/J/1Etd+NVdCj7qWKUSN/bSLkZwhDv7I+w/MSC6qJ4cknepkAYykDdK8og==",
"bin": {
"node-gyp-build": "bin.js",
"node-gyp-build-optional": "optional.js",
"node-gyp-build-test": "build-test.js"
}
},
"node_modules/npm-run-path": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-3.1.0.tgz",
"integrity": "sha512-Dbl4A/VfiVGLgQv29URL9xshU8XDY1GeLy+fsaZ1AA8JDSfjvr5P5+pzRbWqRSBxk6/DW7MIh8lTM/PaGnP2kg==",
"dev": true,
"dependencies": {
"path-key": "^3.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/once": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
"dev": true,
"dependencies": {
"wrappy": "1"
}
},
"node_modules/path-key": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
"integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
"dev": true,
"engines": {
"node": ">=8"
}
},
"node_modules/prebuildify": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/prebuildify/-/prebuildify-6.0.0.tgz",
"integrity": "sha512-DEvK4C3tcimIp7Pzqbs036n9i6CTKGp1XVEpMnr4wV3enKU5sBogPP+lP3KZw7993i42bXnsd5eIxAXQ566Cqw==",
"dev": true,
"dependencies": {
"execspawn": "^1.0.1",
"minimist": "^1.2.5",
"mkdirp-classic": "^0.5.3",
"node-abi": "^3.3.0",
"npm-run-path": "^3.1.0",
"pump": "^3.0.0",
"tar-fs": "^2.1.0"
},
"bin": {
"prebuildify": "bin.js"
}
},
"node_modules/pump": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
"integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==",
"dev": true,
"dependencies": {
"end-of-stream": "^1.1.0",
"once": "^1.3.1"
}
},
"node_modules/readable-stream": {
"version": "3.6.2",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
"integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
"dev": true,
"dependencies": {
"inherits": "^2.0.3",
"string_decoder": "^1.1.1",
"util-deprecate": "^1.0.1"
},
"engines": {
"node": ">= 6"
}
},
"node_modules/safe-buffer": {
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
"dev": true,
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/feross"
},
{
"type": "patreon",
"url": "https://www.patreon.com/feross"
},
{
"type": "consulting",
"url": "https://feross.org/support"
}
]
},
"node_modules/semver": {
"version": "7.6.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz",
"integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==",
"dev": true,
"dependencies": {
"lru-cache": "^6.0.0"
},
"bin": {
"semver": "bin/semver.js"
},
"engines": {
"node": ">=10"
}
},
"node_modules/string_decoder": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
"integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
"dev": true,
"dependencies": {
"safe-buffer": "~5.2.0"
}
},
"node_modules/tar-fs": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz",
"integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==",
"dev": true,
"dependencies": {
"chownr": "^1.1.1",
"mkdirp-classic": "^0.5.2",
"pump": "^3.0.0",
"tar-stream": "^2.1.4"
}
},
"node_modules/tar-stream": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz",
"integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==",
"dev": true,
"dependencies": {
"bl": "^4.0.3",
"end-of-stream": "^1.4.1",
"fs-constants": "^1.0.0",
"inherits": "^2.0.3",
"readable-stream": "^3.1.1"
},
"engines": {
"node": ">=6"
}
},
"node_modules/tree-sitter": {
"version": "0.21.1",
"resolved": "https://registry.npmjs.org/tree-sitter/-/tree-sitter-0.21.1.tgz",
"integrity": "sha512-7dxoA6kYvtgWw80265MyqJlkRl4yawIjO7S5MigytjELkX43fV2WsAXzsNfO7sBpPPCF5Gp0+XzHk0DwLCq3xQ==",
"hasInstallScript": true,
"peer": true,
"dependencies": {
"node-addon-api": "^8.0.0",
"node-gyp-build": "^4.8.0"
}
},
"node_modules/tree-sitter-cli": {
"version": "0.22.2",
"resolved": "https://registry.npmjs.org/tree-sitter-cli/-/tree-sitter-cli-0.22.2.tgz",
"integrity": "sha512-ecqccEp27XMFXgjLMEEU71vK9JCWAC7fqSTTxcs5P1tnEnaaf4GkHz/wfo4lJ9l3rfxcTDPxN84tHAoitIQqdA==",
"dev": true,
"hasInstallScript": true,
"bin": {
"tree-sitter": "cli.js"
}
},
"node_modules/util-deprecate": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
"integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==",
"dev": true
},
"node_modules/util-extend": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/util-extend/-/util-extend-1.0.3.tgz",
"integrity": "sha512-mLs5zAK+ctllYBj+iAQvlDCwoxU/WDOUaJkcFudeiAX6OajC6BKXJUa9a+tbtkC11dz2Ufb7h0lyvIOVn4LADA==",
"dev": true
},
"node_modules/wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
"dev": true
},
"node_modules/yallist": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
"dev": true
}
}
}

View file

@ -1,62 +1,69 @@
{
"name": "tree-sitter-yaml",
"version": "0.5.0",
"name": "@tree-sitter-grammars/tree-sitter-yaml",
"version": "0.6.0",
"license": "MIT",
"description": "YAML grammar for tree-sitter",
"keywords": [
"parser",
"lexer"
],
"repository": "github:tree-sitter-grammars/tree-sitter-yaml",
"main": "bindings/node",
"types": "bindings/node",
"repository": "https://github.com/ikatyang/tree-sitter-yaml",
"homepage": "https://github.com/ikatyang/tree-sitter-yaml#readme",
"author": {
"name": "Ika",
"email": "ikatyang@gmail.com",
"url": "https://github.com/ikatyang"
},
"license": "MIT",
"scripts": {
"test": "yarn tree-sitter test",
"prepack": "bash ./scripts/update-schema.sh && yarn tree-sitter generate",
"release": "standard-version --commit-all",
"tree-sitter": "./tree-sitter/target/release/tree-sitter",
"install": "node-gyp-build",
"prebuildify": "prebuildify --napi --strip"
},
"standard-version": {
"preset": "angular",
"scripts": {
"postbump": "rm -r docs && node scripts/generate-playground.js && git add docs"
"maintainers": [
{
"name": "Amaan Qureshi",
"email": "amaanq12@gmail.com"
}
},
],
"keywords": [
"incremental",
"parsing",
"tree-sitter",
"yaml"
],
"files": [
"grammar.js",
"binding.gyp",
"prebuilds/**",
"bindings/node/*",
"queries/*",
"src/**"
],
"dependencies": {
"node-addon-api": "^7.1.0",
"node-addon-api": "^8.0.0",
"node-gyp-build": "^4.8.0"
},
"devDependencies": {
"prebuildify": "^6.0.0",
"tree-sitter-cli": "^0.22.2"
},
"peerDependencies": {
"tree-sitter": "^0.21.0"
"tree-sitter": "^0.21.1"
},
"peerDependenciesMeta": {
"tree_sitter": {
"optional": true
}
},
"devDependencies": {
"get-stdin": "^8.0.0",
"natural-orderby": "2.0.3",
"standard-version": "7.0.0",
"prebuildify": "^6.0.0"
"scripts": {
"build": "tree-sitter generate --no-bindings",
"test": "tree-sitter test",
"install": "node-gyp-build",
"prebuildify": "prebuildify --napi --strip"
},
"publishConfig": {
"access": "public"
},
"files": [
"/src/",
"/bindings/node/",
"/binding.gyp",
"/grammar.js"
],
"tree-sitter": [
{
"scope": "text.yaml"
"scope": "text.yaml",
"file-types": [
"yml",
"yaml"
],
"injection-regex": "^ya?ml$"
}
]
}

View file

@ -4,8 +4,8 @@ build-backend = "setuptools.build_meta"
[project]
name = "tree-sitter-yaml"
description = "Yaml grammar for tree-sitter"
version = "0.0.1"
description = "YAML grammar for tree-sitter"
version = "0.6.0"
keywords = ["incremental", "parsing", "tree-sitter", "yaml"]
classifiers = [
"Intended Audience :: Developers",
@ -18,8 +18,16 @@ requires-python = ">=3.8"
license.text = "MIT"
readme = "README.md"
[[project.authors]]
name = "Ika"
email = "ikatyang@gmail.com"
[[project.maintainers]]
name = "Amaan Qureshi"
email = "amaanq12@gmail.com"
[project.urls]
Homepage = "https://github.com/tree-sitter/tree-sitter-yaml"
Homepage = "https://github.com/tree-sitter-grammars/tree-sitter-yaml"
[project.optional-dependencies]
core = ["tree-sitter~=0.21"]

4
setup.py generated
View file

@ -36,10 +36,10 @@ setup(
sources=[
"bindings/python/tree_sitter_yaml/binding.c",
"src/parser.c",
# NOTE: if your language uses an external scanner, add it here.
"src/scanner.c",
],
extra_compile_args=(
["-std=c11"] if system() != 'Windows' else []
["-std=c11"] if system() != "Windows" else []
),
define_macros=[
("Py_LIMITED_API", "0x03080000"),

1324
yarn.lock

File diff suppressed because it is too large Load diff