tree-sitter-json
Advanced tools
Comparing version 0.20.2 to 0.21.0
@@ -1,19 +0,7 @@ | ||
try { | ||
module.exports = require("../../build/Release/tree_sitter_json_binding"); | ||
} catch (error1) { | ||
if (error1.code !== 'MODULE_NOT_FOUND') { | ||
throw error1; | ||
} | ||
try { | ||
module.exports = require("../../build/Debug/tree_sitter_json_binding"); | ||
} catch (error2) { | ||
if (error2.code !== 'MODULE_NOT_FOUND') { | ||
throw error2; | ||
} | ||
throw error1 | ||
} | ||
} | ||
const root = require("path").join(__dirname, "..", ".."); | ||
module.exports = require("node-gyp-build")(root); | ||
try { | ||
module.exports.nodeTypeInfo = require("../../src/node-types.json"); | ||
} catch (_) {} |
/** | ||
* @file JSON grammar for tree-sitter | ||
* @author Max Brunsfeld | ||
* @author Max Brunsfeld <maxbrunsfeld@gmail.com> | ||
* @author Amaan Qureshi <amaanq12@gmail.com> | ||
* @license MIT | ||
*/ | ||
/* eslint-disable arrow-parens */ | ||
/* eslint-disable camelcase */ | ||
/* eslint-disable-next-line spaced-comment */ | ||
/// <reference types="tree-sitter-cli/dsl" /> | ||
@@ -68,20 +66,20 @@ // @ts-check | ||
number: _ => { | ||
const decimal_digits = /\d+/; | ||
const signed_integer = seq(optional('-'), decimal_digits); | ||
const exponent_part = seq(choice('e', 'E'), signed_integer); | ||
const decimalDigits = /\d+/; | ||
const signedInteger = seq(optional('-'), decimalDigits); | ||
const exponentPart = seq(choice('e', 'E'), signedInteger); | ||
const decimal_integer_literal = seq( | ||
const decimalIntegerLiteral = seq( | ||
optional('-'), | ||
choice( | ||
'0', | ||
seq(/[1-9]/, optional(decimal_digits)), | ||
seq(/[1-9]/, optional(decimalDigits)), | ||
), | ||
); | ||
const decimal_literal = choice( | ||
seq(decimal_integer_literal, '.', optional(decimal_digits), optional(exponent_part)), | ||
seq(decimal_integer_literal, optional(exponent_part)), | ||
const decimalLiteral = choice( | ||
seq(decimalIntegerLiteral, '.', optional(decimalDigits), optional(exponentPart)), | ||
seq(decimalIntegerLiteral, optional(exponentPart)), | ||
); | ||
return token(decimal_literal); | ||
return token(decimalLiteral); | ||
}, | ||
@@ -88,0 +86,0 @@ |
{ | ||
"name": "tree-sitter-json", | ||
"version": "0.20.2", | ||
"version": "0.21.0", | ||
"description": "JSON grammar for tree-sitter", | ||
"repository": "github:tree-sitter/tree-sitter-json", | ||
"license": "MIT", | ||
"author": "Max Brunsfeld <maxbrunsfeld@gmail.com>", | ||
"contributors": [ | ||
"Amaan Qureshi <amaanq12@gmail.com>" | ||
], | ||
"main": "bindings/node", | ||
"types": "bindings/node", | ||
"keywords": [ | ||
"parser", | ||
"lexer", | ||
"incremental", | ||
"parsing", | ||
"tree-sitter", | ||
"json" | ||
], | ||
"author": "Max Brunsfeld", | ||
"license": "MIT", | ||
"files": [ | ||
"grammar.js", | ||
"binding.gyp", | ||
"prebuilds/**", | ||
"bindings/node/*", | ||
"queries/*", | ||
"src/**" | ||
], | ||
"dependencies": { | ||
"nan": "^2.18.0" | ||
"node-addon-api": "^8.0.0", | ||
"node-gyp-build": "^4.8.0" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/tree-sitter/tree-sitter-json.git" | ||
"peerDependencies": { | ||
"tree-sitter": "^0.21.0" | ||
}, | ||
"peerDependenciesMeta": { | ||
"tree_sitter": { | ||
"optional": true | ||
} | ||
}, | ||
"devDependencies": { | ||
"eslint": ">=8.56.0", | ||
"eslint": "^8.57.0", | ||
"eslint-config-google": "^0.14.0", | ||
"tree-sitter-cli": "^0.20.8", | ||
"node-gyp": "^10.0.1" | ||
"tree-sitter-cli": "^0.22.2", | ||
"prebuildify": "^6.0.0" | ||
}, | ||
"scripts": { | ||
"build": "tree-sitter generate && node-gyp build", | ||
"install": "node-gyp-build", | ||
"prebuildify": "prebuildify --napi --strip", | ||
"build": "tree-sitter generate --no-bindings", | ||
"build-wasm": "tree-sitter build --wasm", | ||
"lint": "eslint grammar.js", | ||
"parse": "tree-sitter parse", | ||
"test": "tree-sitter test" | ||
@@ -37,7 +60,47 @@ }, | ||
], | ||
"highlights": [ | ||
"queries/highlights.scm" | ||
"highlights": "queries/highlights.scm" | ||
} | ||
], | ||
"eslintConfig": { | ||
"env": { | ||
"commonjs": true, | ||
"es2021": true | ||
}, | ||
"extends": "google", | ||
"parserOptions": { | ||
"ecmaVersion": "latest", | ||
"sourceType": "module" | ||
}, | ||
"rules": { | ||
"arrow-parens": "off", | ||
"camel-case": "off", | ||
"indent": [ | ||
"error", | ||
2, | ||
{ | ||
"SwitchCase": 1 | ||
} | ||
], | ||
"max-len": [ | ||
"error", | ||
{ | ||
"code": 160, | ||
"ignoreComments": true, | ||
"ignoreUrls": true, | ||
"ignoreStrings": true | ||
} | ||
], | ||
"spaced-comment": [ | ||
"warn", | ||
"always", | ||
{ | ||
"line": { | ||
"markers": [ | ||
"/" | ||
] | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} |
# tree-sitter-json | ||
[![CI](https://github.com/tree-sitter/tree-sitter-json/actions/workflows/ci.yml/badge.svg)](https://github.com/tree-sitter/tree-sitter-json/actions/workflows/ci.yml) | ||
[![CI][ci]](https://github.com/tree-sitter/tree-sitter-json/actions/workflows/ci.yml) | ||
[![discord][discord]](https://discord.gg/w7nTvsVJhm) | ||
[![matrix][matrix]](https://matrix.to/#/#tree-sitter-chat:matrix.org) | ||
[![crates][crates]](https://crates.io/crates/tree-sitter-json) | ||
[![npm][npm]](https://www.npmjs.com/package/tree-sitter-json) | ||
[![pypi][pypi]](https://pypi.org/project/tree-sitter-json) | ||
JSON grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter) | ||
[ci]: https://img.shields.io/github/actions/workflow/status/tree-sitter/tree-sitter-json/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/tree-sitter-json?logo=npm | ||
[crates]: https://img.shields.io/crates/v/tree-sitter-json?logo=rust | ||
[pypi]: https://img.shields.io/pypi/v/tree-sitter-json?logo=pypi&logoColor=ffd242 |
@@ -526,2 +526,1 @@ { | ||
} | ||
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 4 instances in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
347610
18
3
19
845
1
5
+ Addednode-addon-api@^8.0.0
+ Addednode-gyp-build@^4.8.0
+ Addednode-addon-api@8.2.1(transitive)
+ Addednode-gyp-build@4.8.2(transitive)
+ Addedtree-sitter@0.21.1(transitive)
- Removednan@^2.18.0
- Removednan@2.22.0(transitive)