-
Notifications
You must be signed in to change notification settings - Fork 588
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
1,399 additions
and
282 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,4 +60,4 @@ | |
{ "key": "following_text", "operator": "regex_contains", "operand": "^\\]", "match_all": true } | ||
] | ||
}, | ||
] | ||
] |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>scope</key> | ||
<string>source.json.jsonc</string> | ||
<key>settings</key> | ||
<dict> | ||
<key>decreaseIndentPattern</key> | ||
<string>(?x) | ||
# When an object is closed, but not opened | ||
( | ||
^ | ||
( | ||
# Consume strings | ||
"(?:[^"\\]|\\.)*" | ||
| | ||
# Consume all chars that don't start a string, comment or | ||
# open an object on this line | ||
[^"/{\n] | ||
)* | ||
\}.*$ | ||
) | ||
| | ||
# When an array is closed by itself on a line (interacts with indentSquareBrackets) | ||
( | ||
^(.*\*/)?\s*\].*$ | ||
) | ||
</string> | ||
<key>increaseIndentPattern</key> | ||
<string>(?x) | ||
# When an object is opened, but not closed | ||
( | ||
^.*\{ | ||
( | ||
# Consume strings | ||
"(?:[^"\\]|\\.)*" | ||
| | ||
# Consume all chars that don't start a string, comment or | ||
# end the object that was opened on this line | ||
[^"/}] | ||
)* | ||
# Stop matching at the end of the line, or once we hit a comment | ||
($|/[/*]) | ||
) | ||
| | ||
# When an array is opened, but not closed | ||
( | ||
^.*\[ | ||
( | ||
# Consume strings | ||
"(?:[^"\\]|\\.)*" | ||
| | ||
# Consume all chars that don't start a string, comment or | ||
# end the array that was opened on this line | ||
[^"/\]] | ||
)* | ||
# Stop matching at the end of the line, or once we hit a comment | ||
($|/[/*]) | ||
) | ||
</string> | ||
<key>indentSquareBrackets</key> | ||
<true/> | ||
</dict> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,201 @@ | ||
%YAML 1.2 | ||
--- | ||
# https://yaml.org/spec/1.2/spec.html | ||
# https://www.sublimetext.com/docs/syntax.html | ||
# https://www.sublimetext.com/docs/syntax.html#testing | ||
# https://www.sublimetext.com/docs/scope_naming.html | ||
name: JSON (Basic) | ||
scope: source.json.basic | ||
version: 2 | ||
hidden: true | ||
|
||
|
||
####[ Contexts ]######################################################################################################## | ||
|
||
|
||
contexts: | ||
|
||
main: | ||
- include: any | ||
|
||
any: | ||
- include: 'null' | ||
- include: boolean | ||
- include: numbers | ||
- include: strings | ||
- include: sequence | ||
- include: mapping | ||
|
||
####[ Null ]############################################################################################################ | ||
|
||
'null': | ||
- match: \b(null)\b | ||
captures: | ||
1: constant.language.null.json | ||
|
||
####[ Boolean ]######################################################################################################### | ||
|
||
boolean: | ||
- match: \b(false|true)\b | ||
captures: | ||
1: constant.language.boolean.json | ||
|
||
####[ Numbers ]######################################################################################################### | ||
|
||
numbers: | ||
- include: invalid-illegal-decimal-float-with-leading-period-in-base | ||
- include: invalid-illegal-decimal-float-with-trailing-period-in-base | ||
- include: decimal-float | ||
- include: decimal-integer | ||
|
||
invalid-illegal-decimal-float-with-leading-period-in-base: | ||
- match: '([-]?)((?:(\.)\d+)(?:[eE][-+]?\d+)?)' | ||
scope: invalid.illegal.meta-number-float-decimal.json | ||
captures: | ||
1: keyword.operator.arithmetic.json | ||
2: constant.numeric.value.json | ||
3: punctuation.separator.decimal.json | ||
|
||
invalid-illegal-decimal-float-with-trailing-period-in-base: | ||
- match: '([-]?)((?:0|[1-9]\d*)(\.)(?!\d)(?:[eE][-+]?\d+)?)' | ||
scope: invalid.illegal.meta-number-float-decimal.json | ||
captures: | ||
1: keyword.operator.arithmetic.json | ||
2: constant.numeric.value.json | ||
3: punctuation.separator.decimal.json | ||
|
||
decimal-float: | ||
- match: |- | ||
(?x: # ignore whitespace | ||
([-]?) # capture group 1: optional sign | ||
( # capture group 2: numeric value | ||
(?:0|[1-9]\d*) # zero or any other (positive) decimal integer | ||
(?: | ||
(?:(\.)\d+)(?:[eE][-+]?\d+)?| # ... and either a period, one or more number characters, an optional exponent | ||
(?:[eE][-+]?\d+) # ... or an exponent | ||
) | ||
) | ||
) | ||
scope: meta.number.float.decimal.json | ||
captures: | ||
1: keyword.operator.arithmetic.json | ||
2: constant.numeric.value.json | ||
3: punctuation.separator.decimal.json | ||
decimal-integer: | ||
- match: |- | ||
(?x: # ignore whitespace | ||
([-]?) # capture group 1: optional sign | ||
(0|[1-9]\d*) # capture group 2: zero or any other (positive) decimal integer | ||
) | ||
scope: meta.number.integer.decimal.json | ||
captures: | ||
1: keyword.operator.arithmetic.json | ||
2: constant.numeric.value.json | ||
####[ Strings ]######################################################################################################### | ||
|
||
strings: | ||
- include: double-quoted-string | ||
|
||
double-quoted-string: | ||
- match: '"' | ||
scope: punctuation.definition.string.begin.json | ||
push: inside-double-quoted-string | ||
|
||
inside-double-quoted-string: | ||
- meta_scope: string.quoted.double.json | ||
- match: '"' | ||
scope: punctuation.definition.string.end.json | ||
pop: 1 | ||
- include: double-quoted-string-escape | ||
- match: \n | ||
scope: invalid.illegal.unclosed-string.json | ||
pop: 1 | ||
|
||
double-quoted-string-escape: | ||
- match: \\\" | ||
scope: constant.character.escape.double-quote.json | ||
- 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.json | ||
- match: \\. | ||
scope: invalid.illegal.unrecognized-string-escape.json | ||
|
||
####[ Sequence ]######################################################################################################## | ||
|
||
sequence: | ||
- match: \[ | ||
scope: punctuation.section.sequence.begin.json | ||
push: inside-sequence | ||
|
||
inside-sequence: | ||
- meta_scope: meta.sequence.json | ||
- match: \] | ||
scope: punctuation.section.sequence.end.json | ||
pop: 1 | ||
- include: any | ||
- match: ',' | ||
scope: punctuation.separator.sequence.json | ||
- match: '[^\s\]]' | ||
scope: invalid.illegal.expected-sequence-separator.json | ||
|
||
####[ Mapping ]######################################################################################################### | ||
|
||
mapping: | ||
- match: \{ | ||
scope: punctuation.section.mapping.begin.json | ||
push: inside-mapping | ||
|
||
inside-mapping: | ||
- meta_scope: meta.mapping.json | ||
- match: \} | ||
scope: punctuation.section.mapping.end.json | ||
pop: 1 | ||
- match: '"' | ||
scope: punctuation.definition.string.begin.json | ||
push: inside-double-quoted-string-inside-mapping | ||
- include: latter-part-of-key-value-pair-inside-mapping | ||
- match: '[^\s\}]' | ||
scope: invalid.illegal.expected-mapping-key.json | ||
|
||
inside-double-quoted-string-inside-mapping: | ||
- clear_scopes: 1 | ||
- meta_scope: meta.mapping.key.json string.quoted.double.json | ||
- include: inside-double-quoted-string | ||
|
||
latter-part-of-key-value-pair-inside-mapping: | ||
- match: ':' | ||
scope: punctuation.separator.mapping.key-value.json | ||
push: | ||
- match: ',|\s?(?=\})' | ||
scope: invalid.illegal.expected-mapping-value.json | ||
pop: 1 | ||
- match: (?=\S) | ||
set: | ||
- 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 |
Oops, something went wrong.