tree-sitter-javascript
Advanced tools
Comparing version 0.20.3 to 0.20.4
@@ -22,5 +22,6 @@ /** | ||
'||', | ||
// We use escape sequence to tell the scanner if we're currently inside a string or template string, in which case | ||
// We use escape sequence and regex pattern to tell the scanner if we're currently inside a string or template string, in which case | ||
// it should NOT parse html comments. | ||
$.escape_sequence, | ||
$.regex_pattern, | ||
], | ||
@@ -373,3 +374,3 @@ | ||
do_statement: $ => seq( | ||
do_statement: $ => prec.right(seq( | ||
'do', | ||
@@ -379,3 +380,4 @@ field('body', $.statement), | ||
field('condition', $.parenthesized_expression), | ||
), | ||
optional($._semicolon), | ||
)), | ||
@@ -720,6 +722,6 @@ try_statement: $ => seq( | ||
// | ||
unescaped_double_jsx_string_fragment: _ => token.immediate(prec(1, /[^"&]+/)), | ||
unescaped_double_jsx_string_fragment: _ => token.immediate(prec(1, /([^"&]|&[^#A-Za-z])+/)), | ||
// same here | ||
unescaped_single_jsx_string_fragment: _ => token.immediate(prec(1, /[^'&]+/)), | ||
unescaped_single_jsx_string_fragment: _ => token.immediate(prec(1, /([^'&]|&[^#A-Za-z])+/)), | ||
@@ -988,3 +990,3 @@ _jsx_attribute_value: $ => choice( | ||
/u[0-9a-fA-F]{4}/, | ||
/u{[0-9a-fA-F]+}/, | ||
/u\{[0-9a-fA-F]+\}/, | ||
/[\r?][\n\u2028\u2029]/, | ||
@@ -1025,3 +1027,3 @@ ), | ||
field('pattern', $.regex_pattern), | ||
token.immediate('/'), | ||
token.immediate(prec(1, '/')), | ||
optional(field('flags', $.regex_flags)), | ||
@@ -1028,0 +1030,0 @@ ), |
{ | ||
"name": "tree-sitter-javascript", | ||
"version": "0.20.3", | ||
"version": "0.20.4", | ||
"description": "JavaScript grammar for tree-sitter", | ||
@@ -9,3 +9,3 @@ "main": "bindings/node", | ||
"lexer", | ||
"javascript" | ||
"javascript" | ||
], | ||
@@ -22,5 +22,5 @@ "repository": { | ||
"devDependencies": { | ||
"eslint": "^8.56.0", | ||
"eslint": "^8.57.0", | ||
"eslint-config-google": "^0.14.0", | ||
"tree-sitter-cli": "^0.20.8" | ||
"tree-sitter-cli": "^0.21.0" | ||
}, | ||
@@ -41,6 +41,9 @@ "scripts": { | ||
"highlights": [ | ||
"queries/highlights.scm", | ||
"queries/highlights-jsx.scm", | ||
"queries/highlights-params.scm", | ||
"queries/highlights.scm" | ||
"queries/highlights-params.scm" | ||
], | ||
"tags": [ | ||
"queries/tags.scm" | ||
], | ||
"injection-regex": "^(js|javascript)$" | ||
@@ -47,0 +50,0 @@ } |
# tree-sitter-javascript | ||
[![CI](https://github.com/tree-sitter/tree-sitter-javascript/actions/workflows/ci.yml/badge.svg)](https://github.com/tree-sitter/tree-sitter-javascript/actions/workflows/ci.yml) | ||
[![CI][ci]](https://github.com/tree-sitter/tree-sitter-javascript/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-javascript) | ||
[![npm][npm]](https://www.npmjs.com/package/tree-sitter-javascript) | ||
@@ -14,1 +18,7 @@ JavaScript and JSX grammar for [tree-sitter][]. For TypeScript, see [tree-sitter-typescript][]. | ||
- [The ECMAScript 2015 Spec](http://www.ecma-international.org/ecma-262/6.0/) | ||
[ci]: https://img.shields.io/github/actions/workflow/status/tree-sitter/tree-sitter-javascript/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-javascript?logo=npm | ||
[crates]: https://img.shields.io/crates/v/tree-sitter-javascript?logo=rust |
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 not supported yet
Sorry, the diff of this file is not supported yet
4999171
33
11663
24