diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index cac0552..776e9b7 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -3,7 +3,7 @@ name: ci
on:
push:
branches:
- - '*'
+ - 'main'
tags-ignore:
- '*'
paths:
@@ -15,7 +15,7 @@ on:
- '.github/workflows/ci.yml'
pull_request:
branches:
- - '*'
+ - 'main'
paths:
- '**/syntax_test_*'
- '**/*.hidden-tmLanguage'
diff --git a/JSON/JSON (Basic).sublime-syntax b/JSON/JSON (Basic).sublime-syntax
deleted file mode 100644
index 0193a60..0000000
--- a/JSON/JSON (Basic).sublime-syntax
+++ /dev/null
@@ -1,388 +0,0 @@
-%YAML 1.2
----
-# YAML Documentation:
-# https://yaml.org/spec/1.2/spec.html
-# Sublime Text Documentation:
-# https://www.sublimetext.com/docs/syntax.html#ver-dev
-# https://www.sublimetext.com/docs/syntax.html#testing:ver-dev
-# https://www.sublimetext.com/docs/scope_naming.html
-# This file is being maintained at:
-# https://github.com/sublimehq/Packages/blob/master/JSON/JSON%20(Basic).sublime-syntax
-#
-name: JSON (Basic)
-scope: source.json.basic
-version: 2
-hidden: true
-
-
-variables:
- exponent: (?:[eE][-+]?\d+)
- pos_integer_decimal: (?:0|[1-9]\d*)
-
-
-contexts:
-
- prototype:
- - include: comments
-
- main:
- - match: '(?=\S)'
- push: top-level-expect-object
-
-####[ Top level ]#######################################################################################################
-
- # Try these below one-by-one.
-
- top-level-expect-object:
- - include: top-level-objects
- - match: ''
- push: top-level-expect-array
-
- top-level-expect-array:
- - include: arrays
- - match: ''
- push: top-level-expect-constant
-
- top-level-expect-constant:
- - include: constants
- - match: ''
- push: top-level-expect-number
-
- top-level-expect-number:
- - include: numbers
- - match: ''
- push: top-level-expect-string
-
- top-level-expect-string:
- - include: strings
- - match: ''
- push: top-level-expect-invalid-remainder
-
- top-level-expect-invalid-remainder:
- - match: ','
- scope: invalid.illegal.unexpected-separator.json
- - match: ':'
- scope: invalid.illegal.unexpected-separator.json
- - match: '\S*'
- scope: invalid.illegal.unexpected-code-after-first-structure-or-value.json
-
-####[ Structural helpers ]##############################################################################################
-
- any:
- - include: structures
- - include: values
-
- structures:
- - include: objects
- - include: arrays
-
- values:
- - include: constants
- - include: numbers
- - include: strings
-
-####[ Helpers ]#########################################################################################################
-
- eol-pop:
- - match: '$\n?'
- pop: 1
-
-####[ Comments ]########################################################################################################
-
- comments:
- - meta_include_prototype: false
- - include: comment-line
- - include: comment-doc-block
- - include: comment-block
-
- comment-line:
- - meta_include_prototype: false
- - match: '//'
- scope: invalid.illegal.comment.json
- push:
- - meta_include_prototype: false
- - meta_content_scope: invalid.illegal.comment.json
- - include: eol-pop
-
- comment-doc-block:
- - meta_include_prototype: false
- - match: '/\*\*(?!/)'
- scope: invalid.illegal.comment.json
- push:
- - meta_include_prototype: false
- - meta_content_scope: invalid.illegal.comment.json
- - include: comment-block-end
- - match: '^\s*(\*)(?!/)'
- captures:
- 1: invalid.illegal.comment.json
-
- comment-block:
- - meta_include_prototype: false
- - match: '/\*'
- scope: invalid.illegal.comment.json
- push:
- - meta_include_prototype: false
- - meta_content_scope: invalid.illegal.comment.json
- - include: comment-block-end
-
- comment-block-end:
- - meta_include_prototype: false
- - match: '\*/'
- scope: invalid.illegal.comment.json
- pop: 1
-
-####[ Constants ]#######################################################################################################
-
- constants:
- - match: \b(?:null)\b
- scope: constant.language.null.json
- - match: \b(?:false|true)\b
- scope: constant.language.boolean.json
- # when erroneously containing upper case letters
- - match: \b(?i:null)\b
- scope: invalid.illegal.expected-lower-case-null.json
- - match: \b(?i:false|true)\b
- scope: invalid.illegal.expected-lower-case-boolean.json
-
-####[ Numbers ]#########################################################################################################
-
- numbers:
- - include: floats
- - include: integers
-
- floats:
- - include: decimal-floats
-
- decimal-floats:
- - match: |-
- (?x:
- (?:(-)|(\+))?
- (
- {{pos_integer_decimal}}
- (?:
- # 1.1 1.1e1 1.1e-1 1.1e+1
- (\.)\d+ {{exponent}}?
- # 1e1 1+e1 1-e1
- | {{exponent}}
- )
- )
- )
- scope: meta.number.float.decimal.json
- captures:
- 1: constant.numeric.sign.json
- 2: invalid.illegal.numeric-sign.json
- 3: constant.numeric.value.json
- 4: punctuation.separator.decimal.json
-
- integers:
- - include: decimal-integers
-
- decimal-integers:
- - match: (?:(-)|(\+))?({{pos_integer_decimal}})
- scope: meta.number.integer.decimal.json
- captures:
- 1: constant.numeric.sign.json
- 2: invalid.illegal.numeric-sign.json
- 3: constant.numeric.value.json
-
-####[ Strings ]#########################################################################################################
-
- strings:
- - include: double-quoted-strings
-
- double-quoted-strings:
- - match: \"
- scope: punctuation.definition.string.begin.json
- push: inside-double-quoted-string
-
- inside-double-quoted-string:
- - meta_include_prototype: false
- - meta_scope: meta.string.json string.quoted.double.json
- - match: \"
- scope: punctuation.definition.string.end.json
- pop: 1
- - include: double-quoted-string-escape-characters
- - match: \n
- scope: invalid.illegal.unclosed-string.json
- pop: 1
-
- double-quoted-string-escape-characters:
- - meta_include_prototype: false
- - match: \\\"
- scope: constant.character.escape.double-quote.json
- - include: string-escape-characters
-
- string-escape-characters:
- - meta_include_prototype: false
- - include: valid-string-escape-characters
- - include: invalid-string-escape-characters
-
- valid-string-escape-characters:
- - meta_include_prototype: false
- - match: \\\\
- scope: constant.character.escape.back-slash.json
- - match: \\\/
- scope: constant.character.escape.forward-slash.json
- - match: \\b
- scope: constant.character.escape.backspace.json
- - match: \\f
- scope: constant.character.escape.form-feed.json
- - match: \\n
- scope: constant.character.escape.newline.json # linefeed
- - match: \\r
- scope: constant.character.escape.carriage-return.json
- - match: \\t
- scope: constant.character.escape.horizontal-tab.json
- - match: \\u[0-9a-fA-F]{4}
- scope: constant.character.escape.unicode-symbol.basic-multilingual-plane.json
-
- invalid-string-escape-characters:
- - meta_include_prototype: false
- - match: \\.
- scope: invalid.illegal.unrecognized-string-escape.json
-
-####[ Sequence ]########################################################################################################
-
- arrays:
- - include: empty-arrays
- - match: \[
- scope: punctuation.definition.sequence.begin.json
- push:
- - array-body
- - array-illegal-separator
-
- array-body:
- - meta_scope: meta.sequence.list.json
- - match: \]
- scope: punctuation.definition.sequence.end.json
- pop: 1
- - include: array-separators
- - include: any
- - match: '[^\s\]]'
- scope: invalid.illegal.expected-separator.json
-
- array-separators:
- - match: (?=,)
- branch_point: array-separators
- branch:
- - array-separator
- - array-illegal-separator
-
- array-separator:
- - match: ','
- scope: punctuation.separator.sequence.json
- set: array-expect-value
-
- array-expect-value:
- - match: (?=\])
- fail: array-separators
- - include: array-illegal-separator
-
- array-illegal-separator:
- - match: ','
- scope: invalid.illegal.unexpected-separator.json
- - match: (?=\S)
- pop: 1
-
- empty-arrays:
- - match: (\[)\s*(\])
- scope: meta.sequence.list.empty.json
- captures:
- 1: punctuation.definition.sequence.begin.json
- 2: punctuation.definition.sequence.end.json
-
-####[ Mapping ]#########################################################################################################
-
- # FIXME: leading separators
- # FIXME: trailing commas
-
- # The top-level contexts here are to ensure that we can apply `meta.toc-list`
- # to the top-level object keys to index them as symbols.
-
- top-level-objects:
- - include: empty-object
- - match: \{
- scope: punctuation.definition.mapping.begin.json
- push: top-level-meta-mapping
-
- objects:
- - include: empty-object
- - match: \{
- scope: punctuation.definition.mapping.begin.json
- push: meta-mapping
-
- empty-object:
- - match: (\{)\s*(\})
- scope: meta.mapping.empty.json
- captures:
- 1: punctuation.definition.mapping.begin.json
- 2: punctuation.definition.mapping.end.json
-
- top-level-meta-mapping:
- - meta_scope: meta.mapping.json
- - match: \}
- scope: punctuation.definition.mapping.end.json
- pop: 1
- - include: top-level-mapping-key
- - include: mapping-separator
- - match: '[^\s\}]'
- scope: invalid.illegal.expected-mapping-key.json
-
- meta-mapping:
- - meta_scope: meta.mapping.json
- - match: \}
- scope: punctuation.definition.mapping.end.json
- pop: 1
- - include: mapping-key
- - include: mapping-separator
- - match: '[^\s\}]'
- scope: invalid.illegal.expected-mapping-key.json
-
- top-level-mapping-key:
- - match: '"'
- scope: punctuation.definition.string.begin.json
- push: top-level-mapping-key-double-quoted
-
- mapping-key:
- - match: '"'
- scope: punctuation.definition.string.begin.json
- push: mapping-key-double-quoted
-
- top-level-mapping-key-double-quoted:
- - clear_scopes: 1
- - meta_include_prototype: false
- - meta_scope: meta.mapping.key.json meta.toc-list.json meta.string.json string.quoted.double.json
- - include: inside-double-quoted-string
-
- mapping-key-double-quoted:
- - clear_scopes: 1
- - meta_include_prototype: false
- - meta_scope: meta.mapping.key.json meta.string.json string.quoted.double.json
- - include: inside-double-quoted-string
-
- mapping-separator:
- - match: ':'
- scope: punctuation.separator.mapping.key-value.json
- push: mapping-expect-value
-
- mapping-expect-value:
- - match: ',|\s?(?=\})'
- scope: invalid.illegal.expected-mapping-value.json
- pop: 1
- - match: (?=\S)
- set: mapping-value
-
- mapping-value:
- - clear_scopes: 1
- - meta_scope: meta.mapping.value.json
- - include: any
- - match: ''
- set:
- - match: ','
- scope: punctuation.separator.mapping.pair.json
- pop: 1
- - match: \s*(?=\})
- pop: 1
- - match: \s(?!/[/*])(?=[^\s,])|[^\s,]
- scope: invalid.illegal.expected-mapping-separator.json
- pop: 1
diff --git a/JSON/JSON.sublime-syntax b/JSON/JSON.sublime-syntax
index 903c25e..faf6296 100644
--- a/JSON/JSON.sublime-syntax
+++ b/JSON/JSON.sublime-syntax
@@ -13,9 +13,6 @@ name: JSON
scope: source.json
version: 2
-# https://www.sublimetext.com/docs/syntax.html#inheritance
-extends: 'Packages/JSON/JSON (Basic).sublime-syntax'
-
file_extensions:
- json
# https://www.json.org/json-en.html
@@ -128,3 +125,279 @@ first_line_match: |-
(?xi:
^ \s* // .*? -\*- .*? \bjson\b .*? -\*- # editorconfig
)
+
+variables:
+ exponent: (?:[eE][-+]?\d+)
+ pos_integer_decimal: (?:0|[1-9]\d*)
+
+
+contexts:
+
+ prototype:
+ - include: comments
+
+ main:
+ - match: (?=\S)
+ push:
+ - invalid-remainder
+ - any-value
+
+####[ Top level ]#######################################################################################################
+
+ any-value:
+ - include: any
+ - include: else-pop
+
+ any:
+ - include: object
+ - include: array
+ - include: constant
+ - include: number
+ - include: string
+
+ invalid-remainder:
+ - match: '[,:]'
+ scope: invalid.illegal.unexpected-separator.json
+ - match: '[^,:\s]+'
+ scope: invalid.illegal.unexpected-code-after-first-structure-or-value.json
+
+####[ Comments ]########################################################################################################
+
+ comments:
+ - include: comment-line
+ - include: comment-block
+
+ comment-line:
+ - match: //.*$\n?
+ scope: invalid.illegal.comment.json
+
+ comment-block:
+ - match: /\*
+ push: comment-block-content
+
+ comment-block-content:
+ - meta_include_prototype: false
+ - meta_scope: invalid.illegal.comment.json
+ - match: \*/
+ pop: 1
+
+####[ Constants ]#######################################################################################################
+
+ constant:
+ - match: \b(?:null)\b
+ scope: constant.language.null.json
+ pop: 1
+ - match: \b(?:false|true)\b
+ scope: constant.language.boolean.json
+ pop: 1
+ # when erroneously containing upper case letters
+ - match: \b(?i:null)\b
+ scope: invalid.illegal.expected-lower-case-null.json
+ pop: 1
+ - match: \b(?i:false|true)\b
+ scope: invalid.illegal.expected-lower-case-boolean.json
+ pop: 1
+
+####[ Numbers ]#########################################################################################################
+
+ number:
+ - include: float
+ - include: integer
+
+ float:
+ - include: decimal-float
+
+ decimal-float:
+ - match: |-
+ (?x:
+ (?:(-)|(\+))?
+ (
+ {{pos_integer_decimal}}
+ (?:
+ # 1.1 1.1e1 1.1e-1 1.1e+1
+ (\.)\d+ {{exponent}}?
+ # 1e1 1+e1 1-e1
+ | {{exponent}}
+ )
+ )
+ )
+ scope: meta.number.float.decimal.json
+ captures:
+ 1: constant.numeric.sign.json
+ 2: invalid.illegal.numeric-sign.json
+ 3: constant.numeric.value.json
+ 4: punctuation.separator.decimal.json
+ pop: 1
+
+ integer:
+ - include: decimal-integer
+
+ decimal-integer:
+ - match: (?:(-)|(\+))?({{pos_integer_decimal}})
+ scope: meta.number.integer.decimal.json
+ captures:
+ 1: constant.numeric.sign.json
+ 2: invalid.illegal.numeric-sign.json
+ 3: constant.numeric.value.json
+ pop: 1
+
+####[ Strings ]#########################################################################################################
+
+ string:
+ - include: double-quoted-string
+
+ double-quoted-string:
+ - match: \"
+ scope: punctuation.definition.string.begin.json
+ set: double-quoted-string-content
+
+ double-quoted-string-content:
+ - meta_include_prototype: false
+ - meta_scope: meta.string.json string.quoted.double.json
+ - match: \"
+ scope: punctuation.definition.string.end.json
+ pop: 1
+ - include: double-quoted-string-escape-characters
+ - match: \n
+ scope: invalid.illegal.unclosed-string.json
+ pop: 1
+
+ double-quoted-string-escape-characters:
+ - match: \\\"
+ scope: constant.character.escape.double-quote.json
+ - include: string-escape-characters
+
+ string-escape-characters:
+ - include: valid-string-escape-characters
+ - include: invalid-string-escape-characters
+
+ valid-string-escape-characters:
+ - match: \\\\
+ scope: constant.character.escape.back-slash.json
+ - match: \\\/
+ scope: constant.character.escape.forward-slash.json
+ - match: \\b
+ scope: constant.character.escape.backspace.json
+ - match: \\f
+ scope: constant.character.escape.form-feed.json
+ - match: \\n
+ scope: constant.character.escape.newline.json # linefeed
+ - match: \\r
+ scope: constant.character.escape.carriage-return.json
+ - match: \\t
+ scope: constant.character.escape.horizontal-tab.json
+ - match: \\u[0-9a-fA-F]{4}
+ scope: constant.character.escape.unicode-symbol.basic-multilingual-plane.json
+
+ invalid-string-escape-characters:
+ - match: \\.
+ scope: invalid.illegal.unrecognized-string-escape.json
+
+####[ Sequence ]########################################################################################################
+
+ array:
+ - match: \[
+ scope: punctuation.definition.sequence.begin.json
+ set:
+ - array-body
+ - array-item
+
+ array-body:
+ - meta_scope: meta.sequence.list.json
+ - match: \]
+ scope: punctuation.definition.sequence.end.json
+ pop: 1
+ - include: array-separators
+
+ array-separators:
+ - match: (?=,)
+ branch_point: array-separators
+ branch:
+ - array-separator
+ - illegal-separator
+ - match: (?=\S)
+ push: array-item
+
+ array-separator:
+ - match: ','
+ scope: punctuation.separator.sequence.json
+ set: array-expect-value
+
+ array-expect-value:
+ - match: (?=\])
+ fail: array-separators
+ - include: array-item
+
+ array-item:
+ - include: any
+ - include: illegal-separator
+
+####[ Mapping ]#########################################################################################################
+
+ # FIXME: leading separators
+ # FIXME: trailing commas
+
+ object:
+ - match: \{
+ scope: punctuation.definition.mapping.begin.json
+ set: object-body
+
+ object-body:
+ - meta_scope: meta.mapping.json
+ - match: \}
+ scope: punctuation.definition.mapping.end.json
+ pop: 1
+ - include: mapping-key
+ - include: mapping-separator
+ - match: '[^\s\}]'
+ scope: invalid.illegal.expected-mapping-key.json
+
+ mapping-key:
+ - match: \"
+ scope: punctuation.definition.string.begin.json
+ push: mapping-key-double-quoted
+
+ mapping-key-double-quoted:
+ - clear_scopes: 1
+ - meta_include_prototype: false
+ - meta_scope: meta.mapping.key.json meta.string.json string.quoted.double.json
+ - include: double-quoted-string-content
+
+ mapping-separator:
+ - match: ':'
+ scope: punctuation.separator.mapping.key-value.json
+ push: mapping-expect-value
+
+ mapping-expect-value:
+ - match: ',|\s?(?=\})'
+ scope: invalid.illegal.expected-mapping-value.json
+ pop: 1
+ - match: (?=\S)
+ set:
+ - mapping-value
+ - any-value
+
+ mapping-value:
+ - clear_scopes: 1
+ - meta_scope: meta.mapping.value.json
+ - match: ','
+ scope: punctuation.separator.mapping.pair.json
+ pop: 1
+ - match: \s*(?=\})
+ pop: 1
+ - match: \s(?!/[/*])(?=[^\s,])|[^\s,]
+ scope: invalid.illegal.expected-mapping-separator.json
+ pop: 1
+
+####[ Illegals ]########################################################################################################
+
+ illegal-separator:
+ - match: ','
+ scope: invalid.illegal.unexpected-separator.json
+ - include: else-pop
+
+####[ Prototypes ]######################################################################################################
+
+ else-pop:
+ - match: (?=\S)
+ pop: 1
diff --git a/JSON/JSON5.sublime-syntax b/JSON/JSON5.sublime-syntax
index a8b4001..ffa3114 100644
--- a/JSON/JSON5.sublime-syntax
+++ b/JSON/JSON5.sublime-syntax
@@ -90,8 +90,7 @@ contexts:
####[ Numbers ]#########################################################################################################
- # completely override original context
- decimal-floats:
+ decimal-float:
- match: |-
(?x:
([-+]?)
@@ -113,49 +112,53 @@ contexts:
2: constant.numeric.value.json5
3: punctuation.separator.decimal.json5
4: punctuation.separator.decimal.json5
+ pop: 1
- match: ([-+]?)(Infinity)
scope: meta.number.float.decimal.json5
captures:
1: constant.numeric.sign.json5
2: constant.language.infinity.json5
+ pop: 1
- match: ([-+]?)(NaN)
scope: meta.number.float.decimal.json5
captures:
1: constant.numeric.sign.json5
2: constant.language.nan.json5
+ pop: 1
- integers:
+ integer:
- meta_prepend: true
- - include: hexadecimal-integers
+ - include: hexadecimal-integer
- # completely override original context
- decimal-integers:
+ decimal-integer:
- match: ([-+]?)({{pos_integer_decimal}})
scope: meta.number.integer.decimal.json5
captures:
1: constant.numeric.sign.json5
2: constant.numeric.value.json5
+ pop: 1
- hexadecimal-integers:
+ hexadecimal-integer:
- match: ([-+]?)(0[xX])(\h+)
scope: meta.number.integer.hexadecimal.json5
captures:
1: constant.numeric.sign.json5
2: constant.numeric.base.json5
3: constant.numeric.value.json5
+ pop: 1
####[ Strings ]#########################################################################################################
- strings:
+ string:
- meta_append: true
- - include: single-quoted-strings
+ - include: single-quoted-string
- single-quoted-strings:
+ single-quoted-string:
- match: \'
scope: punctuation.definition.string.begin.json5
- push: inside-single-quoted-string
+ set: single-quoted-string-content
- inside-single-quoted-string:
+ single-quoted-string-content:
- meta_include_prototype: false
- meta_scope: meta.string.json5 string.quoted.single.json5
- match: \'
@@ -167,25 +170,23 @@ contexts:
pop: 1
single-quoted-string-escape-characters:
- - meta_include_prototype: false
- match: \\\'
scope: constant.character.escape.single-quote.json5
- include: string-escape-characters
valid-string-escape-characters:
- meta_prepend: true
- - meta_include_prototype: false
- - match: ((\\)\x{2028})(?:(.*)(?:$\n))
+ - match: ((\\)\x{2028})(.*)$\n?
captures:
1: constant.character.escape.line-separator.json5
2: punctuation.separator.continuation.line.json5
3: invalid.illegal.expected-eol-after-line-continuation.json5
- - match: ((\\)\x{2029})(?:(.*)(?:$\n))
+ - match: ((\\)\x{2029})(.*)$\n?
captures:
1: constant.character.escape.paragraph-separator.json5
2: punctuation.separator.continuation.line.json5
3: invalid.illegal.expected-eol-after-line-continuation.json5
- - match: '(\\)(?:$\n)'
+ - match: (\\)$\n?
captures:
1: punctuation.separator.continuation.line.json5
- match: \\v
@@ -201,54 +202,29 @@ contexts:
invalid-string-escape-characters:
- meta_prepend: true
- - meta_include_prototype: false
- match: ([^\\])(?:\x{2028}|\x{2029})
captures:
1: invalid.illegal.expected-backslash-char.json5
####[ Mapping ]#########################################################################################################
- # The top-level contexts here are to ensure that we can apply `meta.toc-list`
- # to the top-level object keys to index them as symbols.
-
- top-level-mapping-key:
- - meta_append: true
- - match: '(?={{identifier_name}})'
- push: top-level-mapping-key-ecma
- - match: "'"
- scope: punctuation.definition.string.begin.json5
- push: top-level-mapping-key-single-quoted
-
- top-level-mapping-key-ecma:
- - clear_scopes: 1
- - meta_include_prototype: false
- - match: '{{identifier_name}}'
- scope: meta.mapping.key.json5 meta.toc-list.json5 meta.string.json5 string.unquoted.plain.json5
- pop: 1
-
- top-level-mapping-key-single-quoted:
- - clear_scopes: 1
- - meta_include_prototype: false
- - meta_scope: meta.mapping.key.json5 meta.toc-list.json5 meta.string.json5 string.quoted.single.json5
- - include: inside-single-quoted-string
-
mapping-key:
- meta_append: true
- - match: "'"
+ - match: \'
scope: punctuation.definition.string.begin.json5
push: mapping-key-single-quoted
- - match: '(?={{identifier_name}})'
+ - match: (?={{identifier_start}})
push: mapping-key-ecma
mapping-key-ecma:
- clear_scopes: 1
- meta_include_prototype: false
- - match: '{{identifier_name}}'
- scope: meta.mapping.key.json5 meta.string.json5 string.unquoted.plain.json5
+ - meta_scope: meta.mapping.key.json5 meta.string.json5 string.unquoted.plain.json5
+ - match: '{{identifier_break}}'
pop: 1
mapping-key-single-quoted:
- clear_scopes: 1
- meta_include_prototype: false
- meta_scope: meta.mapping.key.json5 meta.string.json5 string.quoted.single.json5
- - include: inside-single-quoted-string
+ - include: single-quoted-string-content
diff --git a/JSON/JSONC.sublime-syntax b/JSON/JSONC.sublime-syntax
index 58b4556..bd1b071 100644
--- a/JSON/JSONC.sublime-syntax
+++ b/JSON/JSONC.sublime-syntax
@@ -106,50 +106,43 @@ contexts:
####[ Comments ]########################################################################################################
- # completely override original context
comment-line:
- - meta_include_prototype: false
- - match: '//'
- scope: punctuation.definition.comment.jsonc
- push:
- - meta_include_prototype: false
- - meta_scope: comment.line.double-slash.jsonc
- - include: eol-pop
-
- # completely override original context
+ - match: (//).*$\n?
+ scope: comment.line.double-slash.jsonc
+ captures:
+ 1: punctuation.definition.comment.jsonc
+
comment-doc-block:
- - meta_include_prototype: false
- - match: '/\*\*(?!/)'
+ - match: /\*\*(?!/)
scope: punctuation.definition.comment.begin.jsonc
- push:
- - meta_include_prototype: false
- - meta_scope: comment.block.documentation.jsonc
- - include: comment-block-end
- - match: '^\s*(\*)(?!/)'
- captures:
- 1: punctuation.definition.comment.jsonc
-
- # completely override original context
- comment-block:
+ push: comment-doc-block-content
+
+ comment-doc-block-content:
- meta_include_prototype: false
- - match: '/\*'
+ - meta_scope: comment.block.documentation.jsonc
+ - include: comment-block-end
+ - match: ^\s*(\*)(?!/)
+ captures:
+ 1: punctuation.definition.comment.jsonc
+
+ comment-block:
+ - match: /\*
scope: punctuation.definition.comment.begin.jsonc
- push:
- - meta_include_prototype: false
- - meta_scope: comment.block.jsonc
- - include: comment-block-end
+ push: comment-block-content
- # completely override original context
- comment-block-end:
+ comment-block-content:
- meta_include_prototype: false
- - match: '\*/'
+ - meta_scope: comment.block.jsonc
+ - include: comment-block-end
+
+ comment-block-end:
+ - match: \*/
scope: punctuation.definition.comment.end.jsonc
pop: 1
####[ Sequence ]########################################################################################################
- # completely override original context
array-separators:
- match: ','
scope: punctuation.separator.sequence.jsonc
- push: array-illegal-separator
+ push: array-item
diff --git a/JSON/Symbol List - JSON.tmPreferences b/JSON/Symbol List - JSON.tmPreferences
deleted file mode 100644
index 141613f..0000000
--- a/JSON/Symbol List - JSON.tmPreferences
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
- scopemeta.toc-list.json
- settings
-
- showInSymbolList1
- showInIndexedSymbolList1
-
-
-
diff --git a/JSON/Symbol List - JSON5.tmPreferences b/JSON/Symbol List - JSON5.tmPreferences
deleted file mode 100644
index facdefa..0000000
--- a/JSON/Symbol List - JSON5.tmPreferences
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
- scopemeta.toc-list.json5 | meta.toc-list.json
- settings
-
- showInSymbolList1
- showInIndexedSymbolList1
-
-
-
diff --git a/JSON/Symbol List.tmPreferences b/JSON/Symbol List.tmPreferences
new file mode 100644
index 0000000..11777e7
--- /dev/null
+++ b/JSON/Symbol List.tmPreferences
@@ -0,0 +1,14 @@
+
+
+
+ scope
+ source.json meta.mapping.key - meta.mapping meta.mapping
+ settings
+
+ showInSymbolList
+ 1
+ showInIndexedSymbolList
+ 1
+
+
+
diff --git a/JSON/tests/symbols/syntax_test_symbols.json b/JSON/tests/symbols/syntax_test_symbols.json
index 102c67d..8e69c6e 100644
--- a/JSON/tests/symbols/syntax_test_symbols.json
+++ b/JSON/tests/symbols/syntax_test_symbols.json
@@ -4,12 +4,8 @@
{
"key": "value",
-// ^^^^^ meta.toc-list.json
// @@@@@ definition
"key-two": { "key-two-one": "value", "key-two-two": "value" }
-// ^^^^^^^^^ meta.toc-list.json
-// ^^^^^^^^^^^^^ - meta.toc-list.json
-// ^^^^^^^^^^^^^ - meta.toc-list.json
// @@@@@@@@@ definition
}
diff --git a/JSON/tests/symbols/syntax_test_symbols.json5 b/JSON/tests/symbols/syntax_test_symbols.json5
index 6946b6a..0b5fd7a 100644
--- a/JSON/tests/symbols/syntax_test_symbols.json5
+++ b/JSON/tests/symbols/syntax_test_symbols.json5
@@ -4,34 +4,23 @@
{
_keyOne: "value",
-// ^^^^^^^ meta.toc-list.json5
// @@@@@@@ definition
$keyTwo: "value",
-// ^^^^^^^ meta.toc-list.json5
// @@@@@@@ definition
\u1234keyThree: "value",
-// ^^^^^^^^^^^^^^ meta.toc-list.json5
// @@@@@@@@@@@@@@ definition
"key-four": "value",
-// ^^^^^^^^^^ meta.toc-list.json
// @@@@@@@@@@ definition
'key-five': 'value',
-// ^^^^^^^^^^ meta.toc-list.json5
// @@@@@@@@@@ definition
"key-six": { "key-three-one": "value", "key-three-two": "value" },
-// ^^^^^^^^^ meta.toc-list.json
-// ^^^^^^^^^^^^^^^ - meta.toc-list.json
-// ^^^^^^^^^^^^^^^ - meta.toc-list.json
// @@@@@@@@@ definition
'key-seven': { 'key-four-one': 'value', 'key-four-two': 'value' }
-// ^^^^^^^^^^^ meta.toc-list.json5
-// ^^^^^^^^^^^^^^ - meta.toc-list.json5
-// ^^^^^^^^^^^^^^ - meta.toc-list.json5
// @@@@@@@@@@@ definition
}
diff --git a/JSON/tests/symbols/syntax_test_symbols.jsonc b/JSON/tests/symbols/syntax_test_symbols.jsonc
index 1bbb9c7..bdc39b9 100644
--- a/JSON/tests/symbols/syntax_test_symbols.jsonc
+++ b/JSON/tests/symbols/syntax_test_symbols.jsonc
@@ -4,12 +4,8 @@
{
"key": "value",
-// ^^^^^ meta.toc-list.json
// @@@@@ definition
"key-two": { "key-two-one": "value", "key-two-two": "value" }
-// ^^^^^^^^^ meta.toc-list.json
-// ^^^^^^^^^^^^^ - meta.toc-list.json
-// ^^^^^^^^^^^^^ - meta.toc-list.json
// @@@@@@@@@ definition
}
diff --git a/JSON/tests/syntax/syntax_test_json.invalid.toplevel-objects.json b/JSON/tests/syntax/syntax_test_json.invalid.toplevel-objects.json
new file mode 100644
index 0000000..e7f93f6
--- /dev/null
+++ b/JSON/tests/syntax/syntax_test_json.invalid.toplevel-objects.json
@@ -0,0 +1,7 @@
+// SYNTAX TEST "Packages/JSON/JSON.sublime-syntax"
+
+{ }{ }
+// <- meta.mapping.json punctuation.definition.mapping.begin.json
+//^ meta.mapping.json punctuation.definition.mapping.end.json
+// ^ invalid.illegal.unexpected-code-after-first-structure-or-value.json
+// ^ invalid.illegal.unexpected-code-after-first-structure-or-value.json
diff --git a/JSON/tests/syntax/syntax_test_json.invalid.toplevel-strings.json b/JSON/tests/syntax/syntax_test_json.invalid.toplevel-strings.json
new file mode 100644
index 0000000..b1592a4
--- /dev/null
+++ b/JSON/tests/syntax/syntax_test_json.invalid.toplevel-strings.json
@@ -0,0 +1,6 @@
+// SYNTAX TEST "Packages/JSON/JSON.sublime-syntax"
+
+"string""string"
+// <- meta.string.json string.quoted.double.json punctuation.definition.string.begin.json
+//^^^^^^ meta.string.json string.quoted.double.json
+// ^^^^^^^^ invalid.illegal.unexpected-code-after-first-structure-or-value.json
diff --git a/JSON/tests/syntax/syntax_test_json.meta.sequence.json b/JSON/tests/syntax/syntax_test_json.meta.sequence.json
new file mode 100644
index 0000000..ffda6d5
--- /dev/null
+++ b/JSON/tests/syntax/syntax_test_json.meta.sequence.json
@@ -0,0 +1,54 @@
+// SYNTAX TEST "Packages/JSON/JSON.sublime-syntax"
+
+// <- source.json
+
+
+[
+// <- meta.sequence.list punctuation.definition.sequence.begin
+
+ true,
+// ^^^^ constant.language.boolean
+
+ false,
+// ^^^^^ constant.language.boolean
+
+ null,
+// ^^^^ constant.language.null
+
+ 0,
+// ^ meta.number.integer.decimal constant.numeric.value
+
+ 0.0,
+// ^^^ meta.number.float.decimal constant.numeric.value
+
+ "value",
+// ^^^^^^^ string.quoted.double
+
+ [],
+// ^^ meta.sequence.list
+
+ [ ],
+// ^^^ meta.sequence.list
+
+ [1, 2, 3],
+// ^^^^^^^^^ meta.sequence.list
+// ^ punctuation.definition.sequence.begin
+// ^ constant.numeric.value
+// ^ punctuation.separator.sequence
+// ^ constant.numeric.value
+// ^ punctuation.separator.sequence
+// ^ constant.numeric.value
+// ^ punctuation.definition.sequence.end
+// ^ punctuation.separator.sequence
+
+ {},
+// ^^ meta.mapping
+
+ { },
+// ^^^ meta.mapping
+
+ { "a": 1, "b": 2, "c": 3 }
+// ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping
+
+]
+// <- meta.sequence.list punctuation.definition.sequence.end
diff --git a/JSON/tests/syntax/syntax_test_json5.comment.json5 b/JSON/tests/syntax/syntax_test_json5.comment.json5
index 50a752e..526c19e 100644
--- a/JSON/tests/syntax/syntax_test_json5.comment.json5
+++ b/JSON/tests/syntax/syntax_test_json5.comment.json5
@@ -10,21 +10,6 @@
// ^ - punctuation.definition.string.begin
// ^ - punctuation.definition.string.end
- /** comment 'not a string' */
-// ^^^ comment.block.documentation punctuation.definition.comment.begin
-// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.block.documentation
-// ^^^^^^^^^^^^^^ - meta.string string.quoted.single
-// ^ - punctuation.definition.string.begin
-// ^ - punctuation.definition.string.end
-// ^^ comment.block.documentation punctuation.definition.comment.end
-
- /** comment
- 'not a string' */
-// ^^^^^^^^^^^^^^ - meta.string string.quoted.single
-// ^ - punctuation.definition.string.begin
-// ^ - punctuation.definition.string.end
-// ^^ comment.block.documentation punctuation.definition.comment.end
-
/* comment 'not a string' */
// ^^ comment.block punctuation.definition.comment.begin
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.block
diff --git a/JSON/tests/syntax/syntax_test_json5.meta.mapping.json5 b/JSON/tests/syntax/syntax_test_json5.meta.mapping.json5
index d75c600..242143b 100644
--- a/JSON/tests/syntax/syntax_test_json5.meta.mapping.json5
+++ b/JSON/tests/syntax/syntax_test_json5.meta.mapping.json5
@@ -8,7 +8,6 @@
_identifierOne: null,
// ^^^^^^^^^^^^^^ meta.mapping.key
// ^^^^^^^^^^^^^^ - meta.mapping meta.mapping.key
-// ^^^^^^^^^^^^^^ meta.toc-list
// ^^^^^^^^^^^^^^ meta.string string.unquoted.plain
// ^ meta.mapping punctuation.separator.mapping.key-value
// ^^^^ meta.mapping.value
@@ -17,7 +16,6 @@
$identifierTwo: null,
// ^^^^^^^^^^^^^^ meta.mapping.key
// ^^^^^^^^^^^^^^ - meta.mapping meta.mapping.key
-// ^^^^^^^^^^^^^^ meta.toc-list
// ^^^^^^^^^^^^^^ meta.string string.unquoted.plain
// ^ meta.mapping punctuation.separator.mapping.key-value
// ^^^^ meta.mapping.value
@@ -26,7 +24,6 @@
\u1234abc: null,
// ^^^^^^^^^ meta.mapping.key
// ^^^^^^^^^ - meta.mapping meta.mapping.key
-// ^^^^^^^^^ meta.toc-list
// ^^^^^^^^^ meta.string string.unquoted.plain
// ^ meta.mapping punctuation.separator.mapping.key-value
// ^^^^ meta.mapping.value
@@ -35,7 +32,6 @@
'meta-mapping-value-constant': null,
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.key
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.mapping meta.mapping.key
-// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.toc-list
// ^ meta.mapping punctuation.separator.mapping.key-value
// ^^^^ meta.mapping.value
// ^^^^ - meta.mapping meta.mapping.value
@@ -43,7 +39,6 @@
'meta-mapping-value-number': 0,
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.key
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.mapping meta.mapping.key
-// ^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.toc-list
// ^ meta.mapping punctuation.separator.mapping.key-value
// ^ meta.mapping.value
// ^ - meta.mapping meta.mapping.value
@@ -51,7 +46,6 @@
'meta-mapping-value-string': "value",
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.key
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.mapping meta.mapping.key
-// ^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.toc-list
// ^ meta.mapping punctuation.separator.mapping.key-value
// ^^^^^^^ meta.mapping.value
// ^^^^^^^ - meta.mapping meta.mapping.value
@@ -59,7 +53,6 @@
'meta-mapping-value-string': 'value',
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.key
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.mapping meta.mapping.key
-// ^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.toc-list
// ^ meta.mapping punctuation.separator.mapping.key-value
// ^^^^^^^ meta.mapping.value
// ^^^^^^^ - meta.mapping meta.mapping.value
@@ -67,29 +60,26 @@
'meta-mapping-value-sequence-empty': [],
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.key
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.mapping meta.mapping.key
-// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.toc-list
// ^ meta.mapping punctuation.separator.mapping.key-value
// ^^ meta.mapping.value
// ^^ - meta.mapping meta.mapping.value
-// ^^ meta.mapping.value meta.sequence.list.empty
+// ^^ meta.mapping.value meta.sequence.list
// ^ punctuation.definition.sequence.begin
// ^ punctuation.definition.sequence.end
'meta-mapping-value-sequence-empty-with-space': [ ],
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.key
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.mapping meta.mapping.key
-// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.toc-list
// ^ meta.mapping punctuation.separator.mapping.key-value
// ^^^ meta.mapping.value
// ^^^ - meta.mapping meta.mapping.value
-// ^^^ meta.mapping.value meta.sequence.list.empty
+// ^^^ meta.mapping.value meta.sequence.list
// ^ punctuation.definition.sequence.begin
// ^ punctuation.definition.sequence.end
'meta-mapping-value-sequence': [1, 2, 3],
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.key
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.mapping meta.mapping.key
-// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.toc-list
// ^ meta.mapping punctuation.separator.mapping.key-value
// ^^^^^^^^^ meta.mapping.value
// ^^^^^^^^^ - meta.mapping meta.mapping.value
@@ -99,39 +89,34 @@
'meta-mapping-value-mapping-empty': {},
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.key
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.mapping meta.mapping.key
-// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.toc-list
// ^ meta.mapping punctuation.separator.mapping.key-value
// ^^ meta.mapping.value
// ^^ - meta.mapping meta.mapping.value
-// ^^ meta.mapping.value meta.mapping.empty
+// ^^ meta.mapping.value meta.mapping
// ^ punctuation.definition.mapping.begin
// ^ punctuation.definition.mapping.end
'meta-mapping-value-mapping-empty-with-space': { },
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.key
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.mapping meta.mapping.key
-// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.toc-list
// ^ meta.mapping punctuation.separator.mapping.key-value
// ^^^ meta.mapping.value
// ^^^ - meta.mapping meta.mapping.value
-// ^^^ meta.mapping.value meta.mapping.empty
+// ^^^ meta.mapping.value meta.mapping
// ^ punctuation.definition.mapping.begin
// ^ punctuation.definition.mapping.end
'meta-mapping-value-mapping': { "a": 1, "b": 2 },
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.key
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.mapping meta.mapping.key
-// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.toc-list
// ^ meta.mapping punctuation.separator.mapping.key-value
// ^ meta.mapping.value meta.mapping punctuation.definition.mapping.begin
// ^ - meta.mapping meta.mapping.value
// ^^^ meta.mapping.value meta.mapping.key
-// ^^^ - meta.toc-list
// ^ meta.mapping.value meta.mapping punctuation.separator.mapping.key-value
// ^ meta.mapping.value meta.mapping.value
// ^ meta.mapping.value meta.mapping punctuation.separator.mapping.pair
// ^^^ meta.mapping.value meta.mapping.key
-// ^^^ - meta.toc-list
// ^ meta.mapping.value meta.mapping punctuation.separator.mapping.key-value
// ^ meta.mapping.value meta.mapping.value
// ^ meta.mapping.value meta.mapping punctuation.definition.mapping.end
@@ -140,18 +125,15 @@
'meta-mapping-value-mapping': { 'a': 1, 'b': 2 }
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.key
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.mapping meta.mapping.key
-// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.toc-list
// ^ meta.mapping punctuation.separator.mapping.key-value
// ^ meta.mapping.value
// ^ - meta.mapping meta.mapping.value
// ^ meta.mapping.value meta.mapping punctuation.definition.mapping.begin
// ^^^ meta.mapping.value meta.mapping.key
-// ^^^ - meta.toc-list
// ^ meta.mapping.value meta.mapping punctuation.separator.mapping.key-value
// ^ meta.mapping.value meta.mapping.value
// ^ meta.mapping.value meta.mapping punctuation.separator.mapping.pair
// ^^^ meta.mapping.value meta.mapping.key
-// ^^^ - meta.toc-list
// ^ meta.mapping.value meta.mapping punctuation.separator.mapping.key-value
// ^ meta.mapping.value meta.mapping.value
// ^ meta.mapping.value meta.mapping punctuation.definition.mapping.end
diff --git a/JSON/tests/syntax/syntax_test_json5.meta.sequence.json5 b/JSON/tests/syntax/syntax_test_json5.meta.sequence.json5
index 95e9965..0d60893 100644
--- a/JSON/tests/syntax/syntax_test_json5.meta.sequence.json5
+++ b/JSON/tests/syntax/syntax_test_json5.meta.sequence.json5
@@ -28,10 +28,10 @@
// ^^^^^^^ string.quoted.single
[],
-// ^^ meta.sequence.list.empty
+// ^^ meta.sequence.list
[ ],
-// ^^^ meta.sequence.list.empty
+// ^^^ meta.sequence.list
[1, 2, 3],
// ^^^^^^^^^ meta.sequence.list
@@ -44,10 +44,10 @@
// ^ punctuation.definition.sequence.end
// ^ punctuation.separator.sequence
{},
-// ^^ meta.mapping.empty
+// ^^ meta.mapping
{ },
-// ^^^ meta.mapping.empty
+// ^^^ meta.mapping
{ "a": 1, "b": 2, "c": 3 },
// ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping
diff --git a/JSON/tests/syntax/syntax_test_jsonc.comment.jsonc b/JSON/tests/syntax/syntax_test_jsonc.comment.jsonc
index bc2965a..344f465 100644
--- a/JSON/tests/syntax/syntax_test_jsonc.comment.jsonc
+++ b/JSON/tests/syntax/syntax_test_jsonc.comment.jsonc
@@ -8,13 +8,6 @@
// ^^ comment.line.double-slash punctuation.definition.comment
// ^^^^^^^^^^ - comment.line comment.line
- // comment /** comment */
-// ^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.double-slash
-// ^^ comment.line.double-slash punctuation.definition.comment
-// ^^^^^^^^^^^^^^ - comment.block.documentation
-// ^^^ - punctuation.definition.comment.begin
-// ^^ - punctuation.definition.comment.end
-
// comment /* comment */
// ^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.double-slash
// ^^ comment.line.double-slash punctuation.definition.comment
@@ -33,89 +26,12 @@
- /** comment // comment */
-// ^^^^^^^^^^^^^^^^^^^^^^^^^ comment.block.documentation
-// ^^^ comment.block.documentation punctuation.definition.comment.begin
-// ^^^^^^^^^^^^^ - comment.line
-// ^^ comment.block.documentation punctuation.definition.comment.end
-
- /** comment /** comment */
-// ^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.block.documentation
-// ^^^ comment.block.documentation punctuation.definition.comment.begin
-// ^^^^^^^^^^^^^^ - comment.block.documentation comment.block.documentation
-// ^^ comment.block.documentation punctuation.definition.comment.end
-// ^^ - comment.block.documentation comment.block.documentation punctuation.definition.comment.end
-
- /** comment /* comment */
-// ^^^ comment.block.documentation punctuation.definition.comment.begin
-// ^^^^^^^^^^^^^^^^^^^^^^^^^ comment.block.documentation
-// ^^^^^^^^^^^^^ - comment.block.documentation comment.block
-// ^^ comment.block.documentation punctuation.definition.comment.end
-// ^^ - comment.block.documentation comment.block punctuation.definition.comment.end
-
- /** comment "not a string" */
-// ^^^ comment.block.documentation punctuation.definition.comment.begin
-// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.block.documentation
-// ^^^^^^^^^^^^^^ - meta.string string.quoted.double
-// ^ - punctuation.definition.string.begin
-// ^ - punctuation.definition.string.end
-// ^^ comment.block.documentation punctuation.definition.comment.end
-
-
-
-
-
- /** comment
- // comment */
-// ^^^^^^^^^^^^^ - comment.line
-// ^^ punctuation.definition.comment.end
-
- /** comment
- /** comment */
-// ^^^^^^^^^^^^^^ - comment.block.documentation comment.block.documentation
-// ^^ comment.block.documentation punctuation.definition.comment.end
-// ^^ - comment.block.documentation comment.block.documentation punctuation.definition.comment.end
-
- /** comment
- /* comment */
-// ^^^^^^^^^^^^^ - comment.block.documentation comment.block
-// ^^ comment.block.documentation punctuation.definition.comment.end
-// ^^ - comment.block.documentation comment.block punctuation.definition.comment.end
-
- /** comment
- "not a string" */
-// ^^^^^^^^^^^^^^ - meta.string string.quoted.double
-// ^ - punctuation.definition.string.begin
-// ^ - punctuation.definition.string.end
-// ^^ comment.block.documentation punctuation.definition.comment.end
-
-
-
-
-
- /**
- * comment
-// ^ comment.block.documentation punctuation.definition.comment
- * comment
- */
-
-
-
-
-
/* comment // comment */
// ^^ comment.block punctuation.definition.comment.begin
// ^^^^^^^^^^^^^^^^^^^^^^^^ comment.block
// ^^^^^^^^^^^^^ - comment.line
// ^^ comment.block punctuation.definition.comment.end
- /* comment /** comment */
-// ^^ comment.block punctuation.definition.comment.begin
-// ^^^^^^^^^^^^^^^^^^^^^^^^^ comment.block
-// ^^^^^^^^^^^^^^ - comment.block.documentation
-// ^^ comment.block punctuation.definition.comment.end
-// ^^ - comment.block.documentation punctuation.definition.comment.end
-
/* comment /* comment */
// ^^ comment.block punctuation.definition.comment.begin
// ^^^^^^^^^^^^^^^^^^^^^^^^ comment.block
@@ -140,12 +56,6 @@
// ^^^^^^^^^^^^^ - comment.line
// ^^ comment.block punctuation.definition.comment.end
- /* comment
- /** comment */
-// ^^^^^^^^^^^^^^ - comment.block.documentation
-// ^^ comment.block punctuation.definition.comment.end
-// ^^ - comment.block.documentation punctuation.definition.comment.end
-
/* comment
/* comment */
// ^^^^^^^^^^^^^ - comment.block comment.block
@@ -180,16 +90,6 @@
// ^^ punctuation.definition.comment
],
- "empty-sequence-with-doc-block-comment-with-no-content": [ /***/ ],
-// ^^^^^ comment.block.documentation
-// ^^^ punctuation.definition.comment.begin
-// ^^ punctuation.definition.comment.end
-
- "empty-sequence-with-doc-block-comment": [ /** */ ],
-// ^^^^^^ comment.block.documentation
-// ^^^ punctuation.definition.comment.begin
-// ^^ punctuation.definition.comment.end
-
"empty-sequence-with-block-comment-with-no-content": [ /**/ ],
// ^^^^ comment.block
// ^^ punctuation.definition.comment.begin
@@ -223,34 +123,6 @@
// ^^ punctuation.definition.comment
],
- "full-sequence-with-doc-block-comment-with-no-content": [ /***/ 1, /***/ 2 /***/ , 3 /***/ ],
-// ^^^^^ comment.block.documentation
-// ^^^ punctuation.definition.comment.begin
-// ^^ punctuation.definition.comment.end
-// ^^^^^ comment.block.documentation
-// ^^^ punctuation.definition.comment.begin
-// ^^ punctuation.definition.comment.end
-// ^^^^^ comment.block.documentation
-// ^^^ punctuation.definition.comment.begin
-// ^^ punctuation.definition.comment.end
-// ^^^^^ comment.block.documentation
-// ^^^ punctuation.definition.comment.begin
-// ^^ punctuation.definition.comment.end
-
- "full-sequence-with-doc-block-comment": [ /** */ 1, /** */ 2 /** */ , 3 /** */ ],
-// ^^^^^^ comment.block.documentation
-// ^^^ punctuation.definition.comment.begin
-// ^^ punctuation.definition.comment.end
-// ^^^^^^ comment.block.documentation
-// ^^^ punctuation.definition.comment.begin
-// ^^ punctuation.definition.comment.end
-// ^^^^^^ comment.block.documentation
-// ^^^ punctuation.definition.comment.begin
-// ^^ punctuation.definition.comment.end
-// ^^^^^^ comment.block.documentation
-// ^^^ punctuation.definition.comment.begin
-// ^^ punctuation.definition.comment.end
-
"full-sequence-with-block-comment-with-no-content": [ /**/ 1, /**/ 2 /**/ , 3 /**/ ],
// ^^^^ comment.block
// ^^ punctuation.definition.comment.begin
@@ -289,16 +161,6 @@
// ^^ punctuation.definition.comment
},
- "empty-mapping-with-doc-block-comment-with-no-content": { /***/ },
-// ^^^^^ comment.block.documentation
-// ^^^ punctuation.definition.comment.begin
-// ^^ punctuation.definition.comment.end
-
- "empty-mapping-with-doc-block-comment": { /** */ },
-// ^^^^^^ comment.block.documentation
-// ^^^ punctuation.definition.comment.begin
-// ^^ punctuation.definition.comment.end
-
"empty-mapping-with-block-comment-with-no-content": { /**/ },
// ^^^^ comment.block
// ^^ punctuation.definition.comment.begin
@@ -343,49 +205,6 @@
// ^^ punctuation.definition.comment
},
- "full-mapping-with-doc-block-comment-with-no-content": { /***/ "a": 1, /***/ "b" /***/ : /***/ 2 /***/ , "c": 3 /***/ },
-// ^^^^^ comment.block.documentation
-// ^^^ punctuation.definition.comment.begin
-// ^^ punctuation.definition.comment.end
-// ^^^^^ comment.block.documentation
-// ^^^ punctuation.definition.comment.begin
-// ^^ punctuation.definition.comment.end
-// ^^^^^ comment.block.documentation
-// ^^^ punctuation.definition.comment.begin
-// ^^ punctuation.definition.comment.end
-// ^^^^^ comment.block.documentation
-// ^^^ punctuation.definition.comment.begin
-// ^^ punctuation.definition.comment.end
-// ^^^^^ comment.block.documentation
-// ^^^ punctuation.definition.comment.begin
-// ^^ punctuation.definition.comment.end
-// ^^^^^ comment.block.documentation
-// ^^^ punctuation.definition.comment.begin
-// ^^ punctuation.definition.comment.end
-// ^^^^^ comment.block.documentation
-// ^^^ punctuation.definition.comment.begin
-// ^^ punctuation.definition.comment.end
-
- "full-mapping-with-doc-block-comment": { /** */ "a": 1, /** */ "b" /** */ : /** */ 2 /** */ , "c": 3 /** */ },
-// ^^^^^^ comment.block.documentation
-// ^^^ punctuation.definition.comment.begin
-// ^^ punctuation.definition.comment.end
-// ^^^^^^ comment.block.documentation
-// ^^^ punctuation.definition.comment.begin
-// ^^ punctuation.definition.comment.end
-// ^^^^^^ comment.block.documentation
-// ^^^ punctuation.definition.comment.begin
-// ^^ punctuation.definition.comment.end
-// ^^^^^^ comment.block.documentation
-// ^^^ punctuation.definition.comment.begin
-// ^^ punctuation.definition.comment.end
-// ^^^^^^ comment.block.documentation
-// ^^^ punctuation.definition.comment.begin
-// ^^ punctuation.definition.comment.end
-// ^^^^^^ comment.block.documentation
-// ^^^ punctuation.definition.comment.begin
-// ^^ punctuation.definition.comment.end
-
"full-mapping-with-block-comment-with-no-content": { /**/ "a": 1, /**/ "b" /**/ : /**/ 2 /**/ , "c": 3 /**/ },
// ^^^^ comment.block
// ^^ punctuation.definition.comment.begin
diff --git a/JSON/tests/syntax/syntax_test_jsonc.invalid.illegal.unclosed_string.jsonc b/JSON/tests/syntax/syntax_test_jsonc.invalid.illegal.unclosed_string.jsonc
index 1462439..017774d 100644
--- a/JSON/tests/syntax/syntax_test_jsonc.invalid.illegal.unclosed_string.jsonc
+++ b/JSON/tests/syntax/syntax_test_jsonc.invalid.illegal.unclosed_string.jsonc
@@ -4,7 +4,7 @@
{
"unterminated string
-// ^^^^^^^^^^^^^^^^^^^^ meta.mapping.key meta.toc-list meta.string string.quoted.double
+// ^^^^^^^^^^^^^^^^^^^^ meta.mapping.key meta.string string.quoted.double
// ^ invalid.illegal.unclosed-string
/**/: "test"
diff --git a/JSON/tests/syntax/syntax_test_jsonc.meta.mapping.jsonc b/JSON/tests/syntax/syntax_test_jsonc.meta.mapping.jsonc
index 81bec88..1ae9473 100644
--- a/JSON/tests/syntax/syntax_test_jsonc.meta.mapping.jsonc
+++ b/JSON/tests/syntax/syntax_test_jsonc.meta.mapping.jsonc
@@ -7,21 +7,18 @@
"meta-mapping-value-constant": null,
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.key meta.string string.quoted.double - meta.mapping.json meta.mapping.key
-// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.toc-list
// ^ meta.mapping punctuation.separator.mapping.key-value
// ^^^^ meta.mapping.value - meta.mapping.json meta.mapping.value
// ^ punctuation.separator.mapping.pair
"meta-mapping-value-number": 0,
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.key meta.string string.quoted.double - meta.mapping.json meta.mapping.key
-// ^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.toc-list
// ^ meta.mapping punctuation.separator.mapping.key-value
// ^ meta.mapping.value - meta.mapping.json meta.mapping.value
// ^ punctuation.separator.mapping.pair
"meta-mapping-value-string": "value",
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.key meta.string string.quoted.double - meta.mapping.json meta.mapping.key
-// ^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.toc-list
// ^ meta.mapping punctuation.separator.mapping.key-value
// ^^^^^^^ meta.mapping.value - meta.mapping.json meta.mapping.value
// ^ punctuation.separator.mapping.pair
@@ -29,28 +26,25 @@
"meta-mapping-value-sequence-empty": [],
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.key
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.mapping meta.mapping.key
-// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.toc-list
// ^ meta.mapping punctuation.separator.mapping.key-value
// ^^ meta.mapping.value
// ^^ - meta.mapping meta.mapping.value
-// ^^ meta.mapping.value meta.sequence.list.empty
+// ^^ meta.mapping.value meta.sequence.list
// ^ punctuation.definition.sequence.begin
// ^ punctuation.definition.sequence.end
"meta-mapping-value-sequence-empty-with-space": [ ],
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.key
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.mapping meta.mapping.key
-// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.toc-list
// ^ meta.mapping punctuation.separator.mapping.key-value
// ^^^ meta.mapping.value
// ^^^ - meta.mapping meta.mapping.value
-// ^^^ meta.mapping.value meta.sequence.list.empty
+// ^^^ meta.mapping.value meta.sequence.list
// ^ punctuation.definition.sequence.begin
// ^ punctuation.definition.sequence.end
"meta-mapping-value-sequence": [1, 2
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.key meta.string string.quoted.double - meta.mapping.json meta.mapping.key
-// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.toc-list
// ^ meta.mapping punctuation.separator.mapping.key-value
// ^^^^^ meta.mapping.value - meta.mapping.json meta.mapping.value
// ^ meta.mapping.value meta.sequence.list punctuation.definition.sequence.begin
@@ -66,33 +60,29 @@
"meta-mapping-value-mapping-empty": {},
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.key
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.mapping meta.mapping.key
-// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.toc-list
// ^ meta.mapping punctuation.separator.mapping.key-value
// ^^ meta.mapping.value
// ^^ - meta.mapping meta.mapping.value
-// ^^ meta.mapping.value meta.mapping.empty
+// ^^ meta.mapping.value meta.mapping
// ^ punctuation.definition.mapping.begin
// ^ punctuation.definition.mapping.end
"meta-mapping-value-mapping-empty-with-space": { },
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.key
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.mapping meta.mapping.key
-// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.toc-list
// ^ meta.mapping punctuation.separator.mapping.key-value
// ^^^ meta.mapping.value
// ^^^ - meta.mapping meta.mapping.value
-// ^^^ meta.mapping.value meta.mapping.empty
+// ^^^ meta.mapping.value meta.mapping
// ^ punctuation.definition.mapping.begin
// ^ punctuation.definition.mapping.end
"meta-mapping-value-mapping": { "a": 1
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.key meta.string string.quoted.double - meta.mapping.json meta.mapping.key
-// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.toc-list
// ^ meta.mapping punctuation.separator.mapping.key-value
// ^^^^^^^^^^^^^^^^^^ meta.mapping.value - meta.mapping.json meta.mapping.value
// ^ meta.mapping.value meta.mapping punctuation.definition.mapping.begin
// ^^^ meta.mapping.value meta.mapping.key
-// ^^^ - meta.toc-list
// ^ meta.mapping.value meta.mapping punctuation.separator.mapping.key-value
// ^ meta.mapping.value meta.mapping.value
,
@@ -100,7 +90,6 @@
// ^ meta.mapping.value meta.mapping punctuation.separator.mapping.pair
"b": 2
// ^^^ meta.mapping.value meta.mapping.key
-// ^^^ - meta.toc-list
// ^ meta.mapping.value meta.mapping punctuation.separator.mapping.key-value
// ^ meta.mapping.value meta.mapping.value
}
diff --git a/JSON/tests/syntax/syntax_test_jsonc.meta.sequence.jsonc b/JSON/tests/syntax/syntax_test_jsonc.meta.sequence.jsonc
index cd67783..22fd81e 100644
--- a/JSON/tests/syntax/syntax_test_jsonc.meta.sequence.jsonc
+++ b/JSON/tests/syntax/syntax_test_jsonc.meta.sequence.jsonc
@@ -25,10 +25,10 @@
// ^^^^^^^ string.quoted.double
[],
-// ^^ meta.sequence.list.empty
+// ^^ meta.sequence.list
[ ],
-// ^^^ meta.sequence.list.empty
+// ^^^ meta.sequence.list
[1, 2
// ^ meta.sequence.list punctuation.definition.sequence.begin
@@ -45,10 +45,10 @@
// ^ meta.sequence.list punctuation.separator.sequence
{},
-// ^^ meta.mapping.empty
+// ^^ meta.mapping
{ },
-// ^^^ meta.mapping.empty
+// ^^^ meta.mapping
{ "a": 1, "b": 2
// ^^^^^^^^^^^^^^^^ meta.mapping