tree-sitter-c
Advanced tools
Comparing version 0.21.0 to 0.21.3
/** | ||
* @file C 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" /> | ||
@@ -733,5 +731,3 @@ // @ts-check | ||
variadic_parameter: _ => seq( | ||
'...', | ||
), | ||
variadic_parameter: _ => '...', | ||
@@ -1379,20 +1375,10 @@ parameter_list: $ => seq( | ||
*/ | ||
function elseBlock($) { | ||
function alternativeBlock($) { | ||
return choice( | ||
suffix ? alias($['preproc_else' + suffix], $.preproc_else) : $.preproc_else, | ||
suffix ? alias($['preproc_elif' + suffix], $.preproc_elif) : $.preproc_elif, | ||
suffix ? alias($['preproc_elifdef' + suffix], $.preproc_elifdef) : $.preproc_elifdef, | ||
); | ||
} | ||
/** | ||
* | ||
* @param {GrammarSymbols<string>} $ | ||
* | ||
* @return {AliasRule | SymbolRule<string>} | ||
* | ||
*/ | ||
function elifBlock($) { | ||
return suffix ? alias($['preproc_elifdef' + suffix], $.preproc_elifdef) : $.preproc_elifdef; | ||
} | ||
return { | ||
@@ -1404,3 +1390,3 @@ ['preproc_if' + suffix]: $ => prec(precedence, seq( | ||
repeat(content($)), | ||
field('alternative', optional(elseBlock($))), | ||
field('alternative', optional(alternativeBlock($))), | ||
preprocessor('endif'), | ||
@@ -1413,3 +1399,3 @@ )), | ||
repeat(content($)), | ||
field('alternative', optional(choice(elseBlock($), elifBlock($)))), | ||
field('alternative', optional(alternativeBlock($))), | ||
preprocessor('endif'), | ||
@@ -1428,3 +1414,3 @@ )), | ||
repeat(content($)), | ||
field('alternative', optional(elseBlock($))), | ||
field('alternative', optional(alternativeBlock($))), | ||
)), | ||
@@ -1436,3 +1422,3 @@ | ||
repeat(content($)), | ||
field('alternative', optional(elseBlock($))), | ||
field('alternative', optional(alternativeBlock($))), | ||
)), | ||
@@ -1439,0 +1425,0 @@ }; |
{ | ||
"name": "tree-sitter-c", | ||
"version": "0.21.0", | ||
"version": "0.21.3", | ||
"description": "C grammar for tree-sitter", | ||
"repository": "github:tree-sitter/tree-sitter-bash", | ||
"repository": "github:tree-sitter/tree-sitter-c", | ||
"license": "MIT", | ||
@@ -13,2 +13,8 @@ "author": "Max Brunsfeld <maxbrunsfeld@gmail.com>", | ||
"types": "bindings/node", | ||
"keywords": [ | ||
"incremental", | ||
"parsing", | ||
"tree-sitter", | ||
"c" | ||
], | ||
"files": [ | ||
@@ -22,11 +28,5 @@ "grammar.js", | ||
], | ||
"keywords": [ | ||
"incremental", | ||
"parsing", | ||
"tree-sitter", | ||
"c" | ||
], | ||
"dependencies": { | ||
"node-addon-api": "^7.1.0", | ||
"node-gyp-build": "^4.8.0" | ||
"node-addon-api": "^8.0.0", | ||
"node-gyp-build": "^4.8.1" | ||
}, | ||
@@ -42,13 +42,15 @@ "peerDependencies": { | ||
"devDependencies": { | ||
"eslint": "^8.56.0", | ||
"eslint": "^8.57.0", | ||
"eslint-config-google": "^0.14.0", | ||
"tree-sitter-cli": "^0.21.0", | ||
"prebuildify": "^6.0.0" | ||
"prebuildify": "^6.0.1", | ||
"tree-sitter-cli": "^0.22.6" | ||
}, | ||
"scripts": { | ||
"install": "node-gyp-build", | ||
"prebuildify": "prebuildify --napi --strip", | ||
"build": "tree-sitter generate --no-bindings", | ||
"build-wasm": "tree-sitter build --wasm", | ||
"lint": "eslint grammar.js", | ||
"test": "tree-sitter test", | ||
"install": "node-gyp-build", | ||
"prebuildify": "prebuildify --napi --strip" | ||
"parse": "tree-sitter parse", | ||
"test": "tree-sitter test" | ||
}, | ||
@@ -66,3 +68,45 @@ "tree-sitter": [ | ||
} | ||
] | ||
], | ||
"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": [ | ||
"/" | ||
] | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} |
@@ -8,2 +8,3 @@ # tree-sitter-c | ||
[![npm][npm]](https://www.npmjs.com/package/tree-sitter-c) | ||
[![pypi][pypi]](https://pypi.org/project/tree-sitter-c) | ||
@@ -18,1 +19,2 @@ C grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter). | ||
[crates]: https://img.shields.io/crates/v/tree-sitter-c?logo=rust | ||
[pypi]: https://img.shields.io/pypi/v/tree-sitter-c?logo=pypi&logoColor=ffd242 |
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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
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
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
15433
19
6909524
- Removednode-addon-api@7.1.1(transitive)
Updatednode-addon-api@^8.0.0
Updatednode-gyp-build@^4.8.1