tree-sitter-json
Advanced tools
Comparing version 0.19.0 to 0.20.0
@@ -5,3 +5,4 @@ module.exports = grammar({ | ||
extras: $ => [ | ||
/\s/ | ||
/\s/, | ||
$.comment, | ||
], | ||
@@ -52,3 +53,3 @@ | ||
'\\', | ||
/(\"|\\|\/|b|n|r|t|u)/ | ||
/(\"|\\|\/|b|f|n|r|t|u)/ | ||
)), | ||
@@ -63,3 +64,3 @@ | ||
const decimal_digits = /\d+/ | ||
const signed_integer = seq(optional(choice('-','+')), decimal_digits) | ||
const signed_integer = seq(optional(choice('-', '+')), decimal_digits) | ||
const exponent_part = seq(choice('e', 'E'), signed_integer) | ||
@@ -72,3 +73,3 @@ | ||
const decimal_integer_literal = seq( | ||
optional(choice('-','+')), | ||
optional(choice('-', '+')), | ||
choice( | ||
@@ -98,12 +99,21 @@ '0', | ||
null: $ => "null" | ||
null: $ => "null", | ||
comment: $ => token(choice( | ||
seq('//', /.*/), | ||
seq( | ||
'/*', | ||
/[^*]*\*+([^/*][^*]*\*+)*/, | ||
'/' | ||
) | ||
)), | ||
} | ||
}); | ||
function commaSep1 (rule) { | ||
function commaSep1(rule) { | ||
return seq(rule, repeat(seq(",", rule))) | ||
} | ||
function commaSep (rule) { | ||
function commaSep(rule) { | ||
return optional(commaSep1(rule)) | ||
} |
{ | ||
"name": "tree-sitter-json", | ||
"version": "0.19.0", | ||
"version": "0.20.0", | ||
"description": "JSON grammar for tree-sitter", | ||
@@ -5,0 +5,0 @@ "main": "bindings/node", |
tree-sitter-json | ||
=========================== | ||
[![Build Status](https://travis-ci.org/tree-sitter/tree-sitter-json.svg?branch=master)](https://travis-ci.org/tree-sitter/tree-sitter-json) | ||
[![Build/test](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) | ||
JSON grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter) |
@@ -232,3 +232,3 @@ { | ||
"type": "PATTERN", | ||
"value": "(\\\"|\\\\|\\/|b|n|r|t|u)" | ||
"value": "(\\\"|\\\\|\\/|b|f|n|r|t|u)" | ||
} | ||
@@ -647,2 +647,40 @@ ] | ||
"value": "null" | ||
}, | ||
"comment": { | ||
"type": "TOKEN", | ||
"content": { | ||
"type": "CHOICE", | ||
"members": [ | ||
{ | ||
"type": "SEQ", | ||
"members": [ | ||
{ | ||
"type": "STRING", | ||
"value": "//" | ||
}, | ||
{ | ||
"type": "PATTERN", | ||
"value": ".*" | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "SEQ", | ||
"members": [ | ||
{ | ||
"type": "STRING", | ||
"value": "/*" | ||
}, | ||
{ | ||
"type": "PATTERN", | ||
"value": "[^*]*\\*+([^/*][^*]*\\*+)*" | ||
}, | ||
{ | ||
"type": "STRING", | ||
"value": "/" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
@@ -654,2 +692,6 @@ }, | ||
"value": "\\s" | ||
}, | ||
{ | ||
"type": "SYMBOL", | ||
"name": "comment" | ||
} | ||
@@ -656,0 +698,0 @@ ], |
@@ -162,2 +162,6 @@ [ | ||
{ | ||
"type": "comment", | ||
"named": true | ||
}, | ||
{ | ||
"type": "escape_sequence", | ||
@@ -164,0 +168,0 @@ "named": true |
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
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
66576
18
1004