diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index ca3c44789f..aab5a4e982 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -5,9 +5,23 @@ on:
- '*'
tags-ignore:
- '*'
+ paths:
+ - '**/syntax_test_*'
+ - '**/*.hidden-tmLanguage'
+ - '**/*.sublime-syntax'
+ - '**/*.tmLanguage'
+ - '**/*.tmPreferences'
+ - '.github/workflows/ci.yml'
pull_request:
branches:
- '*'
+ paths:
+ - '**/syntax_test_*'
+ - '**/*.hidden-tmLanguage'
+ - '**/*.sublime-syntax'
+ - '**/*.tmLanguage'
+ - '**/*.tmPreferences'
+ - '.github/workflows/ci.yml'
jobs:
build:
@@ -17,7 +31,7 @@ jobs:
- uses: actions/checkout@master
- name: Download syntax_tests
- run: wget -O st_syntax_tests.tar.xz https://download.sublimetext.com/st_syntax_tests_build_4090_x64.tar.xz
+ run: wget -O st_syntax_tests.tar.xz https://download.sublimetext.com/st_syntax_tests_build_4112_x64.tar.xz
- name: Extract syntax_tests
run: tar xf st_syntax_tests.tar.xz
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000000..e43b0f9889
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+.DS_Store
diff --git a/ASP/ASP.sublime-syntax b/ASP/ASP.sublime-syntax
index fcca419707..8cbc15833e 100644
--- a/ASP/ASP.sublime-syntax
+++ b/ASP/ASP.sublime-syntax
@@ -3,7 +3,7 @@
# http://www.sublimetext.com/docs/3/syntax.html
name: ASP
file_extensions:
- - asa # asp is handled by HTML-ASP.sublime-syntax
+ - vbs # Visual Basic Script
scope: source.asp
variables:
apostrophe_comment_begin: "'"
diff --git a/ASP/HTML (ASP).sublime-syntax b/ASP/HTML (ASP).sublime-syntax
index 74b28af12b..01651ae7c2 100644
--- a/ASP/HTML (ASP).sublime-syntax
+++ b/ASP/HTML (ASP).sublime-syntax
@@ -9,6 +9,7 @@ extends: Packages/HTML/HTML.sublime-syntax
file_extensions:
- asp
+ - asa
contexts:
diff --git a/AppleScript/AppleScript.sublime-syntax b/AppleScript/AppleScript.sublime-syntax
index d39aa257b9..c2cb342985 100644
--- a/AppleScript/AppleScript.sublime-syntax
+++ b/AppleScript/AppleScript.sublime-syntax
@@ -518,7 +518,7 @@ contexts:
- match: \b(?i:seconds|minutes|hours|days)\b
scope: support.class.built-in.time.applescript
comments:
- - match: ^\s*(#!).*$\n?
+ - match: ^\s*(#).*$\n?
scope: comment.line.number-sign.applescript
captures:
1: punctuation.definition.comment.applescript
diff --git a/AppleScript/Comments.tmPreferences b/AppleScript/Comments.tmPreferences
index e96b286fbe..eb673b62cd 100644
--- a/AppleScript/Comments.tmPreferences
+++ b/AppleScript/Comments.tmPreferences
@@ -19,7 +19,7 @@
name
TM_COMMENT_START_2
value
- #!
+ #
name
diff --git a/C#/C#.sublime-syntax b/C#/C#.sublime-syntax
index 58036c34c9..0a87f739c7 100644
--- a/C#/C#.sublime-syntax
+++ b/C#/C#.sublime-syntax
@@ -56,7 +56,7 @@ contexts:
comments:
- match: '^\s*(///)'
captures:
- 1: comment.block.documentation.cs punctuation.definition.comment.documentation.cs
+ 1: comment.line.documentation.cs punctuation.definition.comment.documentation.cs
push: documentation
- match: '//'
scope: punctuation.definition.comment.cs
@@ -279,11 +279,16 @@ contexts:
scope: storage.modifier.cs
- match: '{{visibility}}'
scope: storage.modifier.access.cs
- - match: \b(class|record)\s+({{name}})
+ - match: \b(class)\s+({{name}})
captures:
1: storage.type.class.cs
2: entity.name.class.cs
push: [class_signature, data_type_signature]
+ - match: \b(record)\s+({{name}})
+ captures:
+ 1: storage.type.class.record.cs
+ 2: entity.name.class.cs
+ push: [record_signature, data_type_signature]
- match: '(?:\b(readonly)\s+)?(?:\b(ref)\s+)?\b(struct)\s+({{name}})'
captures:
1: storage.modifier.cs
@@ -396,6 +401,11 @@ contexts:
- match: ''
set: [class_body, data_type_body]
+ record_signature:
+ - meta_scope: meta.class.record.cs
+ - match: ''
+ set: [class_body, record_type_body]
+
interface_signature:
- meta_scope: meta.interface.cs
- match: ''
@@ -434,6 +444,27 @@ contexts:
scope: invalid.illegal
pop: true
+ record_type_body:
+ - match: \{
+ scope: punctuation.section.block.begin.cs
+ set:
+ - meta_scope: meta.block.cs
+ - match: \}
+ scope: punctuation.section.block.end.cs
+ pop: true
+ - include: attribute
+ - include: class_declaration
+ - include: interface_declaration
+ - include: delegate_declaration
+ - include: method_declaration
+ - include: stray_close_bracket
+ - match: \(
+ scope: punctuation.section.group.begin.cs
+ set: [data_type_signature, method_params]
+ - match: ';'
+ scope: punctuation.terminator.cs
+ pop: true
+
data_type_signature:
- match: '<'
scope: meta.generic.cs punctuation.definition.generic.begin.cs
@@ -445,7 +476,7 @@ contexts:
set: type_constraint
- match: (?=where\b)
set: type_constraint
- - match: (?=\{)
+ - match: (?=[{;(])
pop: true
type_constraint:
@@ -500,10 +531,10 @@ contexts:
scope: punctuation.section.block.end.cs
pop: true
- match: \b(add)\b
- scope: storage.type.function.accessor.add.cs
+ scope: keyword.declaration.function.accessor.add.cs
push: method_body
- match: \b(remove)\b
- scope: storage.type.function.accessor.remove.cs
+ scope: keyword.declaration.function.accessor.remove.cs
push: method_body
- match: (?==)
set: member_variables_declaration
@@ -579,7 +610,7 @@ contexts:
captures:
1: variable.other.member.cs
2: meta.method.cs
- 3: storage.type.function.accessor.get.cs
+ 3: keyword.declaration.function.accessor.get.cs
set:
- meta_scope: meta.property.cs
- meta_content_scope: meta.method.cs
@@ -729,7 +760,7 @@ contexts:
scope: storage.modifier.other.cs
push: type_constraint
- match: (=>)
- scope: keyword.declaration.function.anonymous.cs
+ scope: keyword.declaration.function.arrow.cs
set:
- meta_content_scope: meta.method.cs
- include: line_of_code_in
@@ -771,16 +802,16 @@ contexts:
- match: (?:\b(readonly)\b\s+)?\b(get)\b
captures:
1: storage.modifier.cs
- 2: storage.type.function.accessor.get.cs
+ 2: keyword.declaration.function.accessor.get.cs
push: method_body
- match: \b(set|init)\b
- scope: storage.type.function.accessor.set.cs
+ scope: keyword.declaration.function.accessor.set.cs
push: method_body
- match: '{{visibility}}'
scope: storage.modifier.access.cs
- include: attribute
- match: '=>'
- scope: keyword.declaration.function.anonymous.cs
+ scope: keyword.declaration.function.arrow.cs
set:
- meta_content_scope: meta.method.cs
- include: line_of_code_in
@@ -979,7 +1010,7 @@ contexts:
- match: ({{name}})\s+(=>)\s*
captures:
1: variable.parameter.cs
- 2: storage.type.function.lambda.cs
+ 2: keyword.declaration.function.arrow.cs
push:
- meta_scope: meta.function.anonymous.cs
- match: '(?=;)'
@@ -999,7 +1030,7 @@ contexts:
- match: (\))\s*(=>)
captures:
1: meta.group.cs punctuation.section.group.end.cs
- 2: storage.type.function.lambda.cs
+ 2: keyword.declaration.function.arrow.cs
set:
- meta_content_scope: meta.function.anonymous.cs
- match: '(?=;)'
@@ -1330,43 +1361,12 @@ contexts:
2: punctuation.separator.cs
3: punctuation.section.brackets.end.cs
4: keyword.operator.pointer.cs
- - match: \((?=(?:[^,)(]|\([^\)]*\))*,)
- scope: punctuation.section.group.begin.cs
- push:
- - meta_scope: meta.group.tuple.cs
- - match: \)
- scope: punctuation.section.group.end.cs
- pop: true
- - match: ','
- scope: punctuation.separator.tuple.cs
- - match: ':'
- scope: keyword.operator.assignment.cs
- - match: _\b
- scope: variable.language.deconstruction.discard.cs
- - match: (?!{{reserved}})(?={{namespaced_name}}{{type_suffix}}\s+{{name}}\s*[:,])
- push: var_declaration_explicit
- - match: '({{name}})(<)'
- captures:
- 1: support.type.cs
- 2: meta.generic.cs punctuation.definition.generic.begin.cs
- push:
- - meta_content_scope: meta.generic.cs
- - match: ','
- scope: punctuation.separator.type.cs
- - match: '>'
- scope: meta.generic.cs punctuation.definition.generic.end.cs
- pop: true
- - include: type
- - include: line_of_code_in_no_semicolon
- match: \(
scope: punctuation.section.group.begin.cs
- push:
- - meta_scope: meta.group.cs
- - match: \)
- scope: punctuation.section.group.end.cs
- pop: true
- - include: lambdas
- - include: line_of_code_in_no_semicolon
+ branch_point: tuple_or_group
+ branch:
+ - group
+ - tuple
- match: \{
scope: punctuation.section.block.begin.cs
set:
@@ -1377,6 +1377,49 @@ contexts:
- match: (?=\}|\)|>|\]|,|{{reserved}})
pop: true
+ tuple:
+ - meta_scope: meta.group.tuple.cs
+ - match: \)
+ scope: punctuation.section.group.end.cs
+ pop: true
+ - match: ','
+ scope: punctuation.separator.tuple.cs
+ - match: ':'
+ scope: keyword.operator.assignment.cs
+ - match: _\b
+ scope: variable.language.deconstruction.discard.cs
+ - match: (?!{{reserved}})(?={{namespaced_name}}{{type_suffix}}\s+{{name}}\s*[:,])
+ push: var_declaration_explicit
+ - match: '({{name}})(<)'
+ captures:
+ 1: support.type.cs
+ 2: meta.generic.cs punctuation.definition.generic.begin.cs
+ push:
+ - meta_content_scope: meta.generic.cs
+ - match: ','
+ scope: punctuation.separator.type.cs
+ - match: (>)\s*(\()
+ captures:
+ 1: meta.generic.cs punctuation.definition.generic.end.cs
+ 2: meta.function-call.cs meta.group.cs punctuation.section.group.begin.cs
+ set: [function_call_arguments, arguments]
+ - match: '>'
+ scope: meta.generic.cs punctuation.definition.generic.end.cs
+ pop: true
+ - include: type
+ - include: line_of_code_in_no_semicolon
+ - include: line_of_code_in_no_semicolon
+
+ group:
+ - meta_scope: meta.group.cs
+ - match: \)
+ scope: punctuation.section.group.end.cs
+ pop: true
+ - match: ','
+ fail: tuple_or_group
+ - include: lambdas
+ - include: line_of_code_in_no_semicolon
+
attribute_arguments:
- meta_content_scope: meta.annotation.cs meta.group.cs
- match: ''
@@ -1428,7 +1471,7 @@ contexts:
scope: invalid.illegal.expected-close-paren.cs
pop: true
- include: stray_close_bracket
- - match: '(?=\S)'
+ - match: (?=\S)
push:
- include: lambdas
- include: line_of_code_in_no_semicolon
@@ -2182,7 +2225,7 @@ contexts:
documentation:
- meta_include_prototype: false
- - meta_content_scope: comment.block.documentation.cs
+ - meta_content_scope: comment.line.documentation.cs
- match: '(<)({{name}})'
captures:
1: punctuation.definition.tag.begin.cs
diff --git a/C#/tests/syntax_test_C#7.cs b/C#/tests/syntax_test_C#7.cs
index 2e06c2f396..ae4de41f2f 100644
--- a/C#/tests/syntax_test_C#7.cs
+++ b/C#/tests/syntax_test_C#7.cs
@@ -351,6 +351,22 @@ public void TupleTest () {
/// ^ punctuation.section.group.end
/// ^ punctuation.terminator.statement
+ (
+/// ^ meta.group.tuple punctuation.section.group.begin
+ string Alpha,
+/// ^^^^^^ storage.type
+/// ^^^^^ variable.other
+/// ^ punctuation.separator.tuple
+ string Beta
+ ) namedLetters = ("a", "b");
+/// ^ punctuation.section.group.end
+/// ^^^^^^^^^^^^ variable.other
+/// ^ keyword.operator.assignment
+/// ^ punctuation.section.group.begin
+/// ^ punctuation.separator.tuple
+/// ^ punctuation.section.group.end
+/// ^ punctuation.terminator.statement
+
(SomeType[] Alpha, SomeType Beta) example = (a, b);
/// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.group.tuple
/// ^ punctuation.section.group.begin
@@ -564,7 +580,7 @@ private static (int Max, int Min) Range(IEnumerable numbers)
/// ^^^^ variable.other
/// ^ keyword.operator.assignment.variable
/// ^ variable.parameter
-/// ^^ storage.type.function.lambda
+/// ^^ keyword.declaration.function.arrow
/// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.group
/// ^ punctuation.section.group.begin
/// ^^^^^^^^ variable.other
@@ -764,7 +780,7 @@ public class MyClass {
public MyClass () => obj = null;
/// ^^^^^^^ meta.method.constructor entity.name.function.constructor
/// ^^^^^^^^^^^^^^^^^ meta.class.body meta.block meta.method
-/// ^^ keyword.declaration.function.anonymous.cs
+/// ^^ keyword.declaration.function.arrow.cs
/// ^^^ variable.other
/// ^ keyword.operator.assignment
/// ^^^^ constant.language
@@ -789,7 +805,7 @@ public class Person // https://stackoverflow.com/a/41974829/4473405
/// ^^^ variable.parameter
/// ^ punctuation.section.parameters.end
/// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.method
-/// ^^ keyword.declaration.function.anonymous.cs
+/// ^^ keyword.declaration.function.arrow.cs
/// ^ meta.group punctuation.section.group.begin
/// ^^^^ meta.group variable.other
/// ^ meta.group punctuation.separator.tuple
diff --git a/C#/tests/syntax_test_C#8.cs b/C#/tests/syntax_test_C#8.cs
index e2e44ab011..742402f5c4 100644
--- a/C#/tests/syntax_test_C#8.cs
+++ b/C#/tests/syntax_test_C#8.cs
@@ -22,7 +22,7 @@ interface ILogger
{
void Log(LogLevel level, string message);
void Log(Exception ex) => Log(LogLevel.Error, ex.ToString()); // New overload
-/// ^^ keyword.declaration.function.anonymous
+/// ^^ keyword.declaration.function.arrow
}
public static decimal CalculateToll(object vehicle) =>
@@ -87,7 +87,7 @@ public struct Point3D
/// ^^^^^^^^ storage.modifier
/// ^^^^^^^ support.type
/// ^^^^^^^ variable.other.member
-/// ^^ storage.type.function.accessor.get
+/// ^^ keyword.declaration.function.accessor.get
/// ^^^ keyword.other
/// ^^^^^^ variable.other
/// ^ punctuation.terminator.statement
diff --git a/C#/tests/syntax_test_C#9.cs b/C#/tests/syntax_test_C#9.cs
index f33cb80777..dde311a37d 100644
--- a/C#/tests/syntax_test_C#9.cs
+++ b/C#/tests/syntax_test_C#9.cs
@@ -10,16 +10,16 @@ public record Person
{
private readonly string lastName;
public string FirstName { get; init; }
-/// ^^^ storage.type.function.accessor.get
+/// ^^^ keyword.declaration.function.accessor.get
/// ^ punctuation.terminator
-/// ^^^^ storage.type.function.accessor.set
+/// ^^^^ keyword.declaration.function.accessor.set
/// ^ punctuation.terminator
public string LastName
{
get => lastName;
init => lastName = (value ?? throw new ArgumentNullException(nameof(LastName)));
-/// ^^^^ storage.type.function.accessor.set
-/// ^^ keyword.declaration.function.anonymous
+/// ^^^^ keyword.declaration.function.accessor.set
+/// ^^ keyword.declaration.function.arrow
/// ^^^^^^^^ variable.other
}
}
@@ -298,3 +298,82 @@ DeliveryTruck t when (t.GrossWeightClass < 3000) => 10.00m - 2.00m,
if (e is not Customer) { }
/// ^^^^^^ keyword.operator.reflection
/// ^^^^^^^^ support.type
+
+public record A(int Num);
+/// ^^^^^^^^^^^^^^^^^ meta.class
+/// ^ punctuation.terminator.statement
+/// ^ meta.class.record entity.name.class
+/// ^ punctuation.section.group.begin
+/// ^^^^^^^^ meta.method.parameters
+/// ^^^ storage.type
+/// ^^^ variable.parameter
+/// ^ punctuation.section.parameters.end
+public record B(T Num);
+/// ^^^^^^^^^^^ meta.class.record
+/// ^^^^^^ storage.type.class.record
+/// ^ entity.name.class
+/// ^^^ meta.generic
+/// ^ punctuation.definition.generic.begin
+/// ^ support.type
+/// ^ punctuation.definition.generic.end
+/// ^ punctuation.section.group.begin
+/// ^^^^^ meta.method.parameters
+/// ^ punctuation.section.parameters.end
+/// ^ punctuation.terminator.statement
+public record C (TNum Num) where TNum : class;
+/// ^^^^^^ storage.type.class.record
+/// ^ entity.name.class
+/// ^ punctuation.definition.generic.begin
+/// ^^^^ support.type
+/// ^ punctuation.definition.generic.end
+/// ^ punctuation.section.group.begin
+/// ^^^^ support.type
+/// ^^^ variable.parameter
+/// ^ punctuation.section.parameters.end
+/// ^^^^^ storage.modifier
+/// ^^^^ support.type
+/// ^ punctuation.separator.type
+/// ^^^^^ storage.type
+/// ^ punctuation.terminator.statement
+public record D (TNum Num) where TNum : class { public const int TEST = 4; }
+/// ^^^^^^ storage.type.class.record
+/// ^ entity.name.class
+/// ^ punctuation.definition.generic.begin
+/// ^^^^ support.type
+/// ^ punctuation.definition.generic.end
+/// ^ punctuation.section.group.begin
+/// ^^^^ support.type
+/// ^^^ variable.parameter
+/// ^ punctuation.section.parameters.end
+/// ^^^^^ storage.modifier
+/// ^^^^ support.type
+/// ^ punctuation.separator.type
+/// ^^^^^ storage.type
+/// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.block
+/// ^ punctuation.section.block.begin
+/// ^^^^^^ storage.modifier.access
+/// ^^^^^ storage.modifier
+/// ^^^ storage.type
+/// ^^^^ variable.other
+/// ^ keyword.operator.assignment.variable
+/// ^ constant.numeric.value
+/// ^ punctuation.terminator.statement
+/// ^ punctuation.section.block.end
+public record Person(
+///^^^ storage.modifier.access
+/// ^^^^^^ meta.class.record storage.type.class.record
+/// ^^^^^^ meta.class.record entity.name.class
+/// ^ punctuation.section.group.begin
+ [property: JsonPropertyName("firstName")]string FirstName,
+/// ^ punctuation.definition.annotation.begin
+/// ^ punctuation.definition.annotation.end
+/// ^^^^^^ storage.type
+/// ^^^^^^^^^ variable.parameter
+/// ^ punctuation.separator.parameter.function
+ [property: JsonPropertyName("lastName")]string LastName);
+/// ^ punctuation.definition.annotation.begin
+/// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.class.body meta.method.parameters meta.annotation
+/// ^^^^^^ storage.type
+/// ^^^^^^^^ variable.parameter
+/// ^ punctuation.section.parameters.end
+/// ^ punctuation.terminator.statement
diff --git a/C#/tests/syntax_test_Comments.cs b/C#/tests/syntax_test_Comments.cs
index 1dcfbb52e7..49cfc4a8ef 100755
--- a/C#/tests/syntax_test_Comments.cs
+++ b/C#/tests/syntax_test_Comments.cs
@@ -8,7 +8,7 @@ namespace HelloWorld
{
///
//* ^^^ punctuation.definition.comment.documentation.cs
-//* ^^^^^^^^^^^^^^ comment.block.documentation
+//* ^^^^^^^^^^^^^^ comment.line.documentation
//* ^ punctuation.definition.tag.begin
//* ^^^^^^^ entity.name.tag.begin
//* ^ punctuation.definition.tag.end
@@ -16,7 +16,7 @@ namespace HelloWorld
//* ^^^^^^^^^ - text.documentation
//* ^ text.documentation
/// This class is testing comments
-//* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.block.documentation
+//* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.documentation
//* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ text.documentation
///
//* ^^ punctuation.definition.tag.begin
diff --git a/C#/tests/syntax_test_GeneralStructure.cs b/C#/tests/syntax_test_GeneralStructure.cs
index 06646fb2f5..753f80e7cc 100644
--- a/C#/tests/syntax_test_GeneralStructure.cs
+++ b/C#/tests/syntax_test_GeneralStructure.cs
@@ -46,14 +46,14 @@ public Int YourProperty {
/// ^ meta.property punctuation.section.block.begin
get {return x;}
/// ^^^^^^^^^^^^^^^ meta.property meta.method
-/// ^ storage.type.function.accessor.get
+/// ^ keyword.declaration.function.accessor.get
/// ^^^^^^^^^^^ meta.property meta.method.body meta.block
/// ^ punctuation.section.block.begin
/// ^ punctuation.terminator
/// ^ punctuation.section.block.end
set {x = value;}
/// ^^^^^^^^^^^^^^^^ meta.property meta.method
-/// ^ storage.type.function.accessor.set
+/// ^ keyword.declaration.function.accessor.set
/// ^^^^^^^^^^^^ meta.property meta.method.body meta.block
/// ^ punctuation.section.block.begin
/// ^ variable.other
@@ -71,7 +71,7 @@ public Int YourProperty {
/// ^^^^ support.type
/// ^^^^^ variable.parameter
/// ^ punctuation.section.parameters.end
-/// ^^ keyword.declaration.function.anonymous.cs
+/// ^^ keyword.declaration.function.arrow.cs
/// ^^^^ variable.language
/// ^^ keyword.operator.reflection
/// ^^^^^ support.type
@@ -96,7 +96,7 @@ public Int YourProperty {
/// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.property
/// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.method
/// ^ variable.other.member
-/// ^^ storage.type.function.accessor.get
+/// ^^ keyword.declaration.function.accessor.get
/// ^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function-call
/// ^^^^^^^ support.type
/// ^^^^^^ meta.generic
@@ -108,9 +108,9 @@ public Int YourProperty {
/// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.property
/// ^^^^^^^^^^^^^^ variable.other.member
/// ^^^^^^^^^^^^^^^^^^^^ meta.property meta.block
-/// ^^^ storage.type.function.accessor.get
+/// ^^^ keyword.declaration.function.accessor.get
/// ^^^^^^^ storage.modifier.access
-/// ^^^ storage.type.function.accessor.set
+/// ^^^ keyword.declaration.function.accessor.set
/// ^ keyword.operator.assignment
/// ^^^^^ constant.language
@@ -120,7 +120,7 @@ public Int YourProperty {
/// ^^^^^^^^^^^^^^^^^^^^ meta.method
/// ^^^^^^^^^ entity.name.function
/// ^^ meta.method.parameters
-/// ^^ keyword.declaration.function.anonymous.cs
+/// ^^ keyword.declaration.function.arrow.cs
/// ^^^^^ constant.language
}
@@ -715,8 +715,8 @@ IEnumerable Traverse()
/// ^ punctuation.section.brackets.end
/// ^^^ storage.type
/// ^^^ variable.parameter
-/// ^^^ storage.type.function.accessor
-/// ^^^ storage.type.function.accessor
+/// ^^^ keyword.declaration.function.accessor
+/// ^^^ keyword.declaration.function.accessor
/////////////////////////////
@@ -792,7 +792,7 @@ public virtual ActionResult Process([ModelBinder(typeof(MyModelBinder))]
/// ^^^ storage.type
/// ^^^^^^^ variable.other.member
/// ^^^^ meta.method
-/// ^^ storage.type.function
+/// ^^ keyword.declaration.function
/// ^ constant.numeric
/// ^ punctuation.terminator
@@ -829,24 +829,24 @@ void CodeContainingLambdas(){
/// ^^^ variable.other
/// ^ keyword.operator.assignment
/// ^^^^^^^^ meta.function.anonymous
-/// ^^ storage.type.function.lambda
+/// ^^ keyword.declaration.function.arrow
Func times2 = x => x + x;
/// ^^^ support.type
/// ^^^ variable.other
/// ^ keyword.operator.assignment
/// ^^^^^^^^^^ meta.function.anonymous
-/// ^^ storage.type.function.lambda
+/// ^^ keyword.declaration.function.arrow
var changes = refs.ToDictionary(kvp => kvp.key, arg => k + 5);
/// ^^^^^^^^^^^^^^ meta.function.anonymous.cs
/// ^^^ variable.parameter.cs
-/// ^^ storage.type.function.lambda.cs
+/// ^^ keyword.declaration.function.arrow.cs
/// ^^^ variable.other.cs
/// ^ punctuation.separator.argument.cs
/// ^^ - meta.function.anonymous
/// ^^^^^^^^^^^^ meta.function.anonymous.cs
/// ^^^ variable.parameter.cs
-/// ^^ storage.type.function.lambda.cs
+/// ^^ keyword.declaration.function.arrow.cs
/// ^ variable.other.cs
/// ^ keyword.operator.cs
/// ^ meta.number.integer.decimal.cs
@@ -862,7 +862,7 @@ void CodeContainingLambdas(){
/// ^ punctuation.separator.parameter.function.cs
/// ^^^^^ variable.parameter.cs
/// ^ punctuation.section.group.end.cs
-/// ^^ storage.type.function.lambda.cs
+/// ^^ keyword.declaration.function.arrow.cs
/// ^^^^^ variable.other.cs
}
@@ -1010,7 +1010,7 @@ void TestMethod(int argument) {
void TestMe () {
a = b => b * 2;
-/// ^^ storage.type.function.lambda
+/// ^^ keyword.declaration.function.arrow
/// ^^^^^^^^ meta.function.anonymous
/// ^ punctuation.terminator.statement - meta.function.anonymous
@@ -1031,7 +1031,7 @@ void TestMe () {
}
a = b => { return b * 2; };
-/// ^^ meta.function.anonymous storage.type.function.lambda
+/// ^^ meta.function.anonymous keyword.declaration.function.arrow
/// ^ meta.function.anonymous punctuation.section.block.begin
/// ^ punctuation.section.block.end
/// ^ punctuation.terminator.statement - meta.function.anonymous
@@ -1055,7 +1055,7 @@ void TestMe () {
/// ^ variable.parameter
/// ^ punctuation.separator
/// ^ variable.parameter
-/// ^^ storage.type.function.lambda
+/// ^^ keyword.declaration.function.arrow
/// ^ meta.function.anonymous punctuation.section.block.begin
/// ^ punctuation.section.block.end
/// ^ punctuation.terminator.statement - meta.function.anonymous
@@ -1082,7 +1082,7 @@ void TestMe () {
/// ^ variable.parameter
/// ^ punctuation.separator.parameter.function
/// ^ variable.parameter
-/// ^^ storage.type.function.lambda
+/// ^^ keyword.declaration.function.arrow
/// ^ punctuation.terminator.statement
/// ^ - meta.function.anonymous
@@ -1133,7 +1133,7 @@ void TestMe () {
/// ^^^^^^ meta.cast support.type
/// ^ punctuation.section.group.begin
/// ^^ meta.function.anonymous meta.group
-/// ^^ storage.type.function.lambda
+/// ^^ keyword.declaration.function.arrow
/// ^ punctuation.section.group.end
test = (Action)(() => {});
/// ^^^^^^^^ meta.cast
@@ -1141,7 +1141,7 @@ void TestMe () {
/// ^^^^^^^ meta.function.anonymous
/// ^ meta.group punctuation.section.group.begin
/// ^ meta.group punctuation.section.group.end
-/// ^^ storage.type.function.lambda
+/// ^^ keyword.declaration.function.arrow
/// ^ punctuation.section.block.begin
/// ^ punctuation.section.block.end
/// ^ meta.group punctuation.section.group.end
@@ -1306,7 +1306,7 @@ protected event EventHandler IDrawingObject.OnDraw
{
/// ^ punctuation.section.block.begin
add
-/// ^^^ meta.method storage.type.function.accessor.add
+/// ^^^ meta.method keyword.declaration.function.accessor.add
{
/// ^ punctuation.section.block.begin
lock (objectLock)
@@ -1319,7 +1319,7 @@ protected event EventHandler IDrawingObject.OnDraw
/// ^ punctuation.section.block.end
/// ^ - meta.method
remove
-/// ^^^^^^ meta.method storage.type.function.accessor.remove
+/// ^^^^^^ meta.method keyword.declaration.function.accessor.remove
{
lock (objectLock)
{
@@ -1368,7 +1368,7 @@ public int Counter
{
readonly get => counter;
/// ^^^^^^^^ storage.modifier
-/// ^^^ storage.type.function.accessor.get
+/// ^^^ keyword.declaration.function.accessor.get
set => counter = value;
}
}
diff --git a/C#/tests/syntax_test_Generics.cs b/C#/tests/syntax_test_Generics.cs
index a28383465a..e38f53c023 100755
--- a/C#/tests/syntax_test_Generics.cs
+++ b/C#/tests/syntax_test_Generics.cs
@@ -154,7 +154,7 @@ string Frag
{
/// <- punctuation.section.block.begin
get
-/// ^^^ - storage.type.function
+/// ^^^ - keyword.declaration.function
{
/// ^ punctuation.section.block.begin
var list = new List();
diff --git a/C#/tests/syntax_test_Using.cs b/C#/tests/syntax_test_Using.cs
index 09e1a46a1a..902857c4b0 100755
--- a/C#/tests/syntax_test_Using.cs
+++ b/C#/tests/syntax_test_Using.cs
@@ -141,7 +141,7 @@ public static Test Default {
/// ^^^^^ meta.annotation
/// ^ variable.annotation
get {
-/// ^ storage.type.function.accessor.get
+/// ^ keyword.declaration.function.accessor.get
return defaultInstance;
}
}
diff --git a/C++/C++.sublime-syntax b/C++/C++.sublime-syntax
index 6744826ac5..7fb0999345 100644
--- a/C++/C++.sublime-syntax
+++ b/C++/C++.sublime-syntax
@@ -21,19 +21,28 @@ first_line_match: '-\*- C\+\+ -\*-'
scope: source.c++
variables:
# number digits
- dec_digits: '(?:\d(?:[\d'']*\d)?)'
+ bin_digit: '[01'']'
+ oct_digit: '[0-7'']'
+ dec_digit: '[\d'']'
+ hex_digit: '[\h'']'
+
+ dec_digits: '(?:\d(?:{{dec_digit}}*\d)?)'
# number exponents
- dec_exponent: '(?:[eE][-+]??{{dec_digits}})'
- hex_exponent: '(?:[pP][-+]??{{dec_digits}})'
+ dec_exponent: '(?:[eE][-+]?{{dec_digit}}*)'
+ hex_exponent: '(?:[pP][-+]?{{dec_digit}}*)'
# number suffixes
- # note: nearly everything can be defined as suffix via `operator` keyword
- # see: https://en.cppreference.com/w/cpp/numeric/complex/operator%22%22i
- dec_suffix: '(?:[a-zA-Z_][[:alnum:]_]*|(?=[^[:alnum:]_'']))'
- hex_suffix: '(?:[g-zG-Z_][[:alnum:]_]*|(?=[^[:alnum:]_'']))'
+ # note: nearly everything can be defined as suffix
+ # a) see user literals
+ # https://en.cppreference.com/w/cpp/language/user_literal
+ # b) see complex `operator` keyword
+ # https://en.cppreference.com/w/cpp/numeric/complex/operator%22%22i
+ bin_suffix: '[2-9a-zA-Z_][[:alnum:]_]*'
+ oct_suffix: '[8-9g-zG-Z_][[:alnum:]_]*'
+ dec_suffix: '[a-zA-Z_][[:alnum:]_]*'
+ hex_suffix: '[g-zG-Z_][[:alnum:]_]*'
float_suffix: '[fF]'
- integer_suffix: '[lL]{1,2}[uU]?|[uU][lL]{0,2}'
identifier: \b[[:alpha:]_][[:alnum:]_]*\b # upper and lowercase
macro_identifier: \b[[:upper:]_][[:upper:][:digit:]_]{2,}\b # only uppercase, at least 3 chars
@@ -48,11 +57,12 @@ variables:
before_tag: 'struct|union|enum\s+class|enum\s+struct|enum|class'
declspec: '__declspec\(\s*\w+(?:\([^)]+\))?\s*\)'
storage_classes: 'static|export|extern|friend|explicit|virtual|register|thread_local'
- type_qualifier: 'const|constexpr|mutable|typename|volatile'
+ type_qualifier: 'const|mutable|typename|volatile'
+ constant_expression_specifiers: 'consteval|constexpr|constinit'
compiler_directive: 'inline|restrict|__restrict__|__restrict'
visibility_modifiers: 'private|protected|public'
other_keywords: 'typedef|nullptr|{{visibility_modifiers}}|static_assert|sizeof|using|typeid|alignof|alignas|namespace|template'
- modifiers: '{{storage_classes}}|{{type_qualifier}}|{{compiler_directive}}'
+ modifiers: '{{storage_classes}}|{{type_qualifier}}|{{compiler_directive}}|{{constant_expression_specifiers}}'
non_angle_brackets: '(?=<<|<=)'
regular: '[^(){}&;*^%=<>-]*'
@@ -130,7 +140,7 @@ contexts:
scope: keyword.operator.word.c++
unique-types:
- - match: \b(char16_t|char32_t|wchar_t|nullptr_t)\b
+ - match: \b(char8_t|char16_t|char32_t|wchar_t|nullptr_t)\b
scope: storage.type.c++
- match: \bclass\b
scope: keyword.declaration.class.c++
@@ -154,110 +164,76 @@ contexts:
(?x:
\b({{dec_digits}})
(?:
- (?:
- (\.)
+ ( (\.)
(?:
# 1.1, 1.1e1, 1.1e-1, 1.1f, 1.1e1f, 1.1e-1f, 1.1L, 1.1e1L, 1.1e-1L
- ({{dec_digits}}) ({{dec_exponent}})?
+ {{dec_digit}}+ {{dec_exponent}}?
# 1.e1, 1.e-1, 1.e1f, 1.e-1f, 1.e1L, 1.e-1L
- | ({{dec_exponent}})
+ | {{dec_exponent}}
# 1., 1.f, 1.L # but not `..`
| (?!\.)
)
# 1e1 1e1f 1e1L
- | ({{dec_exponent}})
+ | {{dec_exponent}}
) ({{dec_suffix}})?
# 1f
| ({{float_suffix}})
)
# .1, .1e1, .1e-1, .1f, .1e1f, .1e-1f, .1L, .1e1L, .1e-1L
- | (\.) ({{dec_digits}}) ({{dec_exponent}})? ({{dec_suffix}})?
+ | ( (\.) {{dec_digit}}+ {{dec_exponent}}? ) ({{dec_suffix}})?
)
scope: meta.number.float.decimal.c++
captures:
1: constant.numeric.value.c++
- 2: punctuation.separator.decimal.c++
- 3: constant.numeric.value.c++
- 4: constant.numeric.value.exponent.c++
- 5: constant.numeric.value.exponent.c++
- 6: constant.numeric.value.exponent.c++
- 7: constant.numeric.suffix.c++
+ 2: constant.numeric.value.c++
+ 3: punctuation.separator.decimal.c++
+ 4: constant.numeric.suffix.c++
+ 5: constant.numeric.suffix.c++
+ 6: constant.numeric.value.c++
+ 7: punctuation.separator.decimal.c++
8: constant.numeric.suffix.c++
- 9: punctuation.separator.decimal.c++
- 10: constant.numeric.value.c++
- 11: constant.numeric.value.exponent.c++
- 12: constant.numeric.suffix.c++
-
- # hexadecimal float (C99)
- - match: \b0[xX](?=[[:alnum:]_''.]+?[pP])
- scope: constant.numeric.base.c++
- push:
- - meta_include_prototype: false
- - meta_scope: meta.number.float.hexadecimal.c++
- - match: '({{hex_exponent}})([fFlL]\b)?'
- captures:
- 1: constant.numeric.value.exponent.c++
- 2: constant.numeric.suffix.c++
- pop: true
- - match: \.
- scope: punctuation.separator.decimal.c++
- - match: \h
- scope: constant.numeric.value.c++
- - match: .
- scope: invalid.illegal.numeric.digit.c++
-
- # https://en.cppreference.com/w/c/language/integer_constant
-
- # binary integer
- - match: \b0[bB]
- scope: constant.numeric.base.c++
- push:
- - meta_include_prototype: false
- - meta_scope: meta.number.integer.binary.c++
- - include: decimal-suffix
- - match: '[2-9]'
- scope: invalid.illegal.numeric.digit.c++
- - match: .
- scope: constant.numeric.value.c++
+
+ # hexadecimal float
+ - match: \b(0[xX])({{hex_digit}}*(\.){{hex_digit}}*{{hex_exponent}})({{dec_suffix}})?
+ scope: meta.number.float.hexadecimal.c++
+ captures:
+ 1: constant.numeric.base.c++
+ 2: constant.numeric.value.c++
+ 3: punctuation.separator.decimal.c++
+ 4: constant.numeric.suffix.c++
+
+ # https://en.cppreference.com/w/cpp/language/integer_literal
+
# hexadecimal integer
- - match: \b0[xX]
- scope: constant.numeric.base.c++
- push:
- - meta_include_prototype: false
- - meta_scope: meta.number.integer.hexadecimal.c++
- - include: hexadecimal-suffix
- - match: .
- scope: constant.numeric.value.c++
+ - match: \b(0[xX])({{hex_digit}}*)({{hex_suffix}})?
+ scope: meta.number.integer.hexadecimal.c++
+ captures:
+ 1: constant.numeric.base.c++
+ 2: constant.numeric.value.c++
+ 3: constant.numeric.suffix.c++
+
+ # binary integer (C++14)
+ - match: \b(0[bB])({{bin_digit}}*)({{bin_suffix}})?
+ scope: meta.number.integer.binary.c++
+ captures:
+ 1: constant.numeric.base.c++
+ 2: constant.numeric.value.c++
+ 3: constant.numeric.suffix.c++
+
# octal integer
- - match: \b0(?=[\d''])
- scope: constant.numeric.base.c++
- push:
- - meta_include_prototype: false
- - meta_scope: meta.number.integer.octal.c++
- - include: decimal-suffix
- - match: '[89]'
- scope: invalid.illegal.numeric.digit.c++
- - match: .
- scope: constant.numeric.value.c++
- # decimal integer
- - match: \b\d+
- scope: constant.numeric.value.c++
- push:
- - meta_include_prototype: false
- - meta_scope: meta.number.integer.decimal.c++
- - include: decimal-suffix
- - match: .
- scope: constant.numeric.value.c++
-
- decimal-suffix:
- - match: '{{dec_suffix}}'
- scope: constant.numeric.suffix.c++
- pop: true
+ - match: \b(0)({{oct_digit}}+)({{oct_suffix}})?
+ scope: meta.number.integer.octal.c++
+ captures:
+ 1: constant.numeric.base.c++
+ 2: constant.numeric.value.c++
+ 3: constant.numeric.suffix.c++
- hexadecimal-suffix:
- - match: '{{hex_suffix}}'
- scope: constant.numeric.suffix.c++
- pop: true
+ # decimal integer
+ - match: \b({{dec_digits}})({{dec_suffix}})?
+ scope: meta.number.integer.decimal.c++
+ captures:
+ 1: constant.numeric.value.c++
+ 2: constant.numeric.suffix.c++
identifiers:
- match: '(?:(::)\s*)?{{identifier}}\s*(::)\s*'
@@ -1173,7 +1149,7 @@ contexts:
scope: keyword.declaration.struct.type.c++
set: data-structures-struct-definition
- match: '\benum(\s+(class|struct))?\b'
- scope: keyword.declaration.union.type.c++
+ scope: keyword.declaration.enum.type.c++
set: data-structures-enum-definition
- match: '\bunion\b'
scope: keyword.declaration.union.type.c++
diff --git a/C++/C.sublime-syntax b/C++/C.sublime-syntax
index bc4ba39cb3..c68df90ef1 100644
--- a/C++/C.sublime-syntax
+++ b/C++/C.sublime-syntax
@@ -9,13 +9,25 @@ first_line_match: "-[*]-( Mode:)? C -[*]-"
scope: source.c
variables:
+ # number digits
+ bin_digit: '[01]'
+ oct_digit: '[0-7]'
+ dec_digit: '\d'
+ hex_digit: '\h'
+
+ dec_digits: '{{dec_digit}}+'
+
# number exponents
- dec_exponent: '(?:[eE][-+]??\d+)'
- hex_exponent: '(?:[pP][-+]??\d+)'
+ dec_exponent: '(?:[eE][-+]?{{dec_digit}}*)'
+ hex_exponent: '(?:[pP][-+]?{{dec_digit}}*)'
# number suffixes
+ bin_suffix: '[2-9a-zA-Z_][[:alnum:]_]*'
+ oct_suffix: '[8-9g-zG-Z_][[:alnum:]_]*'
dec_suffix: '[a-zA-Z_][[:alnum:]_]*'
hex_suffix: '[g-zG-Z_][[:alnum:]_]*'
+ double_suffix: '[fFlL]'
+ float_suffix: '[fF]'
integer_suffix: '[lL]{1,2}[uU]?|[uU][lL]{0,2}'
identifier: \b[[:alpha:]_][[:alnum:]_]*\b # upper and lowercase
@@ -185,95 +197,85 @@ contexts:
# decimal floats
- match: |-
(?x:
- \b(\d+)
+ \b({{dec_digits}})
(?:
- (?: (\.) (?: (\d+) ({{dec_exponent}})? | ({{dec_exponent}}) | (?=[^.])) | ({{dec_exponent}}) )
- (?: ([fFlL])\b | ({{dec_suffix}})? ) | ([fF])\b
- )
- | (\.) (\d+) ({{dec_exponent}})? (?: ([fFlL])\b | ({{dec_suffix}})? )
+ ( (\.)
+ (?:
+ # 1.1, 1.1e1, 1.1e-1, 1.1f, 1.1e1f, 1.1e-1f, 1.1L, 1.1e1L, 1.1e-1L
+ {{dec_digit}}+ {{dec_exponent}}?
+ # 1.e1, 1.e-1, 1.e1f, 1.e-1f, 1.e1L, 1.e-1L
+ | {{dec_exponent}}
+ # 1., 1.f, 1.L # but not `..`
+ | (?!\.)
+ )
+ # 1e1 1e1f 1e1L
+ | {{dec_exponent}}
+ ) ({{double_suffix}})?
+ # 1f
+ | ({{float_suffix}})
+ ) ({{dec_suffix}})?
+ # .1, .1e1, .1e-1, .1f, .1e1f, .1e-1f, .1L, .1e1L, .1e-1L
+ | ( (\.) {{dec_digit}}+ {{dec_exponent}}? ) (?: ({{double_suffix}}) | ({{dec_suffix}}) )?
)
scope: meta.number.float.decimal.c
captures:
1: constant.numeric.value.c
- 2: punctuation.separator.decimal.c
- 3: constant.numeric.value.c
- 4: constant.numeric.value.exponent.c
- 5: constant.numeric.value.exponent.c
- 6: constant.numeric.value.exponent.c
- 7: constant.numeric.suffix.c
- 8: invalid.illegal.numeric.suffix.c
+ 2: constant.numeric.value.c
+ 3: punctuation.separator.decimal.c
+ 4: constant.numeric.suffix.c
+ 5: constant.numeric.suffix.c
+ 6: invalid.illegal.numeric.suffix.c
+ 7: constant.numeric.value.c
+ 8: punctuation.separator.decimal.c
9: constant.numeric.suffix.c
- 10: punctuation.separator.decimal.c
- 11: constant.numeric.value.c
- 12: constant.numeric.value.exponent.c
- 13: constant.numeric.suffix.c
- 14: invalid.illegal.numeric.suffix.c
+ 10: invalid.illegal.numeric.suffix.c
+
# hexadecimal float (C99)
- - match: \b0[xX](?=[[:alnum:].]+?[pP])
- scope: constant.numeric.base.c
- push:
- - meta_include_prototype: false
- - meta_scope: meta.number.float.hexadecimal.c
- - match: '({{hex_exponent}})([fFlL]\b)?'
- captures:
- 1: constant.numeric.value.exponent.c
- 2: constant.numeric.suffix.c
- pop: true
- - match: \.
- scope: punctuation.separator.decimal.c
- - match: \h
- scope: constant.numeric.value.c
- - match: .
- scope: invalid.illegal.numeric.digit.c
+ - match: \b(0[xX])({{hex_digit}}*(\.){{hex_digit}}*{{hex_exponent}})(?:([fFlL]\b)|({{dec_suffix}}))?
+ scope: meta.number.float.hexadecimal.c
+ captures:
+ 1: constant.numeric.base.c
+ 2: constant.numeric.value.c
+ 3: punctuation.separator.decimal.c
+ 4: constant.numeric.suffix.c
+ 5: invalid.illegal.numeric.suffix.c
# https://en.cppreference.com/w/c/language/integer_constant
+ # binary integer (C23)
+ - match: \b(0[bB])({{bin_digit}}*)(?:({{integer_suffix}})|({{bin_suffix}}))?
+ scope: meta.number.integer.binary.c
+ captures:
+ 1: constant.numeric.base.c
+ 2: constant.numeric.value.c
+ 3: constant.numeric.suffix.c
+ 4: invalid.illegal.numeric.suffix.c
+
# hexadecimal integer
- - match: \b0[xX]
- scope: constant.numeric.base.c
- push:
- - meta_include_prototype: false
- - meta_scope: meta.number.integer.hexadecimal.c
- - include: hexadecimal-suffix
- - match: .
- scope: constant.numeric.value.c
+ - match: \b(0[xX])({{hex_digit}}*)(?:({{integer_suffix}})|({{hex_suffix}}))?
+ scope: meta.number.integer.hexadecimal.c
+ captures:
+ 1: constant.numeric.base.c
+ 2: constant.numeric.value.c
+ 3: constant.numeric.suffix.c
+ 4: invalid.illegal.numeric.suffix.c
+
# octal integer
- - match: \b0(?=\d)
- scope: constant.numeric.base.c
- push:
- - meta_include_prototype: false
- - meta_scope: meta.number.integer.octal.c
- - match: '[89]'
- scope: invalid.illegal.numeric.digit.c
- - include: decimal-suffix
- - match: .
- scope: constant.numeric.value.c
+ - match: \b(0)({{oct_digit}}+)(?:({{integer_suffix}})|({{oct_suffix}}))?
+ scope: meta.number.integer.octal.c
+ captures:
+ 1: constant.numeric.base.c
+ 2: constant.numeric.value.c
+ 3: constant.numeric.suffix.c
+ 4: invalid.illegal.numeric.suffix.c
# decimal integer
- - match: \b\d+
- scope: constant.numeric.value.c
- push:
- - meta_include_prototype: false
- - meta_scope: meta.number.integer.decimal.c
- - include: decimal-suffix
- - match: .
- scope: constant.numeric.value.c
-
- decimal-suffix:
- - match: (?:{{integer_suffix}})?\b
- scope: constant.numeric.suffix.c
- pop: true
- - match: '{{dec_suffix}}'
- scope: invalid.illegal.numeric.suffix.c
- pop: true
-
- hexadecimal-suffix:
- - match: (?:{{integer_suffix}})?\b
- scope: constant.numeric.suffix.c
- pop: true
- - match: '{{hex_suffix}}'
- scope: invalid.illegal.numeric.suffix.c
- pop: true
+ - match: \b({{dec_digits}})(?:({{integer_suffix}})|({{dec_suffix}}))?
+ scope: meta.number.integer.decimal.c
+ captures:
+ 1: constant.numeric.value.c
+ 2: constant.numeric.suffix.c
+ 3: invalid.illegal.numeric.suffix.c
operators:
- match: (?:\+\+|--)
diff --git a/C++/syntax_test_c.c b/C++/syntax_test_c.c
index 410665eb39..3148b71aae 100644
--- a/C++/syntax_test_c.c
+++ b/C++/syntax_test_c.c
@@ -721,11 +721,7 @@ oct2 = 01284967Z0L;
/* ^^^^^^^^^^^ meta.number.integer.octal.c */
/* ^ constant.numeric.base.c */
/* ^^ constant.numeric.value.c */
-/* ^ invalid.illegal.numeric.digit.c */
-/* ^ constant.numeric.value.c */
-/* ^ invalid.illegal.numeric.digit.c */
-/* ^^ constant.numeric.value.c */
-/* ^^^ invalid.illegal.numeric.suffix.c */
+/* ^^^^^^^^ invalid.illegal.numeric.suffix.c */
/* ^ punctuation.terminator - constant */
hex1 = 0x0+0xFL+0xaull+0xallu+0xfu+0x'f'12_4uz;
@@ -759,127 +755,102 @@ hex1 = 0x0+0xFL+0xaull+0xallu+0xfu+0x'f'12_4uz;
hex2 = 0xc1.01AbFp-1+0x1.45c778p+7f;
/* ^^^^^^^^^^^^^ meta.number.float.hexadecimal.c */
/* ^^ constant.numeric.base.c */
-/* ^^ constant.numeric.value.c */
+/* ^^^^^^^^^^^ constant.numeric.value.c */
/* ^ punctuation.separator.decimal.c */
-/* ^^^^^ constant.numeric.value.c */
-/* ^^^ constant.numeric.value.exponent.c */
/* ^ keyword.operator.arithmetic - constant.c */
/* ^^^^^^^^^^^^^^ meta.number.float.hexadecimal.c */
/* ^^ constant.numeric.base.c */
-/* ^ constant.numeric.value.c */
+/* ^^^^^^^^^^^ constant.numeric.value.c */
/* ^ punctuation.separator.decimal.c */
-/* ^^^^^^ constant.numeric.value.c */
-/* ^^^ constant.numeric.value.exponent.c */
/* ^ constant.numeric.suffix.c */
/* ^ punctuation.terminator - constant */
f = 1.1+1.1e1+1.1e-1+1.1f+1.1e1f+1.1e-1f+1.1L+1.1e1L+1.1e-1L;
/* ^^^ meta.number.float.decimal.c */
-/* ^ constant.numeric.value.c */
+/* ^^^ constant.numeric.value.c */
/* ^ punctuation.separator.decimal.c */
-/* ^ constant.numeric.value.c */
/* ^ keyword.operator.arithmetic.c */
/* ^^^^^ meta.number.float.decimal.c */
-/* ^ constant.numeric.value.c */
+/* ^^^^^ constant.numeric.value.c */
/* ^ punctuation.separator.decimal.c */
-/* ^ constant.numeric.value.c */
-/* ^^ constant.numeric.value.exponent.c */
/* ^ keyword.operator.arithmetic.c */
/* ^^^^^^ meta.number.float.decimal.c */
-/* ^ constant.numeric.value.c */
+/* ^^^^^^ constant.numeric.value.c */
/* ^ punctuation.separator.decimal.c */
-/* ^ constant.numeric.value.c */
-/* ^^^ constant.numeric.value.exponent.c */
/* ^ keyword.operator.arithmetic.c */
/* ^^^^ meta.number.float.decimal.c */
-/* ^ constant.numeric.value.c */
+/* ^^^ constant.numeric.value.c */
/* ^ punctuation.separator.decimal.c */
-/* ^ constant.numeric.value.c */
/* ^ constant.numeric.suffix.c */
/* ^ keyword.operator.arithmetic.c */
/* ^^^^^^ meta.number.float.decimal.c */
-/* ^ constant.numeric.value.c */
+/* ^^^^^ constant.numeric.value.c */
/* ^ punctuation.separator.decimal.c */
-/* ^ constant.numeric.value.c */
-/* ^^ constant.numeric.value.exponent.c */
/* ^ constant.numeric.suffix.c */
/* ^ keyword.operator.arithmetic.c */
/* ^^^^^^^ meta.number.float.decimal.c */
-/* ^ constant.numeric.value.c */
+/* ^^^^^^ constant.numeric.value.c */
/* ^ punctuation.separator.decimal.c */
-/* ^ constant.numeric.value.c */
-/* ^^^ constant.numeric.value.exponent.c */
/* ^ constant.numeric.suffix.c */
/* ^ keyword.operator.arithmetic.c */
/* ^^^^ meta.number.float.decimal.c */
-/* ^ constant.numeric.value.c */
+/* ^^^ constant.numeric.value.c */
/* ^ punctuation.separator.decimal.c */
-/* ^ constant.numeric.value.c */
/* ^ constant.numeric.suffix.c */
/* ^ keyword.operator.arithmetic.c */
/* ^^^^^^ meta.number.float.decimal.c */
-/* ^ constant.numeric.value.c */
+/* ^^^^^ constant.numeric.value.c */
/* ^ punctuation.separator.decimal.c */
-/* ^ constant.numeric.value.c */
-/* ^^ constant.numeric.value.exponent.c */
/* ^ constant.numeric.suffix.c */
/* ^ keyword.operator.arithmetic.c */
/* ^^^^^^^ meta.number.float.decimal.c */
-/* ^ constant.numeric.value.c */
+/* ^^^^^^ constant.numeric.value.c */
/* ^ punctuation.separator.decimal.c */
-/* ^ constant.numeric.value.c */
-/* ^^^ constant.numeric.value.exponent.c */
/* ^ constant.numeric.suffix.c */
/* ^ punctuation.terminator - constant */
f = 1.e1+1.e-1+1.e1f+1.e-1f+1.e1L+1.e-1L;
/* ^^^^ meta.number.float.decimal.c */
-/* ^ constant.numeric.value.c */
+/* ^^^^ constant.numeric.value.c */
/* ^ punctuation.separator.decimal.c */
-/* ^^ constant.numeric.value.exponent.c */
/* ^ keyword.operator.arithmetic.c */
/* ^^^^^ meta.number.float.decimal.c */
-/* ^ constant.numeric.value.c */
+/* ^^^^^ constant.numeric.value.c */
/* ^ punctuation.separator.decimal.c */
-/* ^^^ constant.numeric.value.exponent.c */
/* ^ keyword.operator.arithmetic.c */
/* ^^^^^ meta.number.float.decimal.c */
-/* ^ constant.numeric.value.c */
+/* ^^^^ constant.numeric.value.c */
/* ^ punctuation.separator.decimal.c */
-/* ^^ constant.numeric.value.exponent.c */
/* ^ constant.numeric.suffix.c */
/* ^ keyword.operator.arithmetic.c */
/* ^^^^^^ meta.number.float.decimal.c */
-/* ^ constant.numeric.value.c */
+/* ^^^^^ constant.numeric.value.c */
/* ^ punctuation.separator.decimal.c */
-/* ^^^ constant.numeric.value.exponent.c */
/* ^ constant.numeric.suffix.c */
/* ^ keyword.operator.arithmetic.c */
/* ^^^^^ meta.number.float.decimal.c */
-/* ^ constant.numeric.value.c */
+/* ^^^^ constant.numeric.value.c */
/* ^ punctuation.separator.decimal.c */
-/* ^^ constant.numeric.value.exponent.c */
/* ^ constant.numeric.suffix.c */
/* ^ keyword.operator.arithmetic.c */
/* ^^^^^^ meta.number.float.decimal.c */
-/* ^ constant.numeric.value.c */
+/* ^^^^^ constant.numeric.value.c */
/* ^ punctuation.separator.decimal.c */
-/* ^^^ constant.numeric.value.exponent.c */
/* ^ constant.numeric.suffix.c */
/* ^ punctuation.terminator - constant */
f = 1.+1.f+1.L+1..;
/* ^^ meta.number.float.decimal.c */
-/* ^ constant.numeric.value.c */
+/* ^^ constant.numeric.value.c */
/* ^ punctuation.separator.decimal.c */
/* ^ keyword.operator.arithmetic.c */
/* ^^^ meta.number.float.decimal.c */
-/* ^ constant.numeric.value.c */
+/* ^^ constant.numeric.value.c */
/* ^ punctuation.separator.decimal.c */
/* ^ constant.numeric.suffix.c */
/* ^ keyword.operator.arithmetic.c */
/* ^^^ meta.number.float.decimal.c */
-/* ^ constant.numeric.value.c */
+/* ^^ constant.numeric.value.c */
/* ^ punctuation.separator.decimal.c */
/* ^ constant.numeric.suffix.c */
/* ^ keyword.operator.arithmetic.c */
@@ -890,83 +861,111 @@ f = 1.+1.f+1.L+1..;
f = 1e1+1e1f+1e1L;
/* ^^^ meta.number.float.decimal.c */
-/* ^ constant.numeric.value.c */
-/* ^^ constant.numeric.value.exponent.c */
+/* ^^^ constant.numeric.value.c */
/* ^ keyword.operator.arithmetic.c */
/* ^^^^ meta.number.float.decimal.c */
-/* ^ constant.numeric.value.c */
-/* ^^ constant.numeric.value.exponent.c */
+/* ^^^ constant.numeric.value.c */
/* ^ constant.numeric.suffix.c */
/* ^ keyword.operator.arithmetic.c */
/* ^^^^ meta.number.float.decimal.c */
-/* ^ constant.numeric.value.c */
-/* ^^ constant.numeric.value.exponent.c */
+/* ^^^ constant.numeric.value.c */
/* ^ constant.numeric.suffix.c */
/* ^ punctuation.terminator - constant */
f = .1+.1e1+.1e-1+.1f+.1e1f+.1e-1f+.1L+.1e1L+.1e-1L;
/* ^^ meta.number.float.decimal.c */
+/* ^^ constant.numeric.value.c */
/* ^ punctuation.separator.decimal.c */
-/* ^ constant.numeric.value.c */
/* ^ keyword.operator.arithmetic.c */
/* ^^^^ meta.number.float.decimal.c */
/* ^ punctuation.separator.decimal.c */
-/* ^ constant.numeric.value.c */
-/* ^^ constant.numeric.value.exponent.c */
+/* ^^^^ constant.numeric.value.c */
/* ^ keyword.operator.arithmetic.c */
/* ^^^^^ meta.number.float.decimal.c */
/* ^ punctuation.separator.decimal.c */
-/* ^ constant.numeric.value.c */
-/* ^^^ constant.numeric.value.exponent.c */
+/* ^^^^^ constant.numeric.value.c */
/* ^ keyword.operator.arithmetic.c */
/* ^^^ meta.number.float.decimal.c */
/* ^ punctuation.separator.decimal.c */
-/* ^ constant.numeric.value.c */
+/* ^^ constant.numeric.value.c */
/* ^ constant.numeric.suffix.c */
/* ^ keyword.operator.arithmetic.c */
/* ^^^^^ meta.number.float.decimal.c */
/* ^ punctuation.separator.decimal.c */
-/* ^ constant.numeric.value.c */
-/* ^^ constant.numeric.value.exponent.c */
+/* ^^^^ constant.numeric.value.c */
/* ^ constant.numeric.suffix.c */
/* ^ keyword.operator.arithmetic.c */
/* ^^^^^^ meta.number.float.decimal.c */
/* ^ punctuation.separator.decimal.c */
-/* ^ constant.numeric.value.c */
-/* ^^^ constant.numeric.value.exponent.c */
+/* ^^^^^ constant.numeric.value.c */
/* ^ constant.numeric.suffix.c */
/* ^^^ meta.number.float.decimal.c */
/* ^ punctuation.separator.decimal.c */
-/* ^ constant.numeric.value.c */
+/* ^^ constant.numeric.value.c */
/* ^ constant.numeric.suffix.c */
/* ^ keyword.operator.arithmetic.c */
/* ^^^^^ meta.number.float.decimal.c */
/* ^ punctuation.separator.decimal.c */
-/* ^ constant.numeric.value.c */
-/* ^^ constant.numeric.value.exponent.c */
+/* ^^^^ constant.numeric.value.c */
/* ^ constant.numeric.suffix.c */
/* ^ keyword.operator.arithmetic.c */
/* ^^^^^^ meta.number.float.decimal.c */
/* ^ punctuation.separator.decimal.c */
-/* ^ constant.numeric.value.c */
-/* ^^^ constant.numeric.value.exponent.c */
+/* ^^^^^ constant.numeric.value.c */
/* ^ constant.numeric.suffix.c */
/* ^ punctuation.terminator - constant */
-f = 1.0suff+1.suff*.0suff/{1suff}
-/* ^^^ meta.number.float.decimal - invalid */
-/* ^^^^ meta.number.float.decimal invalid.illegal.numeric.suffix */
-/* ^ keyword.operator.arithmetic */
-/* ^^ meta.number.float.decimal - invalid */
-/* ^^^^ meta.number.float.decimal invalid.illegal.numeric.suffix */
-/* ^ keyword.operator */
-/* ^^ meta.number.float.decimal - invalid */
-/* ^^^^ meta.number.float.decimal invalid.illegal.numeric.suffix */
-/* ^ keyword.operator.arithmetic */
-/* ^ punctuation.section.block.begin */
-/* ^ meta.number.integer.decimal - invalid */
-/* ^^^^ meta.number.integer.decimal invalid.illegal.numeric.suffix */
-/* ^ punctuation.section.block.end */
+units0 = 1.0suff+1.suff*.0suff/{1suff}
+/* ^^^^^^^ meta.number.float.decimal */
+/* ^^^^ invalid.illegal.numeric.suffix */
+/* ^ keyword.operator.arithmetic */
+/* ^^^^^^ meta.number.float.decimal */
+/* ^^^^ invalid.illegal.numeric.suffix */
+/* ^ keyword.operator */
+/* ^^^^^^ meta.number.float.decimal */
+/* ^^^^ invalid.illegal.numeric.suffix */
+/* ^ keyword.operator.arithmetic */
+/* ^ punctuation.section.block.begin */
+/* ^^^^^ meta.number.integer.decimal */
+/* ^ constant.numeric.value */
+/* ^^^^ invalid.illegal.numeric.suffix */
+/* ^ punctuation.section.block.end */
+
+units1 = 134h + 123.45h;
+/* ^^^^ meta.number.integer.decimal */
+/* ^ invalid.illegal.numeric.suffix */
+/* ^^^ - constant */
+/* ^^^^^^^ meta.number.float.decimal */
+/* ^ punctuation.separator.decimal */
+/* ^ invalid.illegal.numeric.suffix */
+/* ^ punctuation.terminator - constant */
+
+units2 = 147min + 147.min;
+/* ^^^^^^ meta.number.integer.decimal */
+/* ^^^ invalid.illegal.numeric.suffix */
+/* ^^^ - constant */
+/* ^^^^^^^ meta.number.float.decimal */
+/* ^ punctuation.separator.decimal */
+/* ^^^ invalid.illegal.numeric.suffix */
+/* ^ punctuation.terminator - constant */
+
+units3 = 357s + 34.7s;
+/* ^^^^ meta.number.integer.decimal */
+/* ^ invalid.illegal.numeric.suffix */
+/* ^^^ - constant */
+/* ^^^^^ meta.number.float.decimal */
+/* ^ punctuation.separator.decimal */
+/* ^ invalid.illegal.numeric.suffix */
+/* ^ punctuation.terminator - constant */
+
+units4 = 234_custom + 10e-1_custom;
+/* ^^^^^^^^^^ meta.number.integer.decimal */
+/* ^^^ constant.numeric.value */
+/* ^^^^^^^ invalid.illegal.numeric.suffix */
+/* ^^^ - constant */
+/* ^^^^^^^^^^^^ meta.number.float.decimal */
+/* ^^^^^^^ invalid.illegal.numeric.suffix */
+/* ^ punctuation.terminator - constant */
scanf("%ms %as %*[, ]", &buf);
/* ^^^ constant.other.placeholder */
diff --git a/C++/syntax_test_cpp.cpp b/C++/syntax_test_cpp.cpp
index 0597f64c80..2630e8e8c6 100644
--- a/C++/syntax_test_cpp.cpp
+++ b/C++/syntax_test_cpp.cpp
@@ -269,10 +269,10 @@ char str1[] = "abc";
/* ^ string.quoted.double */
/* ^ punctuation.definition.string.end */
-char str2[] = u8"abc";
-/* ^ storage.type.string */
-/* ^ punctuation.definition.string.begin */
-/* ^ string.quoted.double */
+char8_t str2[] = u8"abc";
+/* ^ storage.type.string */
+/* ^ punctuation.definition.string.begin */
+/* ^ string.quoted.double */
char16_t str3[] = u"abc";
/* ^ storage.type.string */
@@ -312,13 +312,16 @@ char str8[] = "\x0a|\x41|\xA|\x000065";
/* ^^^ constant.character.escape */
/* ^^^^^^^^ constant.character.escape */
-char16_t str9[] = u"\u0063";
+char8_t str9[] = u8"\u0063";
/* ^^^^^^ constant.character.escape */
-char32_t str10[] = U"\U00000063";
+char16_t str10[] = u"\u0063";
+/* ^^^^^^ constant.character.escape */
+
+char32_t str11[] = U"\U00000063";
/* ^^^^^^^^^^ constant.character.escape */
-char str11[] = "\q";
+char str12[] = "\q";
/* ^^ invalid.illegal.unknown-escape */
scanf("%ms %as %*[, ]", &buf);
@@ -847,6 +850,12 @@ const int XYZ = 2;
constexpr int ABC = 3 + 5;
/* <- storage.modifier */
+consteval int f() { return 42; }
+/* <- storage.modifier */
+
+constinit const int i = f();
+/* <- storage.modifier */
+
thread_local int x;
/* <- storage.modifier */
@@ -1093,13 +1102,12 @@ hex5 = 0x0+0xFL+0xaull+0xallu+0xfu+0xf'12_4_uz;
hex2 = 0xc1.01AbFp-1+0x1.45c778p+7f;
/* ^^^^^^^^^^^^^ meta.number.float.hexadecimal.c++ */
/* ^^ constant.numeric.base.c++ */
-/* ^^ constant.numeric.value.c++ */
+/* ^^^^^^^^^^^ constant.numeric.value.c++ */
/* ^ punctuation.separator.decimal.c++ */
-/* ^^^^^ constant.numeric.value.c++ */
-/* ^^^ constant.numeric.value.exponent.c++ */
/* ^ keyword.operator.arithmetic - constant.c++ */
/* ^^^^^^^^^^^^^^ meta.number.float.hexadecimal.c++ */
/* ^^ constant.numeric.base.c++ */
+/* ^^^^^^^^^^^ constant.numeric.value.c++ */
/* ^ punctuation.separator.decimal.c++ */
/* ^ constant.numeric.suffix.c++ */
/* ^ punctuation.terminator - constant */
@@ -1124,181 +1132,151 @@ bin3 = 0b1001'1101'0010'1100;
f = 1.1+1.1e1+1.1e-1+1.1f+1.1e1f+1.1e-1f+1.1L+1.1e1L+1.1e-1L;
/* ^^^ meta.number.float.decimal.c++ */
-/* ^ constant.numeric.value.c++ */
+/* ^^^ constant.numeric.value.c++ */
/* ^ punctuation.separator.decimal.c++ */
-/* ^ constant.numeric.value.c++ */
-/* ^ keyword.operator.arithmetic */
+/* ^ keyword.operator.arithmetic.c */
/* ^^^^^ meta.number.float.decimal.c++ */
-/* ^ constant.numeric.value.c++ */
+/* ^^^^^ constant.numeric.value.c++ */
/* ^ punctuation.separator.decimal.c++ */
-/* ^ constant.numeric.value.c++ */
-/* ^^ constant.numeric.value.exponent.c++ */
-/* ^ keyword.operator.arithmetic */
+/* ^ keyword.operator.arithmetic.c */
/* ^^^^^^ meta.number.float.decimal.c++ */
-/* ^ constant.numeric.value.c++ */
+/* ^^^^^^ constant.numeric.value.c++ */
/* ^ punctuation.separator.decimal.c++ */
-/* ^ constant.numeric.value.c++ */
-/* ^^^ constant.numeric.value.exponent.c++ */
-/* ^ keyword.operator.arithmetic */
+/* ^ keyword.operator.arithmetic.c */
/* ^^^^ meta.number.float.decimal.c++ */
-/* ^ constant.numeric.value.c++ */
+/* ^^^ constant.numeric.value.c++ */
/* ^ punctuation.separator.decimal.c++ */
-/* ^ constant.numeric.value.c++ */
/* ^ constant.numeric.suffix.c++ */
-/* ^ keyword.operator.arithmetic */
+/* ^ keyword.operator.arithmetic.c */
/* ^^^^^^ meta.number.float.decimal.c++ */
-/* ^ constant.numeric.value.c++ */
+/* ^^^^^ constant.numeric.value.c++ */
/* ^ punctuation.separator.decimal.c++ */
-/* ^ constant.numeric.value.c++ */
-/* ^^ constant.numeric.value.exponent.c++ */
/* ^ constant.numeric.suffix.c++ */
-/* ^ keyword.operator.arithmetic */
+/* ^ keyword.operator.arithmetic.c */
/* ^^^^^^^ meta.number.float.decimal.c++ */
-/* ^ constant.numeric.value.c++ */
+/* ^^^^^^ constant.numeric.value.c++ */
/* ^ punctuation.separator.decimal.c++ */
-/* ^ constant.numeric.value.c++ */
-/* ^^^ constant.numeric.value.exponent.c++ */
/* ^ constant.numeric.suffix.c++ */
-/* ^ keyword.operator.arithmetic */
+/* ^ keyword.operator.arithmetic.c */
/* ^^^^ meta.number.float.decimal.c++ */
-/* ^ constant.numeric.value.c++ */
+/* ^^^ constant.numeric.value.c++ */
/* ^ punctuation.separator.decimal.c++ */
-/* ^ constant.numeric.value.c++ */
/* ^ constant.numeric.suffix.c++ */
-/* ^ keyword.operator.arithmetic */
+/* ^ keyword.operator.arithmetic.c */
/* ^^^^^^ meta.number.float.decimal.c++ */
-/* ^ constant.numeric.value.c++ */
+/* ^^^^^ constant.numeric.value.c++ */
/* ^ punctuation.separator.decimal.c++ */
-/* ^ constant.numeric.value.c++ */
-/* ^^ constant.numeric.value.exponent.c++ */
/* ^ constant.numeric.suffix.c++ */
-/* ^ keyword.operator.arithmetic */
+/* ^ keyword.operator.arithmetic.c */
/* ^^^^^^^ meta.number.float.decimal.c++ */
-/* ^ constant.numeric.value.c++ */
+/* ^^^^^^ constant.numeric.value.c++ */
/* ^ punctuation.separator.decimal.c++ */
-/* ^ constant.numeric.value.c++ */
-/* ^^^ constant.numeric.value.exponent.c++ */
/* ^ constant.numeric.suffix.c++ */
/* ^ punctuation.terminator - constant */
f = 1.e1+1.e-1+1.e1f+1.e-1f+1.e1L+1.e-1L;
/* ^^^^ meta.number.float.decimal.c++ */
-/* ^ constant.numeric.value.c++ */
+/* ^^^^ constant.numeric.value.c++ */
/* ^ punctuation.separator.decimal.c++ */
-/* ^^ constant.numeric.value.exponent.c++ */
-/* ^ keyword.operator.arithmetic */
+/* ^ keyword.operator.arithmetic.c */
/* ^^^^^ meta.number.float.decimal.c++ */
-/* ^ constant.numeric.value.c++ */
+/* ^^^^^ constant.numeric.value.c++ */
/* ^ punctuation.separator.decimal.c++ */
-/* ^^^ constant.numeric.value.exponent.c++ */
-/* ^ keyword.operator.arithmetic */
+/* ^ keyword.operator.arithmetic.c */
/* ^^^^^ meta.number.float.decimal.c++ */
-/* ^ constant.numeric.value.c++ */
+/* ^^^^ constant.numeric.value.c++ */
/* ^ punctuation.separator.decimal.c++ */
-/* ^^ constant.numeric.value.exponent.c++ */
/* ^ constant.numeric.suffix.c++ */
-/* ^ keyword.operator.arithmetic */
+/* ^ keyword.operator.arithmetic.c */
/* ^^^^^^ meta.number.float.decimal.c++ */
-/* ^ constant.numeric.value.c++ */
+/* ^^^^^ constant.numeric.value.c++ */
/* ^ punctuation.separator.decimal.c++ */
-/* ^^^ constant.numeric.value.exponent.c++ */
/* ^ constant.numeric.suffix.c++ */
-/* ^ keyword.operator.arithmetic */
+/* ^ keyword.operator.arithmetic.c */
/* ^^^^^ meta.number.float.decimal.c++ */
-/* ^ constant.numeric.value.c++ */
+/* ^^^^ constant.numeric.value.c++ */
/* ^ punctuation.separator.decimal.c++ */
-/* ^^ constant.numeric.value.exponent.c++ */
/* ^ constant.numeric.suffix.c++ */
-/* ^ keyword.operator.arithmetic */
+/* ^ keyword.operator.arithmetic.c */
/* ^^^^^^ meta.number.float.decimal.c++ */
-/* ^ constant.numeric.value.c++ */
+/* ^^^^^ constant.numeric.value.c++ */
/* ^ punctuation.separator.decimal.c++ */
-/* ^^^ constant.numeric.value.exponent.c++ */
/* ^ constant.numeric.suffix.c++ */
/* ^ punctuation.terminator - constant */
f = 1.+1.f+1.L+1..;
/* ^^ meta.number.float.decimal.c++ */
-/* ^ constant.numeric.value.c++ */
+/* ^^ constant.numeric.value.c++ */
/* ^ punctuation.separator.decimal.c++ */
-/* ^ keyword.operator.arithmetic */
+/* ^ keyword.operator.arithmetic.c */
/* ^^^ meta.number.float.decimal.c++ */
-/* ^ constant.numeric.value.c++ */
+/* ^^ constant.numeric.value.c++ */
/* ^ punctuation.separator.decimal.c++ */
/* ^ constant.numeric.suffix.c++ */
-/* ^ keyword.operator.arithmetic */
+/* ^ keyword.operator.arithmetic.c */
/* ^^^ meta.number.float.decimal.c++ */
-/* ^ constant.numeric.value.c++ */
+/* ^^ constant.numeric.value.c++ */
/* ^ punctuation.separator.decimal.c++ */
/* ^ constant.numeric.suffix.c++ */
-/* ^ keyword.operator.arithmetic */
+/* ^ keyword.operator.arithmetic.c */
/* ^ meta.number.integer.decimal.c++ */
/* ^ constant.numeric.value.c++ */
-/* ^^ invalid.illegal.syntax */
+/* ^^ invalid.illegal.syntax.c */
/* ^ punctuation.terminator - constant */
f = 1e1+1e1f+1e1L;
/* ^^^ meta.number.float.decimal.c++ */
-/* ^ constant.numeric.value.c++ */
-/* ^^ constant.numeric.value.exponent.c++ */
-/* ^ keyword.operator.arithmetic */
+/* ^^^ constant.numeric.value.c++ */
+/* ^ keyword.operator.arithmetic.c */
/* ^^^^ meta.number.float.decimal.c++ */
-/* ^ constant.numeric.value.c++ */
-/* ^^ constant.numeric.value.exponent.c++ */
+/* ^^^ constant.numeric.value.c++ */
/* ^ constant.numeric.suffix.c++ */
-/* ^ keyword.operator.arithmetic */
+/* ^ keyword.operator.arithmetic.c */
/* ^^^^ meta.number.float.decimal.c++ */
-/* ^ constant.numeric.value.c++ */
-/* ^^ constant.numeric.value.exponent.c++ */
+/* ^^^ constant.numeric.value.c++ */
/* ^ constant.numeric.suffix.c++ */
/* ^ punctuation.terminator - constant */
f = .1+.1e1+.1e-1+.1f+.1e1f+.1e-1f+.1L+.1e1L+.1e-1L;
/* ^^ meta.number.float.decimal.c++ */
+/* ^^ constant.numeric.value.c++ */
/* ^ punctuation.separator.decimal.c++ */
-/* ^ constant.numeric.value.c++ */
-/* ^ keyword.operator.arithmetic */
+/* ^ keyword.operator.arithmetic.c */
/* ^^^^ meta.number.float.decimal.c++ */
/* ^ punctuation.separator.decimal.c++ */
-/* ^ constant.numeric.value.c++ */
-/* ^^ constant.numeric.value.exponent.c++ */
-/* ^ keyword.operator.arithmetic */
+/* ^^^^ constant.numeric.value.c++ */
+/* ^ keyword.operator.arithmetic.c */
/* ^^^^^ meta.number.float.decimal.c++ */
/* ^ punctuation.separator.decimal.c++ */
-/* ^ constant.numeric.value.c++ */
-/* ^^^ constant.numeric.value.exponent.c++ */
-/* ^ keyword.operator.arithmetic */
+/* ^^^^^ constant.numeric.value.c++ */
+/* ^ keyword.operator.arithmetic.c */
/* ^^^ meta.number.float.decimal.c++ */
/* ^ punctuation.separator.decimal.c++ */
-/* ^ constant.numeric.value.c++ */
+/* ^^ constant.numeric.value.c++ */
/* ^ constant.numeric.suffix.c++ */
-/* ^ keyword.operator.arithmetic */
+/* ^ keyword.operator.arithmetic.c */
/* ^^^^^ meta.number.float.decimal.c++ */
/* ^ punctuation.separator.decimal.c++ */
-/* ^ constant.numeric.value.c++ */
-/* ^^ constant.numeric.value.exponent.c++ */
+/* ^^^^ constant.numeric.value.c++ */
/* ^ constant.numeric.suffix.c++ */
-/* ^ keyword.operator.arithmetic */
+/* ^ keyword.operator.arithmetic.c */
/* ^^^^^^ meta.number.float.decimal.c++ */
/* ^ punctuation.separator.decimal.c++ */
-/* ^ constant.numeric.value.c++ */
-/* ^^^ constant.numeric.value.exponent.c++ */
+/* ^^^^^ constant.numeric.value.c++ */
/* ^ constant.numeric.suffix.c++ */
/* ^^^ meta.number.float.decimal.c++ */
/* ^ punctuation.separator.decimal.c++ */
-/* ^ constant.numeric.value.c++ */
+/* ^^ constant.numeric.value.c++ */
/* ^ constant.numeric.suffix.c++ */
-/* ^ keyword.operator.arithmetic */
+/* ^ keyword.operator.arithmetic.c */
/* ^^^^^ meta.number.float.decimal.c++ */
/* ^ punctuation.separator.decimal.c++ */
-/* ^ constant.numeric.value.c++ */
-/* ^^ constant.numeric.value.exponent.c++ */
+/* ^^^^ constant.numeric.value.c++ */
/* ^ constant.numeric.suffix.c++ */
-/* ^ keyword.operator.arithmetic */
+/* ^ keyword.operator.arithmetic.c */
/* ^^^^^^ meta.number.float.decimal.c++ */
/* ^ punctuation.separator.decimal.c++ */
-/* ^ constant.numeric.value.c++ */
-/* ^^^ constant.numeric.value.exponent.c++ */
+/* ^^^^^ constant.numeric.value.c++ */
/* ^ constant.numeric.suffix.c++ */
/* ^ punctuation.terminator - constant */
@@ -1315,6 +1293,22 @@ f = 23e-1'000;
/* ^^^^^^^^^ meta.number.float.decimal */
/* ^ punctuation.terminator - constant */
+units0 = 1.0suff+1.suff*.0suff/{1suff}
+/* ^^^^^^^ meta.number.float.decimal */
+/* ^^^^ constant.numeric.suffix */
+/* ^ keyword.operator.arithmetic */
+/* ^^^^^^ meta.number.float.decimal */
+/* ^^^^ constant.numeric.suffix */
+/* ^ keyword.operator */
+/* ^^^^^^ meta.number.float.decimal */
+/* ^^^^ constant.numeric.suffix */
+/* ^ keyword.operator.arithmetic */
+/* ^ punctuation.section.block.begin */
+/* ^^^^^ meta.number.integer.decimal */
+/* ^ constant.numeric.value */
+/* ^^^^ constant.numeric.suffix */
+/* ^ punctuation.section.block.end */
+
units1 = 134h + 123.45h;
/* ^^^^ meta.number.integer.decimal */
/* ^ constant.numeric.suffix */
diff --git a/CSS/CSS.sublime-syntax b/CSS/CSS.sublime-syntax
index 4b1ca31aa2..ce8bafbdd2 100644
--- a/CSS/CSS.sublime-syntax
+++ b/CSS/CSS.sublime-syntax
@@ -30,7 +30,7 @@ variables:
# matching (?!{{escape}}) which also effects performance negative.
break: (?=[[^-_[:alnum:]\\]&&[[:ascii:]]]|\Z)
- # Identifiers
+ # Identifiers
# https://www.w3.org/TR/css-syntax-3/#typedef-ident-token
# https://www.w3.org/TR/css3-selectors/#lex
ident: (?:{{custom_ident}}|{{generic_ident}})
@@ -52,13 +52,24 @@ variables:
# Units
# https://www.w3.org/TR/css3-values/#lengths
- font_relative_lengths: (?i:em|ex|ch|rem)
- viewport_percentage_lengths: (?i:vw|vh|vmin|vmax)
- absolute_lengths: (?i:cm|mm|q|in|pt|pc|px|fr)
- angle_units: (?i:deg|grad|rad|turn)
- duration_units: (?i:s|ms)
- frequency_units: (?i:Hz|kHz)
- resolution_units: (?i:dpi|dpcm|dppx)
+ units: |-
+ (?x:
+ %
+ | {{absolute_lengths}}
+ | {{angle_units}}
+ | {{duration_units}}
+ | {{font_relative_lengths}}
+ | {{frequency_units}}
+ | {{resolution_units}}
+ | {{viewport_percentage_lengths}}
+ )
+ font_relative_lengths: (?i:em|ex|ch|rem)\b
+ viewport_percentage_lengths: (?i:vw|vh|vmin|vmax)\b
+ absolute_lengths: (?i:cm|mm|q|in|pt|pc|px|fr)\b
+ angle_units: (?i:deg|grad|rad|turn)\b
+ duration_units: (?i:s|ms)\b
+ frequency_units: (?i:Hz|kHz)\b
+ resolution_units: (?i:dpi|dpcm|dppx)\b
# Combinators
# https://drafts.csswg.org/selectors-4/#combinators
@@ -246,6 +257,14 @@ variables:
| upper-alpha | upper-armenian | upper-latin | upper-roman
){{break}}
+ # @counter-style Property Names
+ # https://developer.mozilla.org/en-US/docs/Web/CSS/@counter-style
+ counter_style_property_names: |-
+ \b(?xi:
+ additive-symbols | negative | pad | prefix | range
+ | suffix | symbols (?# | fallback | speak-as | system )
+ ){{break}}
+
# Predefined Counter Speak As Property Constants
# https://drafts.csswg.org/css-counter-styles-3/#counter-style-speak-as
counter_speak_as_constants: |-
@@ -256,6 +275,15 @@ variables:
counter_system_constants: |-
\b(?xi: cyclic | numeric | alphabetic | symbolic | additive | fixed ){{break}}
+ # @font-face Property Names
+ # https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face
+ font_face_property_names: |-
+ \b(?xi:
+ ascent-override | descent-override | font-display | (?# font-family | ) src
+ | font-feature-settings | font-variation-settings | font-stretch | font-style
+ | font-weight | font-variant | line-gap-override | size-adjust | unicode-range
+ ){{break}}
+
# Page Margin Property Names
# https://www.w3.org/TR/css-page-3/#margin-at-rule
page_margin_property_names: |-
@@ -265,90 +293,149 @@ variables:
){{break}}
# Property names are sorted by popularity in descending order.
- # Popularity data taken from https://www.chromestatus.com/metrics/css/popularity
+ # Note:
+ # 1) Popularity data taken from https://www.chromestatus.com/metrics/css/popularity
+ # 2) Properties starting with `alias-` or `webkit-` are removed
property_names: |-
\b(?xi:
- display | width | background-color | height | position | font-family
- | font-weight | font | top | opacity | cursor | background-image | right
- | visibility | box-sizing | user-select | left | float | margin-left
- | margin-top | line-height | padding-left | z-index | margin-bottom
- | margin-right | margin | vertical-align | padding-top | white-space
- | border-radius | padding-bottom | padding-right | padding | bottom | clear
- | max-width | box-shadow | content | border-color | min-height | min-width
- | font-style | border-width | border-collapse | background-size
- | text-overflow | max-height | text-transform | text-shadow | text-indent
- | border-style | overflow-y | list-style-type | word-wrap | border-spacing
- | appearance | zoom | overflow-x | border-top-left-radius
- | border-bottom-left-radius | border-top-color | pointer-events
- | border-bottom-color | align-items | justify-content | letter-spacing
- | border-top-right-radius | border-bottom-right-radius | border-right-width
- | font-smoothing | border-bottom-width | border-right-color | direction
- | border-top-width | src | border-left-color | border-left-width
- | tap-highlight-color | table-layout | background-clip | word-break
- | transform-origin | resize | filter | backface-visibility | text-rendering
- | box-orient | transition-property | transition-duration | word-spacing
- | quotes | outline-offset | animation-timing-function | animation-duration
- | animation-name | transition-timing-function | border-bottom-style
- | border-bottom | transition-delay | transition | unicode-bidi
- | border-top-style | border-top | unicode-range | list-style-position
- | orphans | outline-width | line-clamp | order | flex-direction | box-pack
- | animation-fill-mode | outline-color | list-style-image | list-style
- | touch-action | flex-grow | border-left-style | border-left
- | animation-iteration-count | page-break-inside | box-flex | box-align
- | page-break-after | animation-delay | widows | border-right-style
- | border-right | flex-align | outline-style | outline | background-origin
- | animation-direction | fill-opacity | background-attachment | flex-wrap
- | transform-style | overflow-wrap | animation-play-state | animation
- | will-change | box-ordinal-group | image-rendering | marks | mask-image
- | flex-flow | background-position-y | stroke-width | background-position-x
- | background-position | background-blend-mode | flex-shrink | flex-basis
- | flex-order | flex-item-align | flex-line-pack | flex-negative | flex-pack
- | flex-positive | flex-preferred-size | flex | user-drag | font-stretch
- | column-count | empty-cells | align-self | caption-side | mask-size
- | column-gap | mask-repeat | box-direction | font-feature-settings
- | mask-position | align-content | object-fit | columns | text-fill-color
- | clip-path | stop-color | font-kerning | page-break-before
- | stroke-dasharray | size | fill-rule | border-image-slice | column-width
- | break-inside | column-break-before | border-image-width| stroke-dashoffset
- | border-image-repeat | border-image-outset | line-break | stroke-linejoin
- | stroke-linecap | stroke-miterlimit | stroke-opacity | stroke
- | shape-rendering | border-image-source | border-image | border | tab-size
- | writing-mode | perspective-origin-y | perspective-origin-x
- | perspective-origin | perspective | text-align-last | text-align
- | clip-rule | clip | text-anchor | column-rule-color | box-decoration-break
- | column-fill | fill | column-rule-style | mix-blend-mode
- | text-emphasis-color | baseline-shift | dominant-baseline | page
- | alignment-baseline | column-rule-width | column-rule | break-after
- | font-variant-ligatures | transform-origin-y | transform-origin-x
- | transform | object-position | break-before | column-span | isolation
- | shape-outside | all | color-interpolation-filters | marker | marker-end
- | marker-start | marker-mid | color-rendering | color-interpolation
- | background-repeat-x | background-repeat-y | background-repeat
- | background | mask-type | flood-color | flood-opacity | text-orientation
- | mask-composite | text-emphasis-style | paint-order | lighting-color
- | shape-margin | text-emphasis-position | text-emphasis
- | shape-image-threshold | mask-clip | mask-origin | mask | font-variant-caps
- | font-variant-alternates | font-variant-east-asian | font-variant-numeric
- | font-variant-position | font-variant | font-size-adjust | font-size
- | font-language-override | font-display | font-synthesis | font
- | line-box-contain | text-justify | text-decoration-color
- | text-decoration-style | text-decoration-line | text-decoration
- | text-underline-position | grid-template-rows | grid-template-columns
- | grid-template-areas | grid-template | rotate | scale | translate
- | scroll-behavior | grid-column-start | grid-column-end | grid-column-gap
- | grid-row-start | grid-row-end | grid-auto-rows | grid-area
- | grid-auto-flow | grid-auto-columns | image-orientation | hyphens
- | overflow-scrolling | overflow | color-profile | kerning | nbsp-mode
- | color | image-resolution | grid-row-gap | grid-row | grid-column
- | blend-mode | azimuth | pause-after | pause-before | pause | pitch-range
- | pitch | text-height | system | negative | prefix | suffix | range | pad
- | fallback | additive-symbols | symbols | speak-as | speak | grid-gap | grid
- | justify-items | justify-self
+ width | height | display | position | padding | border | margin | top
+ | left | margin-top | color | font-size | background-color | text-align
+ | opacity | font-weight | font-family | background | overflow | line-height
+ | float | box-sizing | text-decoration | z-index | cursor | margin-left
+ | border-radius | vertical-align | margin-bottom | margin-right | right
+ | padding-top | padding-left | max-width | box-shadow | bottom | content
+ | padding-right | transform | white-space | min-height | padding-bottom
+ | background-image | border-bottom | visibility | outline
+ | background-position | min-width | transition | border-top | border-color
+ | background-repeat | text-transform | background-size | max-height
+ | list-style | clear | font-style | justify-content | border-left
+ | align-items | border-right | border-width | font | text-overflow
+ | overflow-y | pointer-events | border-style | flex-direction | animation
+ | overflow-x | letter-spacing | flex | word-wrap | flex-wrap | fill
+ | transform-origin | list-style-type | border-collapse
+ | border-top-left-radius | border-bottom-left-radius | user-select | clip
+ | text-shadow | border-bottom-right-radius | word-break | flex-grow
+ | border-top-right-radius | border-bottom-color | border-top-color
+ | flex-shrink | align-self | text-rendering | animation-timing-function
+ | direction | background-clip | zoom | border-spacing | text-indent
+ | outline-offset | border-left-color | transition-property
+ | border-right-color | animation-name | stroke | touch-action
+ | animation-duration | transition-delay | filter | overflow-wrap
+ | animation-delay | border-bottom-width | variable | font-variant
+ | flex-basis | transition-duration | border-top-width | animation-fill-mode
+ | object-fit | transition-timing-function | will-change | outline-width
+ | order | outline-style | stroke-width | border-right-width | align-content
+ | resize | table-layout | appearance | animation-iteration-count
+ | border-left-width | flex-flow | stroke-dashoffset | stroke-dasharray
+ | backface-visibility | unicode-bidi | border-bottom-style
+ | text-size-adjust | border-top-style | animation-direction | word-spacing
+ | contain | speak | grid-template-columns | font-feature-settings
+ | perspective | list-style-position | clip-path | image-rendering
+ | font-display | transform-style | border-left-style | outline-color
+ | background-position-x | background-attachment | border-right-style
+ | margin-block-end | background-origin | animation-play-state | hyphens
+ | stroke-linecap | font-stretch | object-position | page-break-inside
+ | column-gap | counter-reset | counter-increment | background-position-y
+ | margin-block-start | size | grid-template-rows | column-count | quotes
+ | padding-inline-end | text-decoration-skip | border-image | all
+ | page-break-after | fill-opacity | font-variant-ligatures
+ | scroll-boundary-behavior | empty-cells | list-style-image | justify-self
+ | overflow-anchor | padding-inline-start | grid-gap | text-decoration-color
+ | margin-inline-start | caret-color | grid-column-gap | aspect-ratio
+ | stroke-opacity | margin-inline-end | grid-column | perspective-origin
+ | caption-side | columns | scroll-behavior | justify-items | line-break
+ | grid-row-gap | column-width | orphans | widows | backdrop-filter
+ | mix-blend-mode | tab-size | stop-color | column-rule | grid-area
+ | stroke-miterlimit | text-align-last | page-break-before
+ | grid-column-start | border-image-slice | border-image-repeat
+ | text-decoration-style | border-image-width | grid-column-end | grid-row
+ | scroll-snap-align | scroll-snap-type | border-image-outset
+ | text-decoration-line | column-fill | border-inline-end-width
+ | border-inline-start-width | grid-row-start | stroke-linejoin
+ | inset-inline-end | inset-inline-start | grid-auto-flow | grid-auto-rows
+ | grid-template-areas | border-image-source | fill-rule | font-kerning
+ | grid-row-end | font-variant-numeric | break-inside | shape-outside
+ | color-scheme | shape-image-threshold | scroll-boundary-behavior-y
+ | text-decoration-skip-ink | page | isolation | background-blend-mode
+ | page-orientation | inset | gap | scroll-snap-margin | column-rule-color
+ | place-items | column-rule-style | shape-rendering | content-visibility
+ | grid-auto-columns | scroll-boundary-behavior-x | writing-mode | clip-rule
+ | font-variant-caps | scroll-padding | text-anchor | mask | row-gap
+ | background-repeat-x | intrinsic-size | text-underline-position
+ | font-variant-east-asian | column-span | vector-effect | dominant-baseline
+ | stop-opacity | break-after | grid-template | break-before | mask-type
+ | scroll-snap-stop | border-inline-start-color | border-inline-end-color | r
+ | alignment-baseline | text-decoration-thickness | column-rule-width | d
+ | image-orientation | rx | text-orientation | cx | baseline-shift
+ | scroll-padding-top | padding-block-start | padding-block-end | cy
+ | min-inline-size | inline-size | background-repeat-y | shape-margin
+ | block-size | marker | min-block-size | paint-order | ry
+ | scroll-snap-margin-top | border-block-end-color | border-block-end-width
+ | border-inline-start-style | border-inline-end-style
+ | border-block-end-style | font-variation-settings
+ | border-block-start-width | border-block-start-color
+ | border-block-start-style | place-content | y | x | ruby-position
+ | text-combine-upright | color-interpolation-filters | color-interpolation
+ | color-rendering | transform-box | marker-end | flood-color | marker-start
+ | marker-mid | flood-opacity | lighting-color | forced-color-adjust
+ | buffered-rendering | place-self | offset-path | scroll-padding-left
+ | offset-distance | offset-rotate | text-underline-offset | max-inline-size
+ | max-block-size | border-inline-end | scroll-snap-margin-inline-start
+ | scroll-padding-inline-start | scroll-snap-margin-block-end
+ | scroll-snap-margin-block-start | scroll-padding-block-end
+ | scroll-snap-margin-inline-end | scroll-padding-block-start
+ | scroll-padding-inline-end | font-optical-sizing | grid
+ | scroll-padding-bottom | scroll-snap-margin-left | inset-block-end
+ | overscroll-behavior-block | overscroll-behavior-inline | inset-block-start
+ | scroll-snap-margin-right | scroll-padding-right
+ | scroll-snap-margin-bottom | border-inline-start | margin-inline
+ | border-end-start-radius | border-end-end-radius | margin-block
+ | border-start-start-radius | border-start-end-radius | padding-inline
+ | counter-set | padding-block | border-block-end | offset
+ | border-block-start | inset-inline | inset-block | scroll-snap-margin-block
+ | scroll-padding-inline | scroll-padding-block | scroll-snap-margin-inline
+ | border-block | offset-rotation | border-inline | border-block-color
+ | border-inline-width | border-inline-color | border-block-style
+ | border-block-width | border-inline-style | motion | motion-offset
+ | motion-path | font-size-adjust | text-justify | scale | scrollbar-gutter
+ | animation-timeline | rotate | translate | snap-height | math-style
+ | math-shift | math-depth | offset-anchor | offset-position
+ | glyph-orientation-vertical | internal-callback | text-line-through
+ | text-line-through-color | text-line-through-mode | text-line-through-style
+ | text-line-through-width | text-overline | text-overline-color
+ | text-overline-mode | text-overline-style | text-overline-width
+ | text-underline | text-underline-color | text-underline-mode
+ | text-underline-style | text-underline-width | shape-inside | shape-padding
+ | enable-background | color-profile | glyph-orientation-horizontal | kerning
+ | image-resolution | max-zoom | min-zoom | orientation | user-zoom
+ | mask-source-type | touch-action-delay | scroll-blocks-on | motion-rotation
+ | scroll-snap-points-x | scroll-snap-points-y | scroll-snap-coordinate
+ | scroll-snap-destination | apply-at-rule | viewport-fit | overflow-block
+ | syntax | content-size | intrinsic-block-size | intrinsic-height
+ | intrinsic-inline-size | intrinsic-width | render-subtree
+ | origin-trial-test-property | subtree-visibility
+ | math-superscript-shift-style | start
+ # END OF QUERY RESULTS
+ # BEGIN OF legacy properties which existed before the last query
+ | box-direction | line-box-contain | mask-image | mask-origin | flex-order
+ | font-synthesis | line-clamp | flex-negative | blend-mode
+ | font-variant-position | flex-align | column-break-before
+ | flex-item-align | azimuth | user-drag | mask-repeat | box-flex
+ | flex-preferred-size | font-language-override | box-align
+ | text-emphasis-color | box-ordinal-group | mask-composite
+ | transform-origin-y | pause | tap-highlight-color | text-fill-color
+ | text-emphasis-style | transform-origin-x | text-emphasis-position
+ | box-pack | box-decoration-break | box-orient
+ | text-emphasis | mask-clip | nbsp-mode | pause-after | pitch
+ | text-height | mask-position | flex-line-pack | perspective-origin-x
+ | mask-size | font-variant-alternates | perspective-origin-y
+ | font-smoothing | overflow-scrolling | flex-positive | pitch-range
){{break}}
property_value_constants: |-
(?x:
- {{font_property_constants}}
+ {{font_display_constants}}
+ | {{font_property_constants}}
| {{font_size_constants}}
| {{font_style_constants}}
| {{unsorted_property_constants}}
@@ -365,7 +452,7 @@ variables:
| avoid(-column|-page|-region)?
| background(-color|-image|-position|-size)?
| backwards|balance|baseline|below|bevel|bicubic|bidi-override|blink
- | block(-line-height)?
+ | block-line-height
| blur
| border(-bottom|-left|-right|-top)?-(color|radius|width|style)
| border-(bottom|top)-(left|right)-radius
@@ -512,6 +599,12 @@ variables:
| zoom(-in|-out)?
){{break}}
+ # https://www.w3.org/TR/css-fonts-4/#font-display-desc
+ font_display_constants: |-
+ \b(?xi:
+ block | swap | fallback | optional
+ ){{break}}
+
# Generic Font Families
font_family_constants: |-
\b(?xi:
@@ -528,13 +621,13 @@ variables:
# https://www.w3.org/TR/CSS22/fonts.html#font-shorthand
font_property_constants: |-
\b(?xi:
- caption | icon | menu | message-box | small-caption | status-bar
+ caption | icon | menu | message-box | small-caption | status-bar
){{break}}
# https://www.w3.org/TR/CSS22/fonts.html#font-size-props
font_size_constants: |-
\b(?xi:
- larger | large | medium | small | smaller | x{1,2}-(?: large | small )
+ larger | large | medium | small | smaller | x{1,2}-(?: large | small )
){{break}}
# https://www.w3.org/TR/CSS22/fonts.html#font-boldness
@@ -542,7 +635,7 @@ variables:
# https://www.w3.org/TR/CSS22/fonts.html#small-caps
font_style_constants: |-
\b(?xi:
- normal | bold | bolder | lighter | italic | oblique | small-caps
+ normal | bold | bolder | lighter | italic | oblique | small-caps
){{break}}
###############################################################################
@@ -622,16 +715,35 @@ contexts:
at-counter-style-content:
- meta_scope: meta.at-rule.counter-style.css
- - include: rule-list
+ - match: \{
+ scope: punctuation.section.block.begin.css
+ push: at-counter-style-block-content
- include: at-counter-style-names
- include: at-rule-end
+ at-counter-style-block-content:
+ - meta_scope: meta.property-list.css meta.block.css
+ - include: block-end2
+ - include: comments
+ - include: at-counter-style-property-names
+ - include: property-values
+ - include: rule-terminators
+ - include: illegal-blocks
+ - include: illegal-groups
+
at-counter-style-names:
- match: '{{counter_style_illegal_names}}'
scope: invalid.illegal.identifier.css
- match: '{{ident}}'
scope: entity.other.counter-style-name.css
+ at-counter-style-property-names:
+ - include: counter-style-fallback-properties
+ - include: counter-style-system-properties
+ - include: counter-style-speak-as-properties
+ - match: '{{counter_style_property_names}}'
+ scope: meta.property-name.css support.type.property-name.css
+
# @custom-media
# https://??
at-custom-media:
@@ -683,9 +795,28 @@ contexts:
at-font-face-content:
- meta_scope: meta.at-rule.font-face.css
- - include: rule-list
+ - match: \{
+ scope: punctuation.section.block.begin.css
+ push: at-font-face-block-content
- include: at-rule-end
+ at-font-face-block-content:
+ - meta_scope: meta.property-list.css meta.block.css
+ - include: block-end2
+ - include: comments
+ - include: at-font-face-property-names
+ - include: property-values
+ - include: rule-terminators
+ - include: illegal-blocks
+ - include: illegal-groups
+
+ at-font-face-property-names:
+ - match: \b(?i:font-family){{break}}
+ scope: meta.property-name.css support.type.property-name.css
+ push: font-property-value
+ - match: '{{font_face_property_names}}'
+ scope: meta.property-name.css support.type.property-name.css
+
# @import
# https://www.w3.org/TR/css-cascade-4/#at-ruledef-import
at-import:
@@ -954,6 +1085,7 @@ contexts:
| (?: device- )? (?: height | width | aspect-ratio | pixel-ratio )
)
| (?:any-)?(?: pointer | hover )
+ | prefers-(?: reduced-motion | color-scheme )
| display-mode | grid | orientation | scan | scripting
| overflow-(?: block | inline )
)
@@ -984,6 +1116,8 @@ contexts:
| optional-paged | paged | scroll
# pointer:
| coarse | fine
+ # prefers-color-scheme:
+ | dark | light
# scan:
| interlace | progressive
# scripting:
@@ -1013,7 +1147,7 @@ contexts:
###[ SELECTORS ]###############################################################
selectors:
- - match: (?=[:.*#[:alpha:]\[])
+ - match: (?=[:.*#[:alpha:]\[]|{{combinators}})
push: selector-content
selector-content:
@@ -1231,7 +1365,7 @@ contexts:
# Functional Pseudo Classes with selector list
pseudo-class-function-with-selector-args:
- - match: (?i:matches|not|has)(?=\()
+ - match: (?i:matches|is|where|not|has)(?=\()
scope: meta.function-call.identifier.css entity.other.pseudo-class.css
set:
- meta_include_prototype: false
@@ -1321,9 +1455,6 @@ contexts:
- include: vendor-prefixes
# specific properties with special treatment
- include: counter-property
- - include: counter-style-fallback-property
- - include: counter-style-system-property
- - include: counter-style-speak-as-property
- include: font-property
# common properties
- include: builtin-property
@@ -1439,10 +1570,10 @@ contexts:
# Counter Style Fallback
# https://drafts.csswg.org/css-counter-styles-3/#counter-style-fallback
- counter-style-fallback-property:
+ counter-style-fallback-properties:
- match: \b(?i:fallback){{break}}
- scope: support.type.property-name.css
- set: counter-style-fallback-property-value
+ scope: meta.property-name.css support.type.property-name.css
+ push: counter-style-fallback-property-value
counter-style-fallback-property-value:
- match: ':'
@@ -1467,10 +1598,10 @@ contexts:
# Counter Style System
# https://drafts.csswg.org/css-counter-styles-3/#counter-style-system
- counter-style-system-property:
+ counter-style-system-properties:
- match: \b(?i:system){{break}}
- scope: support.type.property-name.css
- set: counter-style-system-property-value
+ scope: meta.property-name.css support.type.property-name.css
+ push: counter-style-system-property-value
counter-style-system-property-value:
- match: ':'
@@ -1502,10 +1633,10 @@ contexts:
# Counter Style Speak As
# https://drafts.csswg.org/css-counter-styles-3/#counter-style-speak-as
- counter-style-speak-as-property:
+ counter-style-speak-as-properties:
- match: \b(?i:speak-as){{break}}
- scope: support.type.property-name.css
- set: counter-style-speak-as-property-value
+ scope: meta.property-name.css support.type.property-name.css
+ push: counter-style-speak-as-property-value
counter-style-speak-as-property-value:
- match: ':'
@@ -1701,6 +1832,7 @@ contexts:
- meta_scope: meta.function-call.arguments.css meta.group.css
- include: function-arguments-common
- include: comma-delimiters
+ - include: calc-functions
- include: percentage-constants
- include: scalar-constants
@@ -1718,6 +1850,7 @@ contexts:
- meta_scope: meta.function-call.arguments.css meta.group.css
- include: function-arguments-common
- include: comma-delimiters
+ - include: calc-functions
- include: angle-constants
- include: percentage-constants
- include: scalar-constants
@@ -1734,6 +1867,7 @@ contexts:
- meta_scope: meta.function-call.arguments.css meta.group.css
- include: function-arguments-common
- include: comma-delimiters
+ - include: calc-functions
- include: percentage-constants
- include: scalar-constants
@@ -1749,6 +1883,7 @@ contexts:
- meta_scope: meta.function-call.arguments.css meta.group.css
- include: function-arguments-common
- include: comma-delimiters
+ - include: calc-functions
- include: color-adjuster-functions # must be included before `color-values`
- include: color-values
- include: percentage-constants
@@ -1766,6 +1901,7 @@ contexts:
- meta_scope: meta.function-call.arguments.css meta.group.css
- include: function-arguments-common
- include: comma-delimiters
+ - include: calc-functions
- include: color-adjuster-functions # must be included before `color-values`
- include: color-values
- include: angle-constants
@@ -1784,6 +1920,7 @@ contexts:
set:
- meta_scope: meta.function-call.arguments.css meta.group.css
- include: function-arguments-common
+ - include: calc-functions
- include: color-adjuster-operators
- include: percentage-constants
- include: scalar-constants
@@ -1798,6 +1935,7 @@ contexts:
set:
- meta_scope: meta.function-call.arguments.css meta.group.css
- include: function-arguments-common
+ - include: calc-functions
- include: color-adjuster-operators
- include: angle-constants
@@ -1811,6 +1949,7 @@ contexts:
set:
- meta_scope: meta.function-call.arguments.css meta.group.css
- include: function-arguments-common
+ - include: calc-functions
- include: color-adjuster-operators
- include: percentage-constants
@@ -1826,6 +1965,7 @@ contexts:
set:
- meta_scope: meta.function-call.arguments.css meta.group.css
- include: function-arguments-common
+ - include: calc-functions
- include: percentage-constants
# blend(), blenda() - Not yet implemented by browsers
@@ -1838,10 +1978,11 @@ contexts:
set:
- meta_scope: meta.function-call.arguments.css meta.group.css
- include: function-arguments-common
- - match: \b(?i:rgb|hsl|hwb){{break}}
- scope: keyword.other.color-space.css
+ - include: calc-functions
- include: color-values
- include: percentage-constants
+ - match: \b(?i:rgb|hsl|hwb){{break}}
+ scope: keyword.other.color-space.css
###[ BUILTIN FILTER FUNCTIONS ]################################################
@@ -1876,6 +2017,7 @@ contexts:
set:
- meta_scope: meta.function-call.arguments.css meta.group.css
- include: function-arguments-common
+ - include: calc-functions
- include: length-constants
# brightness(), contrast(), grayscale(), invert(), opacity(), saturate(), sepia()
@@ -1889,6 +2031,7 @@ contexts:
set:
- meta_scope: meta.function-call.arguments.css meta.group.css
- include: function-arguments-common
+ - include: calc-functions
- include: percentage-constants
- include: scalar-constants
@@ -1903,6 +2046,7 @@ contexts:
set:
- meta_scope: meta.function-call.arguments.css meta.group.css
- include: function-arguments-common
+ - include: calc-functions
- include: color-values
- include: length-constants
@@ -1917,6 +2061,7 @@ contexts:
set:
- meta_scope: meta.function-call.arguments.css meta.group.css
- include: function-arguments-common
+ - include: calc-functions
- include: angle-constants
###[ BUILTIN GRID FUNCTIONS ]##################################################
@@ -1934,6 +2079,7 @@ contexts:
- meta_scope: meta.function-call.arguments.css meta.group.css
- include: function-arguments-common
- include: comma-delimiters
+ - include: calc-functions
- include: grid-constants
- include: length-constants
- include: percentage-constants
@@ -1953,6 +2099,7 @@ contexts:
- include: comma-delimiters
- match: \b(?i:auto-fill|auto-fit){{break}}
scope: keyword.other.grid.css
+ - include: calc-functions
- include: minmax-functions
- include: grid-constants
- include: length-constants
@@ -2024,10 +2171,33 @@ contexts:
# Gradient Functions
# https://drafts.csswg.org/css-images-3/#gradients
gradient-functions:
+ # conic-gradient()
+ # https://developer.mozilla.org/en-US/docs/Web/CSS/conic-gradient()
+ # repeating-conic-gradient()
+ # https://developer.mozilla.org/en-US/docs/Web/CSS/repeating-conic-gradient()
+ - match: \b((?:repeating-)?conic-gradient)(?=\()
+ scope: meta.function-call.identifier.css support.function.gradient.css
+ push:
+ - meta_include_prototype: false
+ - match: \(
+ scope: punctuation.section.group.begin.css
+ set:
+ - meta_scope: meta.function-call.arguments.css meta.group.css
+ - include: function-arguments-common
+ - include: comma-delimiters
+ - match: \b(?i:at|from){{break}}
+ scope: keyword.other.gradient.css
+ - match: \b(?i:bottom|center|left|right|top){{break}}
+ scope: support.constant.property-value.css
+ - include: color-values
+ - include: angle-constants
+ - include: length-constants
+ - include: percentage-constants
+
# linear-gradient()
- # https://drafts.csswg.org/css-images-3/#linear-gradients
+ # https://developer.mozilla.org/en-US/docs/Web/CSS/linear-gradient()
# repeating-linear-gradient()
- # https://drafts.csswg.org/css-images-3/#funcdef-repeating-linear-gradient
+ # https://developer.mozilla.org/en-US/docs/Web/CSS/repeating-linear-gradient()
- match: \b((?:repeating-)?linear-gradient)(?=\()
scope: meta.function-call.identifier.css support.function.gradient.css
push:
@@ -2040,7 +2210,7 @@ contexts:
- include: comma-delimiters
- match: \b(?i:to){{break}}
scope: keyword.other.gradient.css
- - match: \b(?i:top|right|bottom|left){{break}}
+ - match: \b(?i:bottom|left|right|top){{break}}
scope: support.constant.property-value.css
- include: color-values
- include: angle-constants
@@ -2048,9 +2218,9 @@ contexts:
- include: percentage-constants
# radial-gradient()
- # https://drafts.csswg.org/css-images-3/#radial-gradients
+ # https://developer.mozilla.org/en-US/docs/Web/CSS/radial-gradient()
# repeating-radial-gradient()
- # https://drafts.csswg.org/css-images-3/#funcdef-repeating-radial-gradient
+ # https://developer.mozilla.org/en-US/docs/Web/CSS/repeating-radial-gradient()
- match: \b((?:repeating-)?radial-gradient)(?=\()
scope: meta.function-call.identifier.css support.function.gradient.css
push:
@@ -2063,7 +2233,7 @@ contexts:
- include: comma-delimiters
- match: \b(?i:at|circle|ellipse){{break}}
scope: keyword.other.gradient.css
- - match: \b(?i:left|center|right|top|bottom|(closest|farthest)-(corner|side)){{break}}
+ - match: \b(?i:bottom|center|left|right|top|(closest|farthest)-(corner|side)){{break}}
scope: support.constant.property-value.css
- include: color-values
- include: length-constants
@@ -2087,6 +2257,7 @@ contexts:
- include: function-arguments-common
- match: \b(?i:auto){{break}}
scope: support.constant.property-value.css
+ - include: calc-functions
- include: length-constants
# inset()
@@ -2102,6 +2273,7 @@ contexts:
- include: function-arguments-common
- match: \b(?i:round){{break}}
scope: keyword.other.shape.css
+ - include: calc-functions
- include: length-constants
- include: percentage-constants
@@ -2122,6 +2294,7 @@ contexts:
scope: keyword.other.shape.css
- match: \b(?i:top|right|bottom|left|center|closest-side|farthest-side){{break}}
scope: support.constant.property-value.css
+ - include: calc-functions
- include: length-constants
- include: percentage-constants
@@ -2160,6 +2333,7 @@ contexts:
- meta_scope: meta.function-call.arguments.css meta.group.css
- include: function-arguments-common
- include: comma-delimiters
+ - include: calc-functions
- include: scalar-constants
# steps()
@@ -2174,6 +2348,7 @@ contexts:
- meta_scope: meta.function-call.arguments.css meta.group.css
- include: function-arguments-common
- include: comma-delimiters
+ - include: calc-functions
- match: \b(?i:end|middle|start){{break}}
scope: keyword.other.timing.css
- include: scalar-integer-constants
@@ -2195,6 +2370,7 @@ contexts:
- meta_scope: meta.function-call.arguments.css meta.group.css
- include: function-arguments-common
- include: comma-delimiters
+ - include: calc-functions
- include: scalar-constants
# transform functions with comma separated or types
@@ -2209,6 +2385,7 @@ contexts:
- meta_scope: meta.function-call.arguments.css meta.group.css
- include: function-arguments-common
- include: comma-delimiters
+ - include: calc-functions
- include: percentage-constants
- include: length-constants
- include: scalar-constants
@@ -2224,6 +2401,7 @@ contexts:
set:
- meta_scope: meta.function-call.arguments.css meta.group.css
- include: function-arguments-common
+ - include: calc-functions
- include: percentage-constants
- include: length-constants
- include: scalar-constants
@@ -2239,6 +2417,7 @@ contexts:
set:
- meta_scope: meta.function-call.arguments.css meta.group.css
- include: function-arguments-common
+ - include: calc-functions
- include: angle-constants
# transform functions with comma separated types
@@ -2253,6 +2432,7 @@ contexts:
- meta_scope: meta.function-call.arguments.css meta.group.css
- include: function-arguments-common
- include: comma-delimiters
+ - include: calc-functions
- include: angle-constants
# transform functions with a single type
@@ -2266,6 +2446,7 @@ contexts:
set:
- meta_scope: meta.function-call.arguments.css meta.group.css
- include: function-arguments-common
+ - include: calc-functions
- include: length-constants
# transform functions with a comma separated or types
@@ -2280,6 +2461,7 @@ contexts:
- meta_scope: meta.function-call.arguments.css meta.group.css
- include: function-arguments-common
- include: comma-delimiters
+ - include: calc-functions
- include: angle-constants
- include: scalar-constants
@@ -2295,6 +2477,7 @@ contexts:
- meta_scope: meta.function-call.arguments.css meta.group.css
- include: function-arguments-common
- include: comma-delimiters
+ - include: calc-functions
- include: scalar-constants
###[ BUILTIN VALUE FUNCTIONS ]#################################################
@@ -2326,25 +2509,16 @@ contexts:
- meta_scope: meta.function-call.arguments.css meta.group.css
- include: function-arguments-common
- include: comma-delimiters
- - match: |-
- \b(?x:
- {{font_relative_lengths}}
- | {{viewport_percentage_lengths}}
- | {{absolute_lengths}}
- | {{angle_units}}
- | {{duration_units}}
- | {{frequency_units}}
- | {{resolution_units}}
- ){{break}}
+ - match: '{{units}}'
scope: keyword.other.unit.css
- include: color-values
- include: common-constants
- include: generic-font-names
- include: numeric-constants
- # calc()
- # https://www.w3.org/TR/css3-values/#funcdef-calc
calc-functions:
+ # calc()
+ # https://www.w3.org/TR/css3-values/#funcdef-calc
- match: \b(?i:calc)(?=\()
scope: meta.function-call.identifier.css support.function.calc.css
push:
@@ -2355,6 +2529,23 @@ contexts:
- meta_scope: meta.function-call.arguments.css meta.group.css
- include: calc-function-arguments-content
+ # clamp()
+ # https://developer.mozilla.org/en-US/docs/Web/CSS/clamp()
+ # max()
+ # https://developer.mozilla.org/en-US/docs/Web/CSS/max()
+ # min()
+ # https://developer.mozilla.org/en-US/docs/Web/CSS/min()
+ - match: \b(?i:clamp|max|min)(?=\()
+ scope: meta.function-call.identifier.css support.function.calc.css
+ push:
+ - meta_include_prototype: false
+ - match: \(
+ scope: punctuation.section.group.begin.css
+ set:
+ - meta_scope: meta.function-call.arguments.css meta.group.css
+ - include: calc-function-arguments-content
+ - include: comma-delimiters
+
calc-function-arguments-content:
- meta_scope: meta.group.css
- match: \)
@@ -2368,7 +2559,21 @@ contexts:
- include: attr-functions
- include: calc-functions
- include: var-functions
- - include: numeric-constants
+ - match: '{{float}}({{units}})?'
+ scope: meta.number.float.decimal.css
+ captures:
+ 1: keyword.operator.arithmetic.css
+ 2: constant.numeric.value.css
+ 3: punctuation.separator.decimal.css
+ 4: constant.numeric.suffix.css
+ push: maybe-illegal-operator
+ - match: '{{integer}}({{units}})?'
+ scope: meta.number.integer.decimal.css
+ captures:
+ 1: keyword.operator.arithmetic.css
+ 2: constant.numeric.value.css
+ 3: constant.numeric.suffix.css
+ push: maybe-illegal-operator
- match: '[-+*/]'
scope: keyword.operator.arithmetic.css
@@ -2385,6 +2590,7 @@ contexts:
- meta_scope: meta.function-call.arguments.css meta.group.css
- include: function-arguments-common
- include: comma-delimiters
+ - include: calc-functions
- include: vendor-prefixes
- include: color-values
- include: common-constants
@@ -2454,6 +2660,8 @@ contexts:
set:
- meta_scope: meta.function-call.arguments.css meta.group.css
- include: function-arguments-common
+ - include: comma-delimiters
+ - include: calc-functions
- include: quoted-strings
- include: numeric-constants
- include: other-constants
@@ -2518,13 +2726,19 @@ contexts:
# https://www.w3.org/TR/css3-values/#numeric-constantss
numeric-constants:
- - include: angle-constants
- - include: frequency-constants
- - include: length-constants
- - include: resolution-constants
- - include: percentage-constants
- - include: time-constants
- - include: scalar-constants
+ - match: '{{float}}({{units}})?'
+ scope: meta.number.float.decimal.css
+ captures:
+ 1: keyword.operator.arithmetic.css
+ 2: constant.numeric.value.css
+ 3: punctuation.separator.decimal.css
+ 4: constant.numeric.suffix.css
+ - match: '{{integer}}({{units}})?'
+ scope: meta.number.integer.decimal.css
+ captures:
+ 1: keyword.operator.arithmetic.css
+ 2: constant.numeric.value.css
+ 3: constant.numeric.suffix.css
# Make sure `scalar-constants` is included after any other numeric values
# as `scalar-constants` will consume all numeric values.
@@ -2539,7 +2753,6 @@ contexts:
1: keyword.operator.arithmetic.css
2: constant.numeric.value.css
3: punctuation.separator.decimal.css
- push: maybe-illegal-operator
scalar-integer-constants:
- match: '{{integer}}'
@@ -2547,7 +2760,6 @@ contexts:
captures:
1: keyword.operator.arithmetic.css
2: constant.numeric.value.css
- push: maybe-illegal-operator
scalar-rational-constants:
- match: \d+(/)\d+
@@ -2556,78 +2768,68 @@ contexts:
1: keyword.operator.arithmetic.css
angle-constants:
- - match: '{{float}}({{angle_units}})\b'
+ - match: '{{float}}({{angle_units}})'
scope: meta.number.float.decimal.css
captures:
1: keyword.operator.arithmetic.css
2: constant.numeric.value.css
3: punctuation.separator.decimal.css
4: constant.numeric.suffix.css
- push: maybe-illegal-operator
- - match: '{{integer}}({{angle_units}})\b'
+ - match: '{{integer}}({{angle_units}})'
scope: meta.number.integer.decimal.css
captures:
1: keyword.operator.arithmetic.css
2: constant.numeric.value.css
3: constant.numeric.suffix.css
- push: maybe-illegal-operator
- match: \b0\b(?!%)
scope: meta.number.integer.decimal.css constant.numeric.value.css
- push: maybe-illegal-operator
frequency-constants:
- - match: '{{float}}({{frequency_units}})\b'
+ - match: '{{float}}({{frequency_units}})'
scope: meta.number.float.decimal.css
captures:
1: keyword.operator.arithmetic.css
2: constant.numeric.value.css
3: punctuation.separator.decimal.css
4: constant.numeric.suffix.css
- push: maybe-illegal-operator
- - match: '{{integer}}({{frequency_units}})\b'
+ - match: '{{integer}}({{frequency_units}})'
scope: meta.number.integer.decimal.css
captures:
1: keyword.operator.arithmetic.css
2: constant.numeric.value.css
3: constant.numeric.suffix.css
- push: maybe-illegal-operator
length-constants:
- - match: '{{float}}({{font_relative_lengths}}|{{viewport_percentage_lengths}}|{{absolute_lengths}})\b'
+ - match: '{{float}}({{font_relative_lengths}}|{{viewport_percentage_lengths}}|{{absolute_lengths}})'
scope: meta.number.float.decimal.css
captures:
1: keyword.operator.arithmetic.css
2: constant.numeric.value.css
3: punctuation.separator.decimal.css
4: constant.numeric.suffix.css
- push: maybe-illegal-operator
- - match: '{{integer}}({{font_relative_lengths}}|{{viewport_percentage_lengths}}|{{absolute_lengths}})\b'
+ - match: '{{integer}}({{font_relative_lengths}}|{{viewport_percentage_lengths}}|{{absolute_lengths}})'
scope: meta.number.integer.decimal.css
captures:
1: keyword.operator.arithmetic.css
2: constant.numeric.value.css
3: constant.numeric.suffix.css
- push: maybe-illegal-operator
- match: \b0\b(?!%)
scope: meta.number.integer.decimal.css constant.numeric.value.css
- push: maybe-illegal-operator
resolution-constants:
- - match: '{{float}}({{resolution_units}})\b'
+ - match: '{{float}}({{resolution_units}})'
scope: meta.number.float.decimal.css
captures:
1: keyword.operator.arithmetic.css
2: constant.numeric.value.css
3: punctuation.separator.decimal.css
4: constant.numeric.suffix.css
- push: maybe-illegal-operator
- - match: '{{integer}}({{resolution_units}})\b'
+ - match: '{{integer}}({{resolution_units}})'
scope: meta.number.integer.decimal.css
captures:
1: keyword.operator.arithmetic.css
2: constant.numeric.value.css
3: constant.numeric.suffix.css
- push: maybe-illegal-operator
percentage-constants:
- match: '{{float}}(%)'
@@ -2637,31 +2839,27 @@ contexts:
2: constant.numeric.value.css
3: punctuation.separator.decimal.css
4: constant.numeric.suffix.css
- push: maybe-illegal-operator
- match: '{{integer}}(%)'
scope: meta.number.integer.decimal.css
captures:
1: keyword.operator.arithmetic.css
2: constant.numeric.value.css
3: constant.numeric.suffix.css
- push: maybe-illegal-operator
time-constants:
- - match: '{{float}}({{duration_units}})\b'
+ - match: '{{float}}({{duration_units}})'
scope: meta.number.float.decimal.css
captures:
1: keyword.operator.arithmetic.css
2: constant.numeric.value.css
3: punctuation.separator.decimal.css
4: constant.numeric.suffix.css
- push: maybe-illegal-operator
- - match: '{{integer}}({{duration_units}})\b'
+ - match: '{{integer}}({{duration_units}})'
scope: meta.number.integer.decimal.css
captures:
1: keyword.operator.arithmetic.css
2: constant.numeric.value.css
3: constant.numeric.suffix.css
- push: maybe-illegal-operator
# Unicode Ranges
# https://www.w3.org/TR/css-syntax-3/#urange
@@ -2820,7 +3018,7 @@ contexts:
scope: constant.character.escape.url.css
captures:
1: punctuation.definition.escape.css
- - match: '[/&?]|://'
+ - match: '[/&?#]|://'
scope: punctuation.separator.path.css
###[ OPERATORS ]###############################################################
diff --git a/CSS/Completion Rules.tmPreferences b/CSS/Completion Rules.tmPreferences
deleted file mode 100644
index 42f1748b04..0000000000
--- a/CSS/Completion Rules.tmPreferences
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
- scope
- source.css meta.selector
- settings
-
- cancelCompletion
- .*
-
-
-
diff --git a/CSS/Default.sublime-keymap b/CSS/Default.sublime-keymap
index ba5b5d3617..1ccfca4d14 100644
--- a/CSS/Default.sublime-keymap
+++ b/CSS/Default.sublime-keymap
@@ -73,6 +73,26 @@
]
},
+ // Expand /*|*/ to /* | */ when space is pressed
+ { "keys": [" "], "command": "insert_snippet", "args": {"contents": " $0 "}, "context":
+ [
+ { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
+ { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
+ { "key": "selector", "operator": "equal", "operand": "source.css comment", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "/\\*$", "match_all": true },
+ { "key": "following_text", "operator": "regex_contains", "operand": "^\\*/", "match_all": true }
+ ]
+ },
+ { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Left Right.sublime-macro"}, "context":
+ [
+ { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
+ { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
+ { "key": "selector", "operator": "equal", "operand": "source.css comment", "match_all": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "/\\* $", "match_all": true },
+ { "key": "following_text", "operator": "regex_contains", "operand": "^ \\*/", "match_all": true }
+ ]
+ },
+
// Auto-pair double quotes (also if followed by comma or semicolon)
// Example: key: |; -> key: "|";
{ "keys": ["\""], "command": "insert_snippet", "args": {"contents": "\"$0\""}, "context":
diff --git a/CSS/css_completions.py b/CSS/css_completions.py
index 2fbb9400e1..d85caaee17 100644
--- a/CSS/css_completions.py
+++ b/CSS/css_completions.py
@@ -126,6 +126,14 @@ def get_properties():
'generic_name': [
'serif', 'sans-serif', 'cursive', 'fantasy', 'monospace'
],
+ 'gradient': [
+ ['conic-gradient()', 'conic-gradient($1)'],
+ ['linear-gradient()', 'linear-gradient($1)'],
+ ['radial-gradient()', 'radial-gradient($1)'],
+ ['repeating-conic-gradient()', 'repeating-conic-gradient($1)'],
+ ['repeating-linear-gradient()', 'repeating-linear-gradient($1)'],
+ ['repeating-radial-gradient()', 'repeating-radial-gradient($1)']
+ ],
'grid': [
['repeat()', 'repeat(${1:2}, ${2:1fr})'],
['minmax()', 'minmax(${1:100px}, ${2:1fr})'],
@@ -199,8 +207,8 @@ def get_properties():
'animation-play-state': ['running', 'paused'],
'backface-visibility': ['visible', 'hidden'],
'background': [
- '', '', 'repeat', 'repeat-x', 'repeat-y', 'no-repeat',
- 'scroll', 'fixed', ''
+ '', '', '', '',
+ 'repeat', 'repeat-x', 'repeat-y', 'no-repeat', 'scroll', 'fixed'
],
'background-attachment': ['fixed', 'local', 'scroll'],
'background-blend-mode': [''],
@@ -334,6 +342,7 @@ def get_properties():
'caption', 'icon', 'italic', 'menu', 'message-box', 'oblique',
'small-caps', 'small-caption', 'status-bar'
],
+ 'font-display': ['auto', 'block', 'swap', 'fallback', 'optional'],
'font-family': [''],
'font-feature-settings': ['normal', ''],
'font-kerning': ['auto', 'normal', 'none'],
@@ -625,7 +634,7 @@ def on_query_completions(self, view, prefix, locations):
if not match_selector(view, pt, selector):
return None
- if match_selector(view, pt, "meta.property-value.css meta.function-call"):
+ if match_selector(view, pt, "meta.property-value.css meta.function-call.arguments"):
items = self.complete_function_argument(view, prefix, pt)
elif match_selector(view, pt, "meta.property-value.css"):
items = self.complete_property_value(view, prefix, pt)
@@ -706,4 +715,26 @@ def complete_property_value(self, view, prefix, pt):
return completions
def complete_function_argument(self, view, prefix, pt):
+ args_region = view.expand_by_class(
+ pt, sublime.CLASS_PUNCTUATION_START | sublime.CLASS_PUNCTUATION_END)
+ func_region = view.expand_by_class(
+ args_region.a - 2, sublime.CLASS_WORD_START | sublime.CLASS_WORD_END)
+ func_name = view.substr(func_region)
+
+ # TODO: provide more function specific argument completions
+
+ if func_name == "var":
+ return [
+ sublime.CompletionItem(
+ trigger=symbol,
+ completion_format=sublime.COMPLETION_FORMAT_TEXT,
+ kind=sublime.KIND_VARIABLE,
+ details="var() argument"
+ )
+ for symbol in set(
+ view.substr(symbol_region)
+ for symbol_region in view.find_by_selector("entity.other.custom-property")
+ )
+ if not prefix or symbol.startswith(prefix)
+ ]
return None
diff --git a/CSS/syntax_test_css.css b/CSS/syntax_test_css.css
index 92184089dd..6b252bb04f 100644
--- a/CSS/syntax_test_css.css
+++ b/CSS/syntax_test_css.css
@@ -505,6 +505,32 @@
/* ^^^^^ support.constant.property-value.css */
/* ^ punctuation.section.group.end.css */
+ @media (prefers-color-scheme: dark) {}
+/* ^^^^^^^ meta.at-rule.media.css - meta.group */
+/* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.at-rule.media.css meta.group.css - meta.group meta.group */
+/* ^ meta.at-rule.media.css - meta.block - meta.group */
+/* ^^ meta.at-rule.media.css meta.block.css - meta.group - meta.property-list */
+/* ^ - meta.at-rule - meta.block */
+/* ^ keyword.control.directive.css punctuation.definition.keyword.css */
+/* ^^^^^ keyword.control.directive.css - punctuation */
+/* ^ punctuation.section.group.begin.css */
+/* ^^^^^^^^^^^^^^^^^^^^ support.type.property-name.css */
+/* ^ punctuation.separator.key-value.css */
+/* ^^^^ support.constant.property-value.css */
+/* ^ punctuation.section.group.end.css */
+
+ @media (prefers-reduced-motion) {}
+/* ^^^^^^^ meta.at-rule.media.css - meta.group */
+/* ^^^^^^^^^^^^^^^^^^^^^^^^ meta.at-rule.media.css meta.group.css - meta.group meta.group */
+/* ^ meta.at-rule.media.css - meta.block - meta.group */
+/* ^^ meta.at-rule.media.css meta.block.css - meta.group - meta.property-list */
+/* ^ - meta.at-rule - meta.block */
+/* ^ keyword.control.directive.css punctuation.definition.keyword.css */
+/* ^^^^^ keyword.control.directive.css - punctuation */
+/* ^ punctuation.section.group.begin.css */
+/* ^^^^^^^^^^^^^^^^^^^^^^ support.type.property-name.css */
+/* ^ punctuation.section.group.end.css */
+
@media (min-width: 700px, (max-width < 100 {}
/* ^^^^^^^ meta.at-rule.media.css - meta.group */
/* ^^^^^^^^^^^^^^^^^ meta.at-rule.media.css meta.group.css - meta.group meta.group */
@@ -843,6 +869,18 @@
{
/* <- meta.at-rule.font-face.css meta.property-list.css meta.block.css punctuation.section.block.begin.css */
+ ascent-override: normal;
+/* ^^^^^^^^^^^^^^^ meta.property-name.css support.type.property-name.css */
+/* ^^^^^^ meta.property-value.css support.constant.property-value.css */
+
+ descent-override: normal;
+/* ^^^^^^^^^^^^^^^^ meta.property-name.css support.type.property-name.css */
+/* ^^^^^^ meta.property-value.css support.constant.property-value.css */
+
+ font-display: swap;
+/* ^^^^^^^^^^^^ meta.property-name.css support.type.property-name.css */
+/* ^^^^ meta.property-value.css support.constant.property-value.css */
+
font-family: monospace,
/* ^^^^^^^^^^^^^^^^^^^^^^^^^ meta.at-rule.font-face.css meta.property-list.css meta.block.css */
/* ^^^^^^^^^^^ support.type.property-name.css */
@@ -859,6 +897,38 @@
font-family: Gentium Bold;
/* ^^^^^^^^^^^^ meta.string.css string.unquoted.css */
+ font-feature-settings: normal;
+/* ^^^^^^^^^^^^^^^^^^^^^ meta.property-name.css support.type.property-name.css */
+/* ^^^^^^ meta.property-value.css support.constant.property-value.css */
+
+ font-variation-settings: normal;
+/* ^^^^^^^^^^^^^^^^^^^^^^^ meta.property-name.css support.type.property-name.css */
+/* ^^^^^^ meta.property-value.css support.constant.property-value.css */
+
+ font-stretch: expanded;
+/* ^^^^^^^^^^^^ meta.property-name.css support.type.property-name.css */
+/* ^^^^^^^^ meta.property-value.css support.constant.property-value.css */
+
+ font-style: oblique;
+/* ^^^^^^^^^^ meta.property-name.css support.type.property-name.css */
+/* ^^^^^^^ meta.property-value.css support.constant.property-value.css */
+
+ font-weight: bold;
+/* ^^^^^^^^^^^ meta.property-name.css support.type.property-name.css */
+/* ^^^^ meta.property-value.css support.constant.property-value.css */
+
+ font-variant: discretionary-ligatures;
+/* ^^^^^^^^^^^^ meta.property-name.css support.type.property-name.css */
+/* ^^^^^^^^^^^^^^^^^^^^^^^ meta.property-value.css support.constant.property-value.css */
+
+ line-gap-override: normal;
+/* ^^^^^^^^^^^^^^^^^ meta.property-name.css support.type.property-name.css */
+/* ^^^^^^ meta.property-value.css support.constant.property-value.css */
+
+ size-adjust: 50%;
+/* ^^^^^^^^^^^ meta.property-name.css support.type.property-name.css */
+/* ^^^ meta.property-value.css meta.number.integer.decimal.css */
+
src: format("embedded-opentype");
/* ^^^^^^ support.function.font-face.css */
/* ^ punctuation.definition.string.begin.css */
@@ -910,6 +980,12 @@
/* ^ punctuation.section.group.begin.css */
/* ^^^^^^^^^^^^ variable.other.custom-property.css */
/* ^^ punctuation.section.group.end.css */
+
+ unicode-range: U+0-10FFFF;
+/* ^^^^^^^^^^^^^ meta.property-name.css support.type.property-name.css */
+/* ^ punctuation.separator.key-value.css */
+/* ^^^^^^^^^^ meta.property-value.css meta.number.unicode-range.css */
+/* ^ punctuation.terminator.rule.css */
}
/* <- meta.at-rule.font-face.css meta.property-list.css meta.block.css punctuation.section.block.end.css */
@@ -1022,6 +1098,12 @@
/* ^^^^^^^^^^^^^ keyword.control.directive.css - punctuation */
/* ^^^^ entity.other.counter-style-name.css */
+ additive-symbols: ;
+/* ^^^^^^^^^^^^^^^^^^^^^ meta.at-rule.counter-style.css meta.property-list.css meta.block.css */
+/* ^^^^^^^^^^^^^^^^ meta.property-name.css support.type.property-name.css */
+/* ^ punctuation.separator.key-value.css */
+/* ^ punctuation.terminator.rule.css*/
+
system: extends disc;
/* ^^^^^^^^^^^^^^^^^^^^^^^ meta.at-rule.counter-style.css meta.property-list.css meta.block.css */
/* ^ - meta.property-name - meta.property-value */
@@ -1257,7 +1339,7 @@
}
/* <- meta.at-rule.counter-style.css meta.property-list.css meta.block.css punctuation.section.block.end.css */
-.test-var-functions {
+.test-var-functions {
--test-var: arial;
/* ^^^^^^^^^^ entity.other.custom-property.css */
/* ^ punctuation.separator.key-value.css*/
@@ -1345,6 +1427,20 @@
}
.test-operators {
+
+ margin: -1 -1 +1;
+ /* ^ keyword.operator.arithmetic.css */
+ /* ^ keyword.operator.arithmetic.css */
+ /* ^ keyword.operator.arithmetic.css */
+
+ margin: -1px -1px +1px;
+ /* ^ keyword.operator.arithmetic.css */
+ /* ^ keyword.operator.arithmetic.css */
+ /* ^ keyword.operator.arithmetic.css */
+}
+
+.test-operators-in-calc {
+
top: calc(1px + 1px);
/* ^ keyword.operator.arithmetic.css */
top: calc(+1px+1px);
@@ -1402,6 +1498,40 @@
/* ^ keyword.operator.arithmetic.css */
}
+.text-calc-clamp-max-min {
+ top: clamp(1*5pt, calc(12/5), 100rem);
+/* ^^^^^ support.function.calc.css */
+/* ^ constant.numeric.value.css */
+/* ^ keyword.operator.arithmetic.css */
+/* ^ constant.numeric.value.css */
+/* ^^ constant.numeric.suffix.css */
+/* ^ punctuation.separator.sequence.css */
+/* ^^^^ support.function.calc.css */
+/* ^^ constant.numeric.value.css */
+/* ^ keyword.operator.arithmetic.css */
+/* ^ constant.numeric.value.css */
+/* ^ punctuation.separator.sequence.css */
+/* ^^^ constant.numeric.value.css */
+/* ^^^ constant.numeric.suffix.css */
+
+ top: max(5*6, min(10 + 5, calc(var(--size) / 5)));
+/* ^^^ support.function.calc.css */
+/* ^ constant.numeric.value.css */
+/* ^ keyword.operator.arithmetic.css */
+/* ^ constant.numeric.value.css */
+/* ^ punctuation.separator.sequence.css */
+/* ^^^ support.function.calc.css */
+/* ^^ constant.numeric.value.css */
+/* ^ keyword.operator.arithmetic.css */
+/* ^ constant.numeric.value.css */
+/* ^ punctuation.separator.sequence.css */
+/* ^^^^ support.function.calc.css */
+/* ^^^ support.function.var.css */
+/* ^ keyword.operator.arithmetic.css */
+/* ^ constant.numeric.value.css */
+}
+
+
.test-important {
top: 1px !important;
/* ^^^^^^^^^^ keyword.other.important.css */
@@ -1409,10 +1539,30 @@
/* ^^^^^^^^^^ keyword.other.important.css */
}
+.test:has(> .class) {}
+/*^^^^^^^^^^^^^^^^^ meta.selector.css */
+/* ^^^ - meta.selector.css */
+/* ^^^ meta.function-call.identifier.css - meta.function-call meta.function-call - meta.group*/
+/* ^^^^^^^^^^ meta.function-call.arguments.css meta.group.css */
+/* ^ punctuation.section.group.begin.css */
+/* ^ keyword.operator.combinator.css */
+/* ^^^^^^ entity.other.attribute-name.class.css */
+/* ^ punctuation.section.group.end.css */
+
+.test:has(>> .class) {}
+/*^^^^^^^^^^^^^^^^^^ meta.selector.css */
+/* ^^^ - meta.selector.css */
+/* ^^^ meta.function-call.identifier.css - meta.function-call meta.function-call - meta.group*/
+/* ^^^^^^^^^^ meta.function-call.arguments.css meta.group.css */
+/* ^ punctuation.section.group.begin.css */
+/* ^^ keyword.operator.combinator.css */
+/* ^^^^^^ entity.other.attribute-name.class.css */
+/* ^ punctuation.section.group.end.css */
+
/* Test Functional Pseudo Class Meta Scopes */
.test:nth-child(even) {}
/*^^^^^^^^^^^^^^^^^^^ meta.selector.css */
-/* ^^ - meta.selector.css */
+/* ^^^ - meta.selector.css */
/* ^^^^^^^^^ meta.function-call.identifier.css - meta.function-call meta.function-call - meta.group*/
/* ^^^^^^ meta.function-call.arguments.css meta.group.css */
/* ^ punctuation.section.group.begin.css */
@@ -1532,6 +1682,16 @@
/* ^^^ entity.other.pseudo-class.css */
/* ^ variable.language.wildcard.asterisk.css */
+.test-pseudo-class-tag:is(*) {}
+/* ^ punctuation.definition.pseudo-class.css - entity */
+/* ^^ entity.other.pseudo-class.css */
+/* ^ variable.language.wildcard.asterisk.css */
+
+.test-pseudo-class-tag:where(*) {}
+/* ^ punctuation.definition.pseudo-class.css - entity */
+/* ^^^^^ entity.other.pseudo-class.css */
+/* ^ variable.language.wildcard.asterisk.css */
+
.test-pseudo-elements::before {}
/* ^^ punctuation.definition.pseudo-element.css - entity */
/* ^^^^^^ entity.other.pseudo-element.css */
@@ -2161,6 +2321,23 @@
/* ^^^ meta.number.float.decimal.css constant.numeric.value.css */
/* ^ meta.number.float.decimal.css constant.numeric.suffix.css */
+ top: blend(hsl(219, 10%, 6%) 50%);
+/* ^^^^^ support.function.color.css */
+/* ^ punctuation.section.group.begin.css */
+/* ^^^ support.function.color.css */
+/* ^ punctuation.section.group.begin.css */
+/* ^^^ meta.number.integer.decimal.css constant.numeric.value.css */
+/* ^ punctuation.separator.sequence.css */
+/* ^^ meta.number.integer.decimal.css constant.numeric.value.css */
+/* ^ meta.number.integer.decimal.css constant.numeric.suffix.css */
+/* ^ punctuation.separator.sequence.css */
+/* ^ meta.number.integer.decimal.css constant.numeric.value.css */
+/* ^ meta.number.integer.decimal.css constant.numeric.suffix.css */
+/* ^ punctuation.section.group.end.css */
+/* ^^ meta.number.integer.decimal.css constant.numeric.value.css */
+/* ^ meta.number.integer.decimal.css constant.numeric.suffix.css */
+/* ^ punctuation.section.group.end.css */
+
top: blenda(red 50% hsl);
/* ^^^^^^ support.function.color.css */
/* ^^^ support.constant.color.w3c.standard.css */
@@ -2238,7 +2415,7 @@
/* ^^^^^ support.function.transform.css */
/* ^ meta.number.integer.decimal.css constant.numeric.value.css */
/* ^^^ meta.number.integer.decimal.css constant.numeric.suffix.css */
-
+
top: skew(1deg, 2turn);
/* ^^^^ support.function.transform.css */
/* ^ meta.number.integer.decimal.css constant.numeric.value.css */
@@ -2484,16 +2661,16 @@
/* ^^^ support.function.url.css */
/* ^ meta.string.css string.unquoted.css */
- top: url("foo/bar%20baz.php?page=10&func=test()");
-/* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.function-call meta.function-call */
+ top: url("foo/bar%20baz.php?page=10&func=test()#ancor");
+/* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.function-call meta.function-call */
/* ^^^ meta.function-call.identifier.css */
-/* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function-call.arguments.css meta.group.css */
-/* ^ - meta.function-call */
+/* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function-call.arguments.css meta.group.css */
+/* ^ - meta.function-call */
/* ^ - meta.string - meta.path */
/* ^ meta.string.css - meta.path */
-/* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.path.url.css meta.string.css */
-/* ^ meta.string.css - meta.path */
-/* ^ - meta.string - meta.path */
+/* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.path.url.css meta.string.css */
+/* ^ meta.string.css - meta.path */
+/* ^ - meta.string - meta.path */
/* ^^^ support.function.url.css */
/* ^ punctuation.section.group.begin.css */
/* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.quoted.double.css */
@@ -2503,9 +2680,10 @@
/* ^^ constant.character.escape.url.css - punctuation */
/* ^ punctuation.separator.path.css */
/* ^ punctuation.separator.path.css */
-/* ^ punctuation.definition.string.end.css */
-/* ^ punctuation.section.group.end.css */
-/* ^ punctuation.terminator.rule.css */
+/* ^ punctuation.separator.path.css */
+/* ^ punctuation.definition.string.end.css */
+/* ^ punctuation.section.group.end.css */
+/* ^ punctuation.terminator.rule.css */
top: url('foo/bar%20baz.php?page=10&func=test()');
/* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.function-call meta.function-call */
@@ -2543,8 +2721,13 @@
/* ^ punctuation.separator.path.css */
/* ^ constant.character.escape.url.css punctuation.definition.escape.css */
/* ^^ constant.character.escape.url.css - punctuation */
+/* ^^^^^^^ - punctuation.separator.path */
/* ^ punctuation.separator.path.css */
+/* ^^^^^^^ - punctuation.separator.path */
/* ^ punctuation.separator.path.css */
+/* ^^^^^^^^^^^^^^ - punctuation.separator.path */
+/* ^ punctuation.separator.path.css */
+/* ^^ - punctuation.separator.path */
/* ^^^^ constant.character.escape.css */
/* ^ invalid.illegal.unexpected-token.css */
/* ^^ constant.character.escape.css */
@@ -2677,6 +2860,13 @@
}
.test-gradient-functions {
+ top: conic-gradient(from 0.25turn at 50% 30%, #f69d3c, 10deg, #3f87a6, 350deg, #ebf8e1);
+/* ^^^^^^^^^^^^^^ support.function.gradient.css */
+/* ^^^^ keyword.other.gradient.css */
+/* ^^^^ meta.number.float.decimal.css constant.numeric.value.css */
+/* ^^^^ meta.number.float.decimal.css constant.numeric.suffix.css */
+/* ^^ keyword.other.gradient.css */
+
top: linear-gradient();
/* ^^^^^^^^^^^^^^^ support.function.gradient.css */
diff --git a/Clojure/Clojure.sublime-syntax b/Clojure/Clojure.sublime-syntax
index d30d7347b6..41e6627124 100644
--- a/Clojure/Clojure.sublime-syntax
+++ b/Clojure/Clojure.sublime-syntax
@@ -24,12 +24,12 @@ variables:
# Similar to the number regexps in the Clojure reader.
# This doesn't include evil octals and dot-terminated decimals.
sign: '[-+]?'
- exponent: (?:[eE]{{sign}}\d+)
+ dec_exponent: (?:[eE]{{sign}}\d+)
dec_integer: ({{sign}})(\d+)(N?)(?=[{{non_number_chars}}])
hex_integer: ({{sign}})(0[Xx])(\h+)(N?)(?=[{{non_number_chars}}])
other_integer: ({{sign}})((?:[2-9]|[1-9]\d+)[Rr])([0-9A-Za-z]+)(?=[{{non_number_chars}}])
rational: ({{sign}})(\d+)(/)(\d+)(?=[{{non_number_chars}}])
- float: ({{sign}})(\d+)(?:(?:(\.)(\d+)({{exponent}})?|({{exponent}}))(M)?|(M))(?=[{{non_number_chars}}])
+ float: ({{sign}})(\d+)(?:((\.)\d+{{dec_exponent}}?|{{dec_exponent}})(M)?|(M))(?=[{{non_number_chars}}])
contexts:
main:
@@ -78,40 +78,38 @@ contexts:
- match: '{{dec_integer}}'
scope: meta.number.integer.decimal.clojure
captures:
- 1: punctuation.definition.numeric.sign.clojure
+ 1: keyword.operator.arithmetic.clojure
2: constant.numeric.value.clojure
3: constant.numeric.suffix.clojure
- match: '{{hex_integer}}'
scope: meta.number.integer.hexadecimal.clojure
captures:
- 1: punctuation.definition.numeric.sign.clojure
+ 1: keyword.operator.arithmetic.clojure
2: constant.numeric.base.clojure
3: constant.numeric.value.clojure
4: constant.numeric.suffix.clojure
- match: '{{other_integer}}'
scope: meta.number.integer.other.clojure
captures:
- 1: punctuation.definition.numeric.sign.clojure
+ 1: keyword.operator.arithmetic.clojure
2: constant.numeric.base.clojure
3: constant.numeric.value.clojure
- match: '{{rational}}'
scope: meta.number.rational.decimal.clojure
captures:
- 1: punctuation.definition.numeric.sign.clojure
+ 1: keyword.operator.arithmetic.clojure
2: constant.numeric.value.clojure
3: punctuation.separator.rational.clojure
4: constant.numeric.value.clojure
- match: '{{float}}'
scope: meta.number.float.decimal.clojure
captures:
- 1: punctuation.definition.numeric.sign.clojure
+ 1: keyword.operator.arithmetic.clojure
2: constant.numeric.value.clojure
- 3: punctuation.separator.decimal.clojure
- 4: constant.numeric.value.clojure
- 5: constant.numeric.value.exponent.clojure
- 6: constant.numeric.value.exponent.clojure
- 7: constant.numeric.suffix.clojure
- 8: constant.numeric.suffix.clojure
+ 3: constant.numeric.value.clojure
+ 4: punctuation.separator.decimal.clojure
+ 5: constant.numeric.suffix.clojure
+ 6: constant.numeric.suffix.clojure
- match: '{{atom}}'
pop-expr:
@@ -162,14 +160,14 @@ contexts:
- match: '{{dec_integer}}'
scope: meta.number.integer.decimal.clojure
captures:
- 1: punctuation.definition.numeric.sign.clojure
+ 1: keyword.operator.arithmetic.clojure
2: constant.numeric.value.clojure
3: constant.numeric.suffix.clojure
pop: true
- match: '{{hex_integer}}'
scope: meta.number.integer.hexadecimal.clojure
captures:
- 1: punctuation.definition.numeric.sign.clojure
+ 1: keyword.operator.arithmetic.clojure
2: constant.numeric.base.clojure
3: constant.numeric.value.clojure
4: constant.numeric.suffix.clojure
@@ -177,14 +175,14 @@ contexts:
- match: '{{other_integer}}'
scope: meta.number.integer.other.clojure
captures:
- 1: punctuation.definition.numeric.sign.clojure
+ 1: keyword.operator.arithmetic.clojure
2: constant.numeric.base.clojure
3: constant.numeric.value.clojure
pop: true
- match: '{{rational}}'
scope: meta.number.rational.decimal.clojure
captures:
- 1: punctuation.definition.numeric.sign.clojure
+ 1: keyword.operator.arithmetic.clojure
2: constant.numeric.value.clojure
3: punctuation.separator.rational.clojure
4: constant.numeric.value.clojure
@@ -192,14 +190,12 @@ contexts:
- match: '{{float}}'
scope: meta.number.float.decimal.clojure
captures:
- 1: punctuation.definition.numeric.sign.clojure
+ 1: keyword.operator.arithmetic.clojure
2: constant.numeric.value.clojure
- 3: punctuation.separator.decimal.clojure
- 4: constant.numeric.value.clojure
- 5: constant.numeric.value.exponent.clojure
- 6: constant.numeric.value.exponent.clojure
- 7: constant.numeric.suffix.clojure
- 8: constant.numeric.suffix.clojure
+ 3: constant.numeric.value.clojure
+ 4: punctuation.separator.decimal.clojure
+ 5: constant.numeric.suffix.clojure
+ 6: constant.numeric.suffix.clojure
pop: true
- match: '{{atom}}'
pop: true
diff --git a/Clojure/tests/syntax_test_clojure.clj b/Clojure/tests/syntax_test_clojure.clj
index 0abfb212d6..91852fc905 100644
--- a/Clojure/tests/syntax_test_clojure.clj
+++ b/Clojure/tests/syntax_test_clojure.clj
@@ -84,20 +84,20 @@
; ^ constant.numeric.suffix.clojure
; ^ - meta.number
; ^^^^^ meta.number.integer.decimal.clojure
-; ^ punctuation.definition.numeric.sign.clojure
+; ^ keyword.operator.arithmetic.clojure
; ^^^^ constant.numeric.value.clojure
; ^ - meta.number
; ^^^^^^ meta.number.integer.decimal.clojure
-; ^ punctuation.definition.numeric.sign.clojure
+; ^ keyword.operator.arithmetic.clojure
; ^^^^ constant.numeric.value.clojure
; ^ constant.numeric.suffix.clojure
; ^ - meta.number
; ^^^^^ meta.number.integer.decimal.clojure
-; ^ punctuation.definition.numeric.sign.clojure
+; ^ keyword.operator.arithmetic.clojure
; ^^^^ constant.numeric.value.clojure
; ^ - meta.number
; ^^^^^^ meta.number.integer.decimal.clojure
-; ^ punctuation.definition.numeric.sign.clojure
+; ^ keyword.operator.arithmetic.clojure
; ^^^^ constant.numeric.value.clojure
; ^ constant.numeric.suffix.clojure
0x1234af 0x1234afN 0X1234AF 0X1234AFN
@@ -120,45 +120,45 @@
; ^ constant.numeric.suffix.clojure
+0x1234af +0x1234afN +0X1234AF +0X1234AFN
; ^^^^^^^^^ meta.number.integer.hexadecimal.clojure
-; ^ punctuation.definition.numeric.sign.clojure
+; ^ keyword.operator.arithmetic.clojure
; ^^ constant.numeric.base.clojure
; ^^^^^^ constant.numeric.value.clojure
; ^ - meta.number
; ^^^^^^^^^^ meta.number.integer.hexadecimal.clojure
-; ^ punctuation.definition.numeric.sign.clojure
+; ^ keyword.operator.arithmetic.clojure
; ^^ constant.numeric.base.clojure
; ^^^^^^ constant.numeric.value.clojure
; ^ constant.numeric.suffix.clojure
; ^ - meta.number
; ^^^^^^^^^ meta.number.integer.hexadecimal.clojure
-; ^ punctuation.definition.numeric.sign.clojure
+; ^ keyword.operator.arithmetic.clojure
; ^^ constant.numeric.base.clojure
; ^^^^^^ constant.numeric.value.clojure
; ^ - meta.number
; ^^^^^^^^^^ meta.number.integer.hexadecimal.clojure
-; ^ punctuation.definition.numeric.sign.clojure
+; ^ keyword.operator.arithmetic.clojure
; ^^ constant.numeric.base.clojure
; ^^^^^^ constant.numeric.value.clojure
; ^ constant.numeric.suffix.clojure
-0x1234af -0x1234afN -0X1234AF -0X1234AFN
; ^^^^^^^^^ meta.number.integer.hexadecimal.clojure
-; ^ punctuation.definition.numeric.sign.clojure
+; ^ keyword.operator.arithmetic.clojure
; ^^ constant.numeric.base.clojure
; ^^^^^^ constant.numeric.value.clojure
; ^ - meta.number
; ^^^^^^^^^^ meta.number.integer.hexadecimal.clojure
-; ^ punctuation.definition.numeric.sign.clojure
+; ^ keyword.operator.arithmetic.clojure
; ^^ constant.numeric.base.clojure
; ^^^^^^ constant.numeric.value.clojure
; ^ constant.numeric.suffix.clojure
; ^ - meta.number
; ^^^^^^^^^ meta.number.integer.hexadecimal.clojure
-; ^ punctuation.definition.numeric.sign.clojure
+; ^ keyword.operator.arithmetic.clojure
; ^^ constant.numeric.base.clojure
; ^^^^^^ constant.numeric.value.clojure
; ^ - meta.number
; ^^^^^^^^^^ meta.number.integer.hexadecimal.clojure
-; ^ punctuation.definition.numeric.sign.clojure
+; ^ keyword.operator.arithmetic.clojure
; ^^ constant.numeric.base.clojure
; ^^^^^^ constant.numeric.value.clojure
; ^ constant.numeric.suffix.clojure
@@ -188,62 +188,62 @@
; ^^^^^^ constant.numeric.value.clojure
+2r1010 +16r1234af +32r1234az +2R1010 +16R1234AF +32R1234AZ
; ^^^^^^^ meta.number.integer.other.clojure
-; ^ punctuation.definition.numeric.sign.clojure
+; ^ keyword.operator.arithmetic.clojure
; ^^ constant.numeric.base.clojure
; ^^^^ constant.numeric.value.clojure
; ^ - meta.number
; ^^^^^^^^^^ meta.number.integer.other.clojure
-; ^ punctuation.definition.numeric.sign.clojure
+; ^ keyword.operator.arithmetic.clojure
; ^^^ constant.numeric.base.clojure
; ^^^^^^ constant.numeric.value.clojure
; ^ - meta.number
; ^^^^^^^^^^ meta.number.integer.other.clojure
-; ^ punctuation.definition.numeric.sign.clojure
+; ^ keyword.operator.arithmetic.clojure
; ^^^ constant.numeric.base.clojure
; ^^^^^^ constant.numeric.value.clojure
; ^ - meta.number
; ^^^^^^^ meta.number.integer.other.clojure
-; ^ punctuation.definition.numeric.sign.clojure
+; ^ keyword.operator.arithmetic.clojure
; ^^ constant.numeric.base.clojure
; ^^^^ constant.numeric.value.clojure
; ^ - meta.number
; ^^^^^^^^^^ meta.number.integer.other.clojure
-; ^ punctuation.definition.numeric.sign.clojure
+; ^ keyword.operator.arithmetic.clojure
; ^^^ constant.numeric.base.clojure
; ^^^^^^ constant.numeric.value.clojure
; ^ - meta.number
; ^^^^^^^^^^ meta.number.integer.other.clojure
-; ^ punctuation.definition.numeric.sign.clojure
+; ^ keyword.operator.arithmetic.clojure
; ^^^ constant.numeric.base.clojure
; ^^^^^^ constant.numeric.value.clojure
-2r1010 -16r1234af -32r1234az -2R1010 -16R1234AF -32R1234AZ
; ^^^^^^^ meta.number.integer.other.clojure
-; ^ punctuation.definition.numeric.sign.clojure
+; ^ keyword.operator.arithmetic.clojure
; ^^ constant.numeric.base.clojure
; ^^^^ constant.numeric.value.clojure
; ^ - meta.number
; ^^^^^^^^^^ meta.number.integer.other.clojure
-; ^ punctuation.definition.numeric.sign.clojure
+; ^ keyword.operator.arithmetic.clojure
; ^^^ constant.numeric.base.clojure
; ^^^^^^ constant.numeric.value.clojure
; ^ - meta.number
; ^^^^^^^^^^ meta.number.integer.other.clojure
-; ^ punctuation.definition.numeric.sign.clojure
+; ^ keyword.operator.arithmetic.clojure
; ^^^ constant.numeric.base.clojure
; ^^^^^^ constant.numeric.value.clojure
; ^ - meta.number
; ^^^^^^^ meta.number.integer.other.clojure
-; ^ punctuation.definition.numeric.sign.clojure
+; ^ keyword.operator.arithmetic.clojure
; ^^ constant.numeric.base.clojure
; ^^^^ constant.numeric.value.clojure
; ^ - meta.number
; ^^^^^^^^^^ meta.number.integer.other.clojure
-; ^ punctuation.definition.numeric.sign.clojure
+; ^ keyword.operator.arithmetic.clojure
; ^^^ constant.numeric.base.clojure
; ^^^^^^ constant.numeric.value.clojure
; ^ - meta.number
; ^^^^^^^^^^ meta.number.integer.other.clojure
-; ^ punctuation.definition.numeric.sign.clojure
+; ^ keyword.operator.arithmetic.clojure
; ^^^ constant.numeric.base.clojure
; ^^^^^^ constant.numeric.value.clojure
0/10 10/20 30/0
@@ -263,37 +263,37 @@
; ^ constant.numeric.value.clojure
+0/10 +10/20 +30/0
; ^^^^^ meta.number.rational.decimal.clojure
-; ^ punctuation.definition.numeric.sign.clojure
+; ^ keyword.operator.arithmetic.clojure
; ^ constant.numeric.value.clojure
; ^ punctuation.separator.rational.clojure
; ^^ constant.numeric.value.clojure
; ^ - meta.number
; ^^^^^^ meta.number.rational.decimal.clojure
-; ^ punctuation.definition.numeric.sign.clojure
+; ^ keyword.operator.arithmetic.clojure
; ^^ constant.numeric.value.clojure
; ^ punctuation.separator.rational.clojure
; ^^ constant.numeric.value.clojure
; ^ - meta.number
; ^^^^^ meta.number.rational.decimal.clojure
-; ^ punctuation.definition.numeric.sign.clojure
+; ^ keyword.operator.arithmetic.clojure
; ^^ constant.numeric.value.clojure
; ^ punctuation.separator.rational.clojure
; ^ constant.numeric.value.clojure
-0/10 -10/20 -30/0
; ^^^^^ meta.number.rational.decimal.clojure
-; ^ punctuation.definition.numeric.sign.clojure
+; ^ keyword.operator.arithmetic.clojure
; ^ constant.numeric.value.clojure
; ^ punctuation.separator.rational.clojure
; ^^ constant.numeric.value.clojure
; ^ - meta.number
; ^^^^^^ meta.number.rational.decimal.clojure
-; ^ punctuation.definition.numeric.sign.clojure
+; ^ keyword.operator.arithmetic.clojure
; ^^ constant.numeric.value.clojure
; ^ punctuation.separator.rational.clojure
; ^^ constant.numeric.value.clojure
; ^ - meta.number
; ^^^^^ meta.number.rational.decimal.clojure
-; ^ punctuation.definition.numeric.sign.clojure
+; ^ keyword.operator.arithmetic.clojure
; ^^ constant.numeric.value.clojure
; ^ punctuation.separator.rational.clojure
; ^ constant.numeric.value.clojure
@@ -314,206 +314,164 @@
; ^ constant.numeric.suffix.clojure
+1234M +1234.0M +1234.1234M
; ^^^^^^ meta.number.float.decimal.clojure
-; ^ punctuation.definition.numeric.sign.clojure
+; ^ keyword.operator.arithmetic.clojure
; ^^^^ constant.numeric.value.clojure
; ^ constant.numeric.suffix.clojure
; ^ - meta.number
; ^^^^^^^^ meta.number.float.decimal.clojure
-; ^ punctuation.definition.numeric.sign.clojure
+; ^ keyword.operator.arithmetic.clojure
; ^^^^ constant.numeric.value.clojure
; ^ punctuation.separator.decimal.clojure
; ^ constant.numeric.value.clojure
; ^ constant.numeric.suffix.clojure
; ^ - meta.number
; ^^^^^^^^^^^ meta.number.float.decimal.clojure
-; ^ punctuation.definition.numeric.sign.clojure
+; ^ keyword.operator.arithmetic.clojure
; ^^^^ constant.numeric.value.clojure
; ^ punctuation.separator.decimal.clojure
; ^^^^ constant.numeric.value.clojure
; ^ constant.numeric.suffix.clojure
-1234M -1234.0M -1234.1234M
; ^^^^^^ meta.number.float.decimal.clojure
-; ^ punctuation.definition.numeric.sign.clojure
+; ^ keyword.operator.arithmetic.clojure
; ^^^^ constant.numeric.value.clojure
; ^ constant.numeric.suffix.clojure
; ^ - meta.number
; ^^^^^^^^ meta.number.float.decimal.clojure
-; ^ punctuation.definition.numeric.sign.clojure
+; ^ keyword.operator.arithmetic.clojure
; ^^^^ constant.numeric.value.clojure
; ^ punctuation.separator.decimal.clojure
; ^ constant.numeric.value.clojure
; ^ constant.numeric.suffix.clojure
; ^ - meta.number
; ^^^^^^^^^^^ meta.number.float.decimal.clojure
-; ^ punctuation.definition.numeric.sign.clojure
+; ^ keyword.operator.arithmetic.clojure
; ^^^^ constant.numeric.value.clojure
; ^ punctuation.separator.decimal.clojure
; ^^^^ constant.numeric.value.clojure
; ^ constant.numeric.suffix.clojure
1234e10 1234E10M 1234.1234e10M 1234.1234E10M
; ^^^^^^^ meta.number.float.decimal.clojure
-; ^^^^ constant.numeric.value.clojure
-; ^^^ constant.numeric.value.exponent.clojure
+; ^^^^^^^ constant.numeric.value.clojure
; ^ - meta.number
; ^^^^^^^ meta.number.float.decimal.clojure
-; ^^^^ constant.numeric.value.clojure
-; ^^^ constant.numeric.value.exponent.clojure
+; ^^^^^^^ constant.numeric.value.clojure
; ^ constant.numeric.suffix.clojure
; ^ - meta.number
; ^^^^^^^^^^^^^ meta.number.float.decimal.clojure
-; ^^^^ constant.numeric.value.clojure
+; ^^^^^^^^^^^^ constant.numeric.value.clojure
; ^ punctuation.separator.decimal.clojure
-; ^^^^ constant.numeric.value.clojure
-; ^^^ constant.numeric.value.exponent.clojure
; ^ constant.numeric.suffix.clojure
; ^ - meta.number
; ^^^^^^^^^^^^^ meta.number.float.decimal.clojure
-; ^^^^ constant.numeric.value.clojure
+; ^^^^^^^^^^^^ constant.numeric.value.clojure
; ^ punctuation.separator.decimal.clojure
-; ^^^^ constant.numeric.value.clojure
-; ^^^ constant.numeric.value.exponent.clojure
; ^ constant.numeric.suffix.clojure
+1234e10 +1234E10M +1234.1234e10M +1234.1234E10M
; ^^^^^^^^ meta.number.float.decimal.clojure
-; ^ punctuation.definition.numeric.sign.clojure
-; ^^^^ constant.numeric.value.clojure
-; ^^^ constant.numeric.value.exponent.clojure
+; ^ keyword.operator.arithmetic.clojure
+; ^^^^^^^ constant.numeric.value.clojure
; ^ - meta.number
; ^^^^^^^^^ meta.number.float.decimal.clojure
-; ^ punctuation.definition.numeric.sign.clojure
-; ^^^^ constant.numeric.value.clojure
-; ^^^ constant.numeric.value.exponent.clojure
+; ^ keyword.operator.arithmetic.clojure
+; ^^^^^^^ constant.numeric.value.clojure
; ^ constant.numeric.suffix.clojure
; ^ - meta.number
; ^^^^^^^^^^^^^^ meta.number.float.decimal.clojure
-; ^ punctuation.definition.numeric.sign.clojure
-; ^^^^ constant.numeric.value.clojure
+; ^ keyword.operator.arithmetic.clojure
+; ^^^^^^^^^^^^ constant.numeric.value.clojure
; ^ punctuation.separator.decimal.clojure
-; ^^^^ constant.numeric.value.clojure
-; ^^^ constant.numeric.value.exponent.clojure
; ^ constant.numeric.suffix.clojure
; ^ - meta.number
; ^^^^^^^^^^^^^^ meta.number.float.decimal.clojure
-; ^ punctuation.definition.numeric.sign.clojure
-; ^^^^ constant.numeric.value.clojure
+; ^ keyword.operator.arithmetic.clojure
+; ^^^^^^^^^^^^ constant.numeric.value.clojure
; ^ punctuation.separator.decimal.clojure
-; ^^^^ constant.numeric.value.clojure
-; ^^^ constant.numeric.value.exponent.clojure
; ^ constant.numeric.suffix.clojure
-1234e10 -1234E10M -1234.1234e10M -1234.1234E10M
; ^^^^^^^^ meta.number.float.decimal.clojure
-; ^ punctuation.definition.numeric.sign.clojure
-; ^^^^ constant.numeric.value.clojure
-; ^^^ constant.numeric.value.exponent.clojure
+; ^ keyword.operator.arithmetic.clojure
+; ^^^^^^^ constant.numeric.value.clojure
; ^ - meta.number
; ^^^^^^^^^ meta.number.float.decimal.clojure
-; ^ punctuation.definition.numeric.sign.clojure
-; ^^^^ constant.numeric.value.clojure
-; ^^^ constant.numeric.value.exponent.clojure
+; ^ keyword.operator.arithmetic.clojure
+; ^^^^^^^ constant.numeric.value.clojure
; ^ constant.numeric.suffix.clojure
; ^ - meta.number
; ^^^^^^^^^^^^^^ meta.number.float.decimal.clojure
-; ^ punctuation.definition.numeric.sign.clojure
-; ^^^^ constant.numeric.value.clojure
+; ^ keyword.operator.arithmetic.clojure
+; ^^^^^^^^^^^^ constant.numeric.value.clojure
; ^ punctuation.separator.decimal.clojure
-; ^^^^ constant.numeric.value.clojure
-; ^^^ constant.numeric.value.exponent.clojure
; ^ constant.numeric.suffix.clojure
; ^ - meta.number
; ^^^^^^^^^^^^^^ meta.number.float.decimal.clojure
-; ^ punctuation.definition.numeric.sign.clojure
-; ^^^^ constant.numeric.value.clojure
+; ^ keyword.operator.arithmetic.clojure
+; ^^^^^^^^^^^^ constant.numeric.value.clojure
; ^ punctuation.separator.decimal.clojure
-; ^^^^ constant.numeric.value.clojure
-; ^^^ constant.numeric.value.exponent.clojure
; ^ constant.numeric.suffix.clojure
1234.1234e+10 1234.1234E+10 1234.1234e-10 1234.1234E-10
; ^^^^^^^^^^^^^ meta.number.float.decimal.clojure
-; ^^^^ constant.numeric.value.clojure
+; ^^^^^^^^^^^^^ constant.numeric.value.clojure
; ^ punctuation.separator.decimal.clojure
-; ^^^^ constant.numeric.value.clojure
-; ^^^^ constant.numeric.value.exponent.clojure
; ^ - meta.number
; ^^^^^^^^^^^^^ meta.number.float.decimal.clojure
-; ^^^^ constant.numeric.value.clojure
+; ^^^^^^^^^^^^^ constant.numeric.value.clojure
; ^ punctuation.separator.decimal.clojure
-; ^^^^ constant.numeric.value.clojure
-; ^^^^ constant.numeric.value.exponent.clojure
; ^ - meta.number
; ^^^^^^^^^^^^^ meta.number.float.decimal.clojure
-; ^^^^ constant.numeric.value.clojure
+; ^^^^^^^^^^^^^ constant.numeric.value.clojure
; ^ punctuation.separator.decimal.clojure
-; ^^^^ constant.numeric.value.clojure
-; ^^^^ constant.numeric.value.exponent.clojure
; ^ - meta.number
; ^^^^^^^^^^^^^ meta.number.float.decimal.clojure
-; ^^^^ constant.numeric.value.clojure
+; ^^^^^^^^^^^^^ constant.numeric.value.clojure
; ^ punctuation.separator.decimal.clojure
-; ^^^^ constant.numeric.value.clojure
-; ^^^^ constant.numeric.value.exponent.clojure
+1234.1234e+10M +1234.1234E+10M +1234.1234e-10M +1234.1234E-10M
; ^^^^^^^^^^^^^^^ meta.number.float.decimal.clojure
-; ^ punctuation.definition.numeric.sign.clojure
-; ^^^^ constant.numeric.value.clojure
+; ^ keyword.operator.arithmetic.clojure
+; ^^^^^^^^^^^^^ constant.numeric.value.clojure
; ^ punctuation.separator.decimal.clojure
-; ^^^^ constant.numeric.value.clojure
-; ^^^^ constant.numeric.value.exponent.clojure
; ^ constant.numeric.suffix.clojure
; ^ - meta.number
; ^^^^^^^^^^^^^^^ meta.number.float.decimal.clojure
-; ^ punctuation.definition.numeric.sign.clojure
-; ^^^^ constant.numeric.value.clojure
+; ^ keyword.operator.arithmetic.clojure
+; ^^^^^^^^^^^^^ constant.numeric.value.clojure
; ^ punctuation.separator.decimal.clojure
-; ^^^^ constant.numeric.value.clojure
-; ^^^^ constant.numeric.value.exponent.clojure
; ^ constant.numeric.suffix.clojure
; ^ - meta.number
; ^^^^^^^^^^^^^^^ meta.number.float.decimal.clojure
-; ^ punctuation.definition.numeric.sign.clojure
-; ^^^^ constant.numeric.value.clojure
+; ^ keyword.operator.arithmetic.clojure
+; ^^^^^^^^^^^^^ constant.numeric.value.clojure
; ^ punctuation.separator.decimal.clojure
-; ^^^^ constant.numeric.value.clojure
-; ^^^^ constant.numeric.value.exponent.clojure
; ^ constant.numeric.suffix.clojure
; ^ - meta.number
; ^^^^^^^^^^^^^^^ meta.number.float.decimal.clojure
-; ^ punctuation.definition.numeric.sign.clojure
-; ^^^^ constant.numeric.value.clojure
+; ^ keyword.operator.arithmetic.clojure
+; ^^^^^^^^^^^^^ constant.numeric.value.clojure
; ^ punctuation.separator.decimal.clojure
-; ^^^^ constant.numeric.value.clojure
-; ^^^^ constant.numeric.value.exponent.clojure
; ^ constant.numeric.suffix.clojure
-1234.1234e+10M -1234.1234E+10M -1234.1234e-10M -1234.1234E-10M
; ^^^^^^^^^^^^^^^ meta.number.float.decimal.clojure
-; ^ punctuation.definition.numeric.sign.clojure
-; ^^^^ constant.numeric.value.clojure
+; ^ keyword.operator.arithmetic.clojure
+; ^^^^^^^^^^^^^ constant.numeric.value.clojure
; ^ punctuation.separator.decimal.clojure
-; ^^^^ constant.numeric.value.clojure
-; ^^^^ constant.numeric.value.exponent.clojure
; ^ constant.numeric.suffix.clojure
; ^ - meta.number
; ^^^^^^^^^^^^^^^ meta.number.float.decimal.clojure
-; ^ punctuation.definition.numeric.sign.clojure
-; ^^^^ constant.numeric.value.clojure
+; ^ keyword.operator.arithmetic.clojure
+; ^^^^^^^^^^^^^ constant.numeric.value.clojure
; ^ punctuation.separator.decimal.clojure
-; ^^^^ constant.numeric.value.clojure
-; ^^^^ constant.numeric.value.exponent.clojure
; ^ constant.numeric.suffix.clojure
; ^ - meta.number
; ^^^^^^^^^^^^^^^ meta.number.float.decimal.clojure
-; ^ punctuation.definition.numeric.sign.clojure
-; ^^^^ constant.numeric.value.clojure
+; ^ keyword.operator.arithmetic.clojure
+; ^^^^^^^^^^^^^ constant.numeric.value.clojure
; ^ punctuation.separator.decimal.clojure
-; ^^^^ constant.numeric.value.clojure
-; ^^^^ constant.numeric.value.exponent.clojure
; ^ constant.numeric.suffix.clojure
; ^ - meta.number
; ^^^^^^^^^^^^^^^ meta.number.float.decimal.clojure
-; ^ punctuation.definition.numeric.sign.clojure
-; ^^^^ constant.numeric.value.clojure
+; ^ keyword.operator.arithmetic.clojure
+; ^^^^^^^^^^^^^ constant.numeric.value.clojure
; ^ punctuation.separator.decimal.clojure
-; ^^^^ constant.numeric.value.clojure
-; ^^^^ constant.numeric.value.exponent.clojure
; ^ constant.numeric.suffix.clojure
; ## Breaks
diff --git a/D/D.sublime-syntax b/D/D.sublime-syntax
index d6b45ebe0d..c9643786a3 100644
--- a/D/D.sublime-syntax
+++ b/D/D.sublime-syntax
@@ -40,7 +40,7 @@ variables:
string_lookahead: '(?=`|[rxq]?"|q{)'
definitely_value_lookahead: '(?=!|~|\+|\-|\*|&|\bcast\b|\bdelete\b|\bnew\b|\bimport\b|\bis\b|\b__traits\b|\bfunction\b|\bdelegate\b|[0-9]|\[|\(|{{string_lookahead}}|\b({{language_constant}})\b|\b({{language_variable}})\b)'
- definitely_declaration_lookahead: '(?=({{name}}|\]|\))(\s+{{name}})|\b({{type_qualifier}})\b)'
+ definitely_declaration_lookahead: '(?=({{name}})(\s+\*|(\*|\[.*\])?\s+)({{name}})|\b({{type_qualifier}})\b)'
type_qualifier: 'const|immutable|inout|shared'
type_qualifier_lookahead: '(?=\b({{type_qualifier}})\b)'
@@ -194,7 +194,7 @@ contexts:
- include: integer-opt
- include: not-whitespace-illegal-pop
integer-opt:
- - match: '(0[bB])(_?)({{bin_digits}})({{integer_suffix}})?'
+ - match: (0[bB])(_?)({{bin_digits}})({{integer_suffix}})?
scope: meta.number.integer.binary.d
captures:
1: constant.numeric.base.d
@@ -202,7 +202,7 @@ contexts:
3: constant.numeric.value.d
4: constant.numeric.suffix.d
pop: true
- - match: '(0[xX])(_?)({{hex_digits}})({{integer_suffix}})?'
+ - match: (0[xX])(_?)({{hex_digits}})({{integer_suffix}})?
scope: meta.number.integer.hexadecimal.d
captures:
1: constant.numeric.base.d
@@ -210,7 +210,7 @@ contexts:
3: constant.numeric.value.d
4: constant.numeric.suffix.d
pop: true
- - match: '({{dec_integer}})({{integer_suffix}})?'
+ - match: ({{dec_integer}})({{integer_suffix}})?
scope: meta.number.integer.decimal.d
captures:
1: constant.numeric.value.d
@@ -222,77 +222,67 @@ contexts:
- include: not-whitespace-illegal-pop
floating-point-opt:
# decimal imaginary numbers
- - match: '({{dec_integer}})?(?:(\.)({{dec_digits}})?)?({{dec_exponent}})?({{imaginary_suffix}})'
+ - match: ({{dec_integer}}?(?:(\.){{dec_digits}}?)?{{dec_exponent}}?)({{imaginary_suffix}})
scope: meta.number.imaginary.decimal.d
captures:
1: constant.numeric.value.d
2: punctuation.separator.decimal.d
- 3: constant.numeric.value.d
- 4: constant.numeric.value.exponent.d
- 5: constant.numeric.suffix.d
+ 3: constant.numeric.suffix.d
pop: true
# decimal floats
- match: |-
(?x:
({{dec_integer}})
(?:
- (?:
+ (
(\.)
(?:
# 1.1, 1.1e1, 1.1e-1, 1.1f, 1.1e1f, 1.1e-1f, 1.1L, 1.1e1L, 1.1e-1L
- ({{dec_digits}}) ({{dec_exponent}})?
+ {{dec_digits}} {{dec_exponent}}?
# 1.e1, 1.e-1, 1.e1f, 1.e-1f, 1.e1L, 1.e-1L
- | ({{dec_exponent}})
+ | {{dec_exponent}}
# 1., 1.f, 1.L # but not `..` or method/attribute access
| (?!\.|\s*[[:alpha:]_]) )
# 1e1 1e1f 1e1L
- | ({{dec_exponent}})
+ | {{dec_exponent}}
) ({{integer_float_suffix}})?
# 1f
| ({{float_suffix}})
)
# .1, .1e1, .1e-1, .1f, .1e1f, .1e-1f, .1L, .1e1L, .1e-1L
- | (\.) ({{dec_digits}}) ({{dec_exponent}})? ({{integer_float_suffix}})?
+ | ( (\.) {{dec_digits}} {{dec_exponent}}? ) ({{integer_float_suffix}})?
)
scope: meta.number.float.decimal.d
captures:
1: constant.numeric.value.d
- 2: punctuation.separator.decimal.d
- 3: constant.numeric.value.d
- 4: constant.numeric.value.exponent.d
- 5: constant.numeric.value.exponent.d
- 6: constant.numeric.value.exponent.d
- 7: constant.numeric.suffix.d
+ 2: constant.numeric.value.d
+ 3: punctuation.separator.decimal.d
+ 4: constant.numeric.suffix.d
+ 5: constant.numeric.suffix.d
+ 6: constant.numeric.value.d
+ 7: punctuation.separator.decimal.d
8: constant.numeric.suffix.d
- 9: punctuation.separator.decimal.d
- 10: constant.numeric.value.d
- 11: constant.numeric.value.exponent.d
- 12: constant.numeric.suffix.d
pop: true
# hexadecimal imaginary numbers
- - match: (0[xX])(_?)({{hex_digits}})?(?:(\.)({{hex_digits}})?)?({{hex_exponent}})?({{imaginary_suffix}})
+ - match: (0[xX])(_?)({{hex_digits}}?(?:(\.){{hex_digits}}?)?{{hex_exponent}}?)({{imaginary_suffix}})
scope: meta.number.imaginary.hexadecimal.d
captures:
1: constant.numeric.base.d
2: invalid.illegal.numeric.d
3: constant.numeric.value.d
4: punctuation.separator.decimal.d
- 5: constant.numeric.value.d
- 6: constant.numeric.value.exponent.d
- 7: constant.numeric.suffix.d
+ 5: constant.numeric.suffix.d
pop: true
# hexadecimal floats
- - match: (0[xX])(_?)({{hex_digits}})?(?:(\.)({{hex_digits}})?)?({{hex_exponent}})({{integer_float_suffix}})?
+ - match: (0[xX])(_?)({{hex_digits}}?(?:(\.){{hex_digits}}?)?{{hex_exponent}})({{integer_float_suffix}})?
scope: meta.number.float.hexadecimal.d
captures:
1: constant.numeric.base.d
2: invalid.illegal.numeric.d
3: constant.numeric.value.d
4: punctuation.separator.decimal.d
- 5: constant.numeric.value.d
- 6: constant.numeric.value.exponent.d
- 7: constant.numeric.suffix.d
+ 5: constant.numeric.suffix.d
pop: true
# binary imaginary numbers
@@ -1109,6 +1099,13 @@ contexts:
- include: first-value-parens-after
value:
+ - match: '\b({{name}})\s*(:)'
+ captures:
+ 1: variable.other.d
+ 2: punctuation.separator.mapping.key-value.d
+ set: value
+ - include: value-no-mapping-key
+ value-no-mapping-key:
- include: attribute-in
- match: '!'
scope: keyword.operator.logical.d
@@ -1236,11 +1233,6 @@ contexts:
- match: \.
scope: meta.path.d punctuation.accessor.dot.d
set: [value-after, value-identifier]
- - match: '\b({{name}})\s*(:)'
- captures:
- 1: variable.other.d
- 2: punctuation.separator.mapping.key-value.d
- set: value
- match: '{{name_lookahead}}'
set: [value-after, value-identifier]
- include: not-whitespace-illegal-pop
@@ -1432,7 +1424,7 @@ contexts:
set: value-maybe-pointer-after
- match: '\?'
scope: keyword.operator.ternary.d
- set: [value-condition-after, value]
+ set: [value-condition-after, value-condition]
- match: '(?=\b(function|delegate)\b)'
set: [value-after, basic-type2]
- match: '(?=\S)'
@@ -1464,6 +1456,10 @@ contexts:
set: basic-type2
- match: '(?=\S)'
set: value
+ value-condition:
+ - match: (?=:)
+ pop: 1
+ - include: value-no-mapping-key
value-condition-after:
- match: ':'
scope: keyword.operator.ternary.d
@@ -1496,6 +1492,19 @@ contexts:
set: value-list
- include: not-whitespace-illegal-pop
+ value-list-no-mapping-key:
+ - match: '(?=\)|}|]|;|:)'
+ pop: true
+ - match: '(?=\S)'
+ set: [value-list-after-no-mapping-key, value-no-mapping-key]
+ value-list-after-no-mapping-key:
+ - match: '(?=\)|}|]|;|:)'
+ pop: true
+ - match: ','
+ scope: punctuation.separator.sequence.d
+ set: value-list-no-mapping-key
+ - include: not-whitespace-illegal-pop
+
value-array-list:
- match: '(?=\])'
pop: true
@@ -2080,9 +2089,10 @@ contexts:
- match: '\('
scope: punctuation.section.parens.begin.d
set: [switch-after, value]
+ - include: not-whitespace-illegal-pop
- match: '\bcase\b'
scope: keyword.control.flow.d
- push: [case-after, value-list]
+ push: [case-after, value-list-no-mapping-key]
- match: '\bdefault\b'
scope: keyword.control.flow.d
push:
@@ -2104,7 +2114,7 @@ contexts:
set:
- match: '\bcase\b'
scope: keyword.control.flow.d
- set: [case-after, value]
+ set: [case-after, value-no-mapping-key]
- include: not-whitespace-illegal-pop
- match: '(?=\S)'
pop: true
@@ -2117,6 +2127,9 @@ contexts:
- match: '\)'
scope: punctuation.section.parens.end.d
pop: true
+ - match: ';'
+ scope: punctuation.terminator.d
+ push: first-value
- include: statement-list-in
- include: not-whitespace-illegal-pop
diff --git a/D/tests/syntax_test_d.d b/D/tests/syntax_test_d.d
index 46f00a93dc..08d808fde9 100644
--- a/D/tests/syntax_test_d.d
+++ b/D/tests/syntax_test_d.d
@@ -233,19 +233,17 @@ imag = 123_45i + 0_.1_i + 12_.e1i;
// ^ constant.numeric.suffix.d
// ^ keyword.operator.arithmetic.d
// ^^^^^^ meta.number.imaginary.decimal.d
-// ^^ constant.numeric.value.d
+// ^^^^^ constant.numeric.value.d
// ^ punctuation.separator.decimal.d
-// ^^ constant.numeric.value.d
// ^ constant.numeric.suffix.d
// ^^^^^^^ meta.number.imaginary.decimal.d
-// ^^^ constant.numeric.value.d
-// ^ punctuation.separator.decimal.d
-// ^^ constant.numeric.value.exponent.d
-// ^ constant.numeric.suffix.d
+// ^^^ constant.numeric.value.d - punctuation
+// ^ constant.numeric.value.d punctuation.separator.decimal.d
+// ^^ constant.numeric.value.d - punctuation
+// ^ constant.numeric.suffix.d - punctuation
imag = 23134723__742e1i;
// ^^^^^^^^^^^^^^^^ meta.number.imaginary.decimal.d
-// ^^^^^^^^^^^^^ constant.numeric.value.d
-// ^^ constant.numeric.value.exponent.d
+// ^^^^^^^^^^^^^^^ constant.numeric.value.d
// ^ constant.numeric.suffix.d
imag = 0x_3472389742f_i;
// ^^^^^^^^^^^^^^^^ meta.number.imaginary.hexadecimal.d
@@ -257,8 +255,7 @@ imag = 0x_34723897p-34i;
// ^^^^^^^^^^^^^^^^ meta.number.imaginary.hexadecimal.d
// ^^ constant.numeric.base.d
// ^ invalid.illegal.numeric.d
-// ^^^^^^^^ constant.numeric.value.d
-// ^^^^ constant.numeric.value.exponent.d
+// ^^^^^^^^^^^^ constant.numeric.value.d
// ^ constant.numeric.suffix.d
imag = 0x347._23897p-34i;
// ^^^^^ meta.number.integer.hexadecimal.d
@@ -277,17 +274,16 @@ imag = 0b_0100_010_00_i;
auto f = 0_.0_;
// ^^^^^ meta.number.float.decimal.d
-// ^^ constant.numeric.value.d
+// ^^^^^ constant.numeric.value.d
// ^ punctuation.separator.decimal.d
-// ^^ constant.numeric.value.d
f = 0_.;
// ^^^ meta.number.float.decimal.d
-// ^^ constant.numeric.value.d
-// ^ punctuation.separator.decimal.d
+// ^^ constant.numeric.value.d - punctuation
+// ^ constant.numeric.value.d punctuation.separator.decimal.d
f = .123_1243;
// ^^^^^^^^^ meta.number.float.decimal.d
-// ^ punctuation.separator.decimal.d
-// ^^^^^^^^ constant.numeric.value.d
+// ^ constant.numeric.value.d punctuation.separator.decimal.d
+// ^^^^^^^^ constant.numeric.value.d - punctuation
f = ._123_1243 + 1._123;
// ^ punctuation.accessor.dot.d
// ^^^^^^^^^ variable.other.d
@@ -297,20 +293,18 @@ f = ._123_1243 + 1._123;
// ^^^^ variable.other.d
f = 3423.2e-45;
// ^^^^^^^^^^ meta.number.float.decimal.d
-// ^^^^ constant.numeric.value.d
-// ^ punctuation.separator.decimal.d
-// ^ constant.numeric.value.d
-// ^^^^ constant.numeric.value.exponent.d
+// ^^^^ constant.numeric.value.d - punctuation
+// ^ constant.numeric.value.d punctuation.separator.decimal.d
+// ^^^^^ constant.numeric.value.d - punctuation
f = 2.e-45;
// ^^^^^^ meta.number.float.decimal.d
-// ^ constant.numeric.value.d
-// ^ punctuation.separator.decimal.d
-// ^^^^ constant.numeric.value.exponent.d
+// ^ constant.numeric.value.d - punctuation
+// ^ constant.numeric.value.d punctuation.separator.decimal.d
+// ^^^^ constant.numeric.value.d - punctuation
f = .4E+4L;
// ^^^^^^ meta.number.float.decimal.d
-// ^ punctuation.separator.decimal.d
-// ^ constant.numeric.value.d
-// ^^^ constant.numeric.value.exponent.d
+// ^ constant.numeric.value.d punctuation.separator.decimal.d
+// ^^^^ constant.numeric.value.d - punctuation
// ^ constant.numeric.suffix.d
f = 1f;
// ^^ meta.number.float.decimal.d
@@ -319,8 +313,7 @@ f = 1f;
f = 0x123p2f;
// ^^^^^^^^ meta.number.float.hexadecimal.d
// ^^ constant.numeric.base.d
-// ^^^ constant.numeric.value.d
-// ^^ constant.numeric.value.exponent.d
+// ^^^^^ constant.numeric.value.d
// ^ constant.numeric.suffix.d
f = 0b10101101f;
// ^^^^^^^^^^^ meta.number.float.binary.d
@@ -330,17 +323,14 @@ f = 0b10101101f;
f = 0x.1aFp2;
// ^^^^^^^^ meta.number.float.hexadecimal.d
// ^^ constant.numeric.base.d
-// ^ punctuation.separator.decimal.d
-// ^ constant.numeric.value.d
-// ^^ constant.numeric.value.d
-// ^^ constant.numeric.value.exponent.d
+// ^ constant.numeric.value.d punctuation.separator.decimal.d
+// ^^^^^ constant.numeric.value.d - punctuation
f = 0xF.AP-2f;
// ^^^^^^^^^ meta.number.float.hexadecimal.d
// ^^ constant.numeric.base.d
-// ^ constant.numeric.value.d
-// ^ punctuation.separator.decimal.d
-// ^ constant.numeric.value.d
-// ^^^ constant.numeric.value.exponent.d
+// ^ constant.numeric.value.d - punctuation
+// ^ constant.numeric.value.d punctuation.separator.decimal.d
+// ^^^^ constant.numeric.value.d - punctuation
// ^ constant.numeric.suffix.d
@foo:
@@ -578,7 +568,7 @@ extern(1)
// ^ variable.other.d
// ^ punctuation.terminator.d
foo[string] b = 123;
-//^^^ variable.other.d
+//^^^ storage.type.d
// ^ punctuation.section.brackets.begin.d
// ^^^^^^ storage.type.d
// ^ punctuation.section.brackets.end.d
@@ -587,10 +577,22 @@ extern(1)
// ^^^ meta.number.integer.decimal.d
// ^ punctuation.terminator.d
bar* some_long_Name;
-//^^^ variable.other.d
+//^^^ storage.type.d
// ^ keyword.operator.pointer.d
// ^^^^^^^^^^^^^^ variable.other.d
// ^ punctuation.terminator.d
+ bar *some_long_Name;
+//^^^ storage.type.d
+// ^ keyword.operator.pointer.d
+// ^^^^^^^^^^^^^^ variable.other.d
+// ^ punctuation.terminator.d
+ foo[BAR] baz;
+//^^^ storage.type.d
+// ^ punctuation.section.brackets.begin.d
+// ^^^ variable.other.d
+// ^ punctuation.section.brackets.end.d
+// ^^^ variable.other.d
+// ^ punctuation.terminator.d
auto foo = 3;
//^^^^ storage.modifier.d
// ^^^ variable.other.d
@@ -1091,7 +1093,7 @@ extern(1)
}
//^ meta.function.d meta.block.d punctuation.section.block.end.d
T[] map(T, void fn)(T[] array) {
- //^ variable.other.d
+ //^ storage.type.d
// ^ punctuation.section.brackets.begin.d
// ^ punctuation.section.brackets.end.d
// ^^^ meta.function.d entity.name.function.d
@@ -2107,6 +2109,32 @@ extern(1)
// ^^^^^ string.quoted.double.d
// ^ punctuation.terminator.d
+ foo* bar = foo* bar;
+//^^^ storage.type.d
+// ^ keyword.operator.pointer.d
+// ^^^ variable.other.d
+// ^ keyword.operator.assignment.d
+// ^^^ variable.other.d
+// ^ keyword.operator.arithmetic.d
+// ^^^ variable.other.d
+// ^ punctuation.terminator.d
+
+ foo bar = (baz *var[foo* bar]);
+//^^^ storage.type.d
+// ^^^ variable.other.d
+// ^ keyword.operator.assignment.d
+// ^ punctuation.section.group.begin.d
+// ^^^ variable.other.d
+// ^ keyword.operator.arithmetic.d
+// ^^^ variable.other.d
+// ^ punctuation.section.brackets.begin.d
+// ^^^ variable.other.d
+// ^ keyword.operator.arithmetic.d
+// ^^^ variable.other.d
+// ^ punctuation.section.brackets.end.d
+// ^ punctuation.section.group.end.d
+// ^ punctuation.terminator.d
+
auto f = foo ? 12 : 15;
//^^^^ storage.modifier.d
// ^ variable.other.d
@@ -2118,6 +2146,28 @@ extern(1)
// ^^ meta.number.integer.decimal.d
// ^ punctuation.terminator.d
+ int a = b ? c : d;
+//^^^ storage.type.d
+// ^ variable.other.d
+// ^ keyword.operator.assignment.d
+// ^ meta.path.d variable.other.d
+// ^ keyword.operator.ternary.d
+// ^ meta.path.d variable.other.d
+// ^ keyword.operator.ternary.d
+// ^ meta.path.d variable.other.d
+// ^ punctuation.terminator.d
+
+ int a=b?c:d;
+//^^^ storage.type.d
+// ^ variable.other.d
+// ^ keyword.operator.assignment.d
+// ^ meta.path.d variable.other.d
+// ^ keyword.operator.ternary.d
+// ^ meta.path.d variable.other.d
+// ^ keyword.operator.ternary.d
+// ^ meta.path.d variable.other.d
+// ^ punctuation.terminator.d
+
foreach (ref a; foo) {}
//^^^^^^^ keyword.control.loop.d
// ^ punctuation.section.parens.begin.d
@@ -2186,6 +2236,22 @@ extern(1)
// ^^ keyword.operator.arithmetic.d
// ^ meta.number.integer.decimal.d
// ^ punctuation.separator.case-statement.d
+ case foo:
+ //^^^^ keyword.control.flow.d
+ // ^^^ meta.path.d variable.other.d
+ // ^ punctuation.separator.case-statement.d
+ baz();
+ // ^^^^^ meta.block.d meta.function-call.d
+ // ^ punctuation.terminator.d
+ case foo, bar:
+ //^^^^ keyword.control.flow.d
+ // ^^^ meta.path.d variable.other.d
+ // ^ punctuation.separator.sequence.d
+ // ^^^ meta.path.d variable.other.d
+ // ^ punctuation.separator.case-statement.d
+ baz();
+ // ^^^^^ meta.block.d meta.function-call.d
+ // ^ punctuation.terminator.d
case 2, "foo":
//^^^^ keyword.control.flow.d
// ^ meta.number.integer.decimal.d
@@ -2202,6 +2268,30 @@ extern(1)
// ^^^^ keyword.control.flow.d
// ^ meta.number.integer.decimal.d
// ^ punctuation.separator.case-statement.d
+ case NO_KEY:
+ //^^^^ keyword.control.flow.d
+ // ^^^^^^ meta.path.d variable.other.d
+ // ^ punctuation.separator.case-statement.d
+ if (foo) {
+ // ^^ keyword.control.conditional.d
+ }
+ break;
+ // ^^^^^ keyword.control.flow.d
+ // ^ punctuation.terminator.d
+ case no_key: .. case NO_KEY:
+ //^^^^ keyword.control.flow.d
+ // ^^^^^^ meta.path.d variable.other.d
+ // ^ punctuation.separator.case-statement.d
+ // ^^ keyword.operator.d
+ // ^^^^ keyword.control.flow.d
+ // ^^^^^^ meta.path.d variable.other.d
+ // ^ punctuation.separator.case-statement.d
+ if (foo) {
+ // ^^ keyword.control.conditional.d
+ }
+ break;
+ // ^^^^^ keyword.control.flow.d
+ // ^ punctuation.terminator.d
default:
//^^^^^^^ keyword.control.flow.d
// ^ punctuation.separator.case-statement.d
diff --git a/Diff/Diff.sublime-settings b/Diff/Diff.sublime-settings
new file mode 100644
index 0000000000..139b28603c
--- /dev/null
+++ b/Diff/Diff.sublime-settings
@@ -0,0 +1,4 @@
+{
+ "trim_trailing_white_space_on_save": false,
+ "translate_tabs_to_spaces": false,
+}
diff --git a/Git Formats/Git Attributes.sublime-syntax b/Git Formats/Git Attributes.sublime-syntax
index 4bba0ccf6b..5c4f0349de 100644
--- a/Git Formats/Git Attributes.sublime-syntax
+++ b/Git Formats/Git Attributes.sublime-syntax
@@ -63,6 +63,7 @@ contexts:
- include: Git Common.sublime-syntax#fnmatch-body
pattern-attributes:
+ - meta_include_prototype: false
- match: ''
set: attributes-list
@@ -103,36 +104,44 @@ contexts:
scope: invalid.illegal.attribute-name.git.attributes
meta-diff:
+ - meta_include_prototype: false
- meta_scope: meta.attribute.builtin.diff.git.attributes
- - include: else-pop
+ - include: immediately-pop
meta-encoding:
+ - meta_include_prototype: false
- meta_scope: meta.attribute.builtin.encoding.git.attributes
- - include: else-pop
+ - include: immediately-pop
meta-eol:
+ - meta_include_prototype: false
- meta_scope: meta.attribute.builtin.eol.git.attributes
- - include: else-pop
+ - include: immediately-pop
meta-filter:
+ - meta_include_prototype: false
- meta_scope: meta.attribute.builtin.filter.git.attributes
- - include: else-pop
+ - include: immediately-pop
meta-merge:
+ - meta_include_prototype: false
- meta_scope: meta.attribute.builtin.merge.git.attributes
- - include: else-pop
+ - include: immediately-pop
meta-text:
+ - meta_include_prototype: false
- meta_scope: meta.attribute.builtin.text.git.attributes
- - include: else-pop
+ - include: immediately-pop
meta-whitespace:
+ - meta_include_prototype: false
- meta_scope: meta.attribute.builtin.whitespace.git.attributes
- - include: else-pop
+ - include: immediately-pop
meta-other:
+ - meta_include_prototype: false
- meta_scope: meta.attribute.other.git.attributes
- - include: else-pop
+ - include: immediately-pop
##[ ATTRIBUTE KEY VALUE ]##############################################
@@ -140,7 +149,7 @@ contexts:
- match: \w+[-\w]*\b
scope: meta.mapping.key.git.attributes variable.language.attribute.git.attributes
set: attribute-maybe-value-list
- - include: else-pop
+ - include: immediately-pop
attribute-maybe-value-list:
- meta_content_scope: meta.mapping.git.attributes
@@ -151,7 +160,7 @@ contexts:
scope: punctuation.separator.mapping.key-value.git.attributes
set: attribute-value-expected
- include: attribute-separator
- - include: else-pop
+ - include: immediately-pop
attribute-value-list:
- meta_content_scope: meta.mapping.value.git.attributes
@@ -164,22 +173,18 @@ contexts:
set: attribute-value-expected
- match: \S
scope: invalid.illegal.value.git.attributes
- - include: else-pop
+ - include: immediately-pop
attribute-value-content:
# double quoted value
- match: \"
scope: punctuation.definition.string.begin.git.attributes
- set:
- - meta_scope: string.quoted.double.git.attributes
- - include: string-end
- - match: \\[\\\"\'fnrst]
- scope: constant.character.escape.git.attributes
+ set: string-content
# unquoted value is everything except , and whitespace
- match: '[^,\s]*'
- scope: string.unquoted.git.attributes
+ scope: meta.string.git.attributes string.unquoted.git.attributes
pop: true
- - include: else-pop
+ - include: immediately-pop
attribute-value-expected:
# Attributes are separated by whitespace
@@ -197,14 +202,21 @@ contexts:
##[ PROTOTYPES ]#######################################################
+ string-content:
+ - meta_include_prototype: false
+ - meta_scope: meta.string.git.attributes string.quoted.double.git.attributes
+ - include: string-end
+ - match: \\[\\\"\'fnrst]
+ scope: constant.character.escape.git.attributes
+
string-end:
- match: \"
scope: punctuation.definition.string.end.git.attributes
pop: true
- - match: $\n?
+ - match: \n
scope: invalid.illegal.unexpected.eol.git.attributes
pop: true
- else-pop:
+ immediately-pop:
- match: ''
pop: true
diff --git a/Git Formats/Git Rebase.sublime-syntax b/Git Formats/Git Rebase.sublime-syntax
index fa3c3a4f53..7d908c8573 100644
--- a/Git Formats/Git Rebase.sublime-syntax
+++ b/Git Formats/Git Rebase.sublime-syntax
@@ -3,10 +3,13 @@
# Highlight interactive rebase text (git rebase -i).
name: Git Rebase Todo
+scope: text.git.rebase
+version: 2
+
file_extensions:
- git-rebase-todo
-first_line_match: '^(?:drop|edit|exec|fixup|pick|reword|squash|[defprsx]) \h{7,} '
-scope: text.git.rebase
+
+first_line_match: '^(?:drop|edit|fixup|pick|reword|squash|[defprsx]) \h{7,} '
variables:
comment_char: '[#;]'
@@ -16,21 +19,24 @@ contexts:
main:
- include: comments
- - include: commit
+ - include: shell-commands
+ - include: branch-commands
+ - include: commit-commands
##[ COMMENTS ]#########################################################
comments:
- - match: ^\s*({{comment_char}})
- captures:
- 1: punctuation.definition.comment.git.rebase
- push:
- - meta_scope: comment.line.git.rebase
- - match: ^(?!\s*{{comment_char}})
- pop: true
- - include: heading
- - include: commands-help
- - include: rebase-msg
+ - match: '{{comment_char}}'
+ scope: punctuation.definition.comment.git.rebase
+ push: comment-content
+
+ comment-content:
+ - meta_scope: comment.line.git.rebase
+ - match: ^(?!\s*{{comment_char}})
+ pop: 1
+ - include: heading
+ - include: commands-help
+ - include: rebase-msg
heading:
# all comments ending with colon are scoped as headlines
@@ -108,61 +114,93 @@ contexts:
3: constant.other.hash.git.rebase
4: constant.other.hash.git.rebase
-##[ COMMITS ]##########################################################
+##[ COMMANDS ]#########################################################
+
+ branch-commands:
+ - match: ^\s*(label)\s+(\S+)
+ captures:
+ 0: meta.branch.label.git.rebase
+ 1: keyword.other.label.git.rebase
+ 2: constant.language.branch-name.git.commit
+ - match: ^\s*(merge)\s+((-)C)\s+({{hash}})\s+(\S+)
+ captures:
+ 0: meta.branch.merge.git.rebase
+ 1: keyword.operator.branch.merge.git.rebase
+ 2: variable.parameter.option.git.rebase
+ 3: punctuation.definition.variable.git.rebase
+ 4: constant.other.hash.git.rebase
+ 5: constant.language.branch-name.git.commit
+ - match: ^\s*(reset)\s+(?:({{hash}})|(\S+))
+ captures:
+ 0: meta.branch.reset.git.rebase
+ 1: keyword.operator.branch.reset.git.rebase
+ 2: constant.other.hash.git.rebase
+ 3: constant.language.branch-name.git.commit
- commit:
+ commit-commands:
# e.g. pick d284bb2 Initial commit
- match: ^\s*
- push: [commit-subject, commit-hash, commit-commands]
+ push: [commit-subject, commit-hash, commit-command]
- commit-commands:
+ commit-command:
- match: (?:d|drop)\b
scope: keyword.operator.commit.drop.git.rebase
- pop: true
+ pop: 1
- match: (?:e|edit)\b
scope: keyword.operator.commit.edit.git.rebase
- pop: true
- - match: (?:x|exec)\b
- scope: keyword.operator.commit.exec.git.rebase
- pop: true
+ pop: 1
- match: (?:f|fixup)\b
scope: keyword.operator.commit.fixup.git.rebase
- pop: true
+ pop: 1
- match: (?:p|pick)\b
scope: keyword.operator.commit.pick.git.rebase
- pop: true
+ pop: 1
- match: (?:r|reword)\b
scope: keyword.operator.commit.reword.git.rebase
- pop: true
+ pop: 1
- match: (?:s|squash)\b
scope: keyword.operator.commit.squash.git.rebase
- pop: true
+ pop: 1
+ - include: comments
- include: line-end
- match: \S+
scope: invalid.illegal.command-expected.git.rebase
- pop: true
+ pop: 1
commit-hash:
- match: '{{hash}}' # e.g. d284bb2
scope: constant.other.hash.git.rebase
- pop: true
+ pop: 1
- include: line-end
- match: \S+
scope: invalid.illegal.hash-expected.git.rebase
- pop: true
+ pop: 1
commit-subject:
- meta_scope: meta.commit.git.rebase
- include: line-end
- match: (?=\S) # subject beginns with first none whitespece
- set:
- - meta_scope: meta.commit.git.rebase
- - meta_content_scope: meta.subject.git.commit
- - include: Git Common.sublime-syntax#references
- - include: line-end
+ set: commit-subject-content
+
+ commit-subject-content:
+ - meta_scope: meta.commit.git.rebase
+ - meta_content_scope: meta.subject.git.commit
+ - include: Git Common.sublime-syntax#references
+ - include: line-end
+
+ shell-commands:
+ - match: ^\s*(x|exec)\b
+ captures:
+ 0: meta.shell.git.rebase
+ 1: keyword.operator.exec.git.rebase
+ embed: scope:source.shell
+ embed_scope: meta.shell.git.rebase source.shell.embedded.git.rebase
+ escape: $\n?
+ escape_captures:
+ 0: meta.shell.git.rebase
##[ PROTOTYPES ]#######################################################
line-end:
- match: $\n?
- pop: true
+ pop: 1
diff --git a/Git Formats/Snippets/Git Config - Section.sublime-snippet b/Git Formats/Snippets/Git Config - Section.sublime-snippet
index bdf9f3c6cb..71c8603e47 100644
--- a/Git Formats/Snippets/Git Config - Section.sublime-snippet
+++ b/Git Formats/Snippets/Git Config - Section.sublime-snippet
@@ -4,6 +4,6 @@
$0
]]>
section
- source.git.config
+ text.git.config
[section]
diff --git a/Git Formats/syntax_test_git_attributes b/Git Formats/tests/syntax_test_git_attributes
similarity index 100%
rename from Git Formats/syntax_test_git_attributes
rename to Git Formats/tests/syntax_test_git_attributes
diff --git a/Git Formats/syntax_test_git_commit b/Git Formats/tests/syntax_test_git_commit
similarity index 100%
rename from Git Formats/syntax_test_git_commit
rename to Git Formats/tests/syntax_test_git_commit
diff --git a/Git Formats/syntax_test_git_config b/Git Formats/tests/syntax_test_git_config
similarity index 100%
rename from Git Formats/syntax_test_git_config
rename to Git Formats/tests/syntax_test_git_config
diff --git a/Git Formats/syntax_test_git_ignore b/Git Formats/tests/syntax_test_git_ignore
similarity index 100%
rename from Git Formats/syntax_test_git_ignore
rename to Git Formats/tests/syntax_test_git_ignore
diff --git a/Git Formats/syntax_test_git_link b/Git Formats/tests/syntax_test_git_link
similarity index 100%
rename from Git Formats/syntax_test_git_link
rename to Git Formats/tests/syntax_test_git_link
diff --git a/Git Formats/syntax_test_git_log b/Git Formats/tests/syntax_test_git_log
similarity index 100%
rename from Git Formats/syntax_test_git_log
rename to Git Formats/tests/syntax_test_git_log
diff --git a/Git Formats/syntax_test_git_mailmap b/Git Formats/tests/syntax_test_git_mailmap
similarity index 100%
rename from Git Formats/syntax_test_git_mailmap
rename to Git Formats/tests/syntax_test_git_mailmap
diff --git a/Git Formats/syntax_test_git_merge b/Git Formats/tests/syntax_test_git_merge
similarity index 100%
rename from Git Formats/syntax_test_git_merge
rename to Git Formats/tests/syntax_test_git_merge
diff --git a/Git Formats/syntax_test_git_rebase b/Git Formats/tests/syntax_test_git_rebase
similarity index 69%
rename from Git Formats/syntax_test_git_rebase
rename to Git Formats/tests/syntax_test_git_rebase
index e9f60e38e9..18979756c6 100644
--- a/Git Formats/syntax_test_git_rebase
+++ b/Git Formats/tests/syntax_test_git_rebase
@@ -1,5 +1,18 @@
# SYNTAX TEST "Git Rebase.sublime-syntax"
# <- text.git.rebase comment.line punctuation.definition.comment
+label onto
+# <- meta.branch.label.git.rebase keyword.other.label.git.rebase
+#^^^^^^^^^ meta.branch.label.git.rebase
+#^^^^ keyword.other.label.git.rebase
+# ^^^^ constant.language.branch-name.git.commit
+reset 9698953 # Fix form submission
+# <- meta.branch.reset.git.rebase keyword.operator.branch.reset.git.rebase
+#^^^^^^^^^^^^ meta.branch.reset.git.rebase
+# ^ - meta.branch - comment
+# ^^^^^^^^^^^^^^^^^^^^^^ comment.line.git.rebase
+# ^ punctuation.definition.comment.git.rebase
+#^^^^ keyword.operator.branch.reset.git.rebase
+# ^^^^^^^ constant.other.hash.git.rebase
pick d284bb2 Initial commit
# <- meta.commit
#^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.commit
@@ -63,6 +76,28 @@ a 6746x20 Invalid command and hash # no comment (#403)
# ^ punctuation.definition.reference.issue.git
# ^^^^ meta.reference.issue.git constant.other.reference.issue.git
# ^ - meta.subject.git.commit
+label feature/branch-name
+# <- meta.branch.label.git.rebase keyword.other.label.git.rebase
+#^^^^^^^^^^^^^^^^^^^^^^^^ meta.branch.label.git.rebase
+#^^^^ keyword.other.label.git.rebase
+# ^^^^^^^^^^^^^^^^^^^ constant.language.branch-name.git.commit
+reset onto
+# <- meta.branch.reset.git.rebase keyword.operator.branch.reset.git.rebase
+#^^^^^^^^^ meta.branch.reset.git.rebase
+#^^^^ keyword.operator.branch.reset.git.rebase
+# ^^^^ constant.language.branch-name.git.commit
+merge -C c7cba2e feature/branch-name # Merge branch 'alicja/loyalty'
+# <- meta.branch.merge.git.rebase keyword.operator.branch.merge.git.rebase
+#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.branch.merge.git.rebase
+# ^ - meta.branch - comment
+# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.git.rebase
+# ^ punctuation.definition.comment.git.rebase
+#^^^^ keyword.operator.branch.merge.git.rebase
+# ^^ variable.parameter.option.git.rebase
+# ^ punctuation.definition.variable.git.rebase
+# ^^^^^^^ constant.other.hash.git.rebase
+# ^^^^^^^^^^^^^^^^^^^ constant.language.branch-name.git.commit
+
# p 6746220 Second pick commit # no comment
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.git.rebase
d d284bb2 Drop commit
@@ -73,10 +108,6 @@ a 6746x20 Invalid command and hash # no comment (#403)
# ^ keyword.operator.commit.edit
edit d284bb2 Edit commit
# ^^^^ keyword.operator.commit.edit
- x d284bb2 Execute command
-# ^ keyword.operator.commit.exec
- exec d284bb2 Execute command
-# ^^^^ keyword.operator.commit.exec
f d284bb2 Fixup commit
# ^ keyword.operator.commit.fixup
fixup d284bb2 Fixup commit
@@ -85,6 +116,24 @@ a 6746x20 Invalid command and hash # no comment (#403)
# ^ keyword.operator.commit.reword
reword d284bb2 Reword commit
# ^^^^^^ keyword.operator.commit.reword
+ x git tag -d 0.1.0
+# ^ meta.shell.git.rebase - source.shell
+# ^^^^^^^^^^^^^^^^^ meta.shell.git.rebase source.shell.embedded.git.rebase
+# ^^^ meta.function-call.identifier.shell
+# ^^^^^^^^^^^^^ meta.function-call.arguments.shell
+# ^ meta.shell.git.rebase - source
+# ^ keyword.operator.exec.git.rebase
+# ^^^ variable.function.shell
+# ^^ variable.parameter.option.shell
+ exec git tag -d 0.1.0
+# ^^^^ meta.shell.git.rebase - source.shell
+# ^^^^^^^^^^^^^^^^^ meta.shell.git.rebase source.shell.embedded.git.rebase
+# ^^^ meta.function-call.identifier.shell
+# ^^^^^^^^^^^^^ meta.function-call.arguments.shell
+# ^^^^ keyword.operator.exec.git.rebase
+# ^^^ variable.function.shell
+# ^^ variable.parameter.option.shell
+# ^ meta.shell.git.rebase - source
# Rebase 9e73d21..6746220 onto 9e73d21 (2 commands)
# <- comment.line punctuation.definition.comment
diff --git a/Git Formats/syntax_test_git_tag b/Git Formats/tests/syntax_test_git_tag
similarity index 100%
rename from Git Formats/syntax_test_git_tag
rename to Git Formats/tests/syntax_test_git_tag
diff --git a/Go/Go.sublime-syntax b/Go/Go.sublime-syntax
index 57505d4735..5710209839 100644
--- a/Go/Go.sublime-syntax
+++ b/Go/Go.sublime-syntax
@@ -2,7 +2,7 @@
---
# http://www.sublimetext.com/docs/3/syntax.html
-# The structure and terminology of this syntax reflects the spec:
+# The structure and lexicon of this syntax reflects the Go spec:
# https://golang.org/ref/spec
# The following is a simplified model of Sublime Text's syntax engine, reverse-
@@ -126,7 +126,7 @@ contexts:
3: meta.punctuation.accessor.colon.go
4: meta.variable.function.go
push:
- - meta_scope: comment.line.go meta.annotation.go
+ - meta_scope: meta.annotation.go comment.line.go
- match: \S+
scope: meta.variable.parameter.go
# End the annotation scope at EOL, but stretch the comment scope
@@ -161,6 +161,9 @@ contexts:
pop: true
# https://golang.org/ref/spec#Tokens
+ #
+ # Nominally, this should include `match-call-or-type-conversion`; instead,
+ # it's specified in `match-parens` to ensure proper ordering.
match-tokens:
- include: match-keywords
- include: match-identifiers
@@ -199,7 +202,7 @@ contexts:
# See `match-selector` for field scoping.
match-identifiers:
- include: match-predeclared-constants
- - include: match-call-or-cast
+ - include: match-call-or-type-conversion
- include: match-short-variable-declarations
- match: \b_\b
scope: variable.language.blank.go
@@ -218,12 +221,13 @@ contexts:
- match: \b(?:true|false|nil)\b
scope: constant.language.go
- # Note: in Go, calls and casts are syntactically identical. Detecting casts
- # and scoping them as types is beyond the capabilities of this syntax engine.
+ # Reference: https://golang.org/ref/spec#Predeclared_identifiers
#
- # https://golang.org/ref/spec#Predeclared_identifiers
+ # Note: in Go, calls and type conversions are syntactically identical.
+ # Detecting type conversions and scoping them as types is beyond the
+ # capabilities of this syntax engine.
#
- # Notes on built-in functions
+ # # Notes on built-in functions
#
# Most built-in functions don't need special syntactic support. We scope them
# for the benefit of the users who prefer to distinguish them from
@@ -237,13 +241,14 @@ contexts:
# built-in functions ONLY in a function call position. This helps minimize
# false positives.
#
- # Notes on built-in types
+ # # Notes on built-in types
#
- # Unlike casts involving a user-defined type, casts involving a built-in
- # types could be scoped purely as types rather than function calls. However,
- # we stick to `variable.function.go` to make the treatment of built-ins
- # purely additive, allowing the user to opt out.
- match-call-or-cast:
+ # Unlike type conversions involving a user-defined type, type conversions
+ # involving built-in types could be scoped purely as types rather than
+ # function calls, hoping that they haven't been redefined as functions.
+ # However, we stick to `variable.function.go` to make the treatment of
+ # built-ins purely additive, allowing the user to opt out.
+ match-call-or-type-conversion:
- match: \b(?:make|new)\b(?=(?:{{noise}}\))*{{noise}}\()
scope: variable.function.go support.function.builtin.go
push: pop-arguments-starting-with-type
@@ -254,8 +259,8 @@ contexts:
- match: '{{ident}}(?=(?:{{noise}}\))*{{noise}}\()'
scope: variable.function.go
- # See notes on `match-call-or-cast`.
- pop-call-or-cast:
+ # See notes on `match-call-or-type-conversion`.
+ pop-call-or-type-conversion:
- match: \b(?:make|new)\b(?=(?:{{noise}}\))*{{noise}}\()
scope: variable.function.go support.function.builtin.go
set: pop-arguments-starting-with-type
@@ -340,13 +345,15 @@ contexts:
- include: match-comments
- include: pop-type-assertion
- # Note: calls and casts are syntactically identical.
+ # Note: we can't syntactically distinguish calls from type conversions.
+ # It's also not always possible to distinguish function calls from
+ # method calls.
- match: '{{ident}}(?=(?:{{noise}}\))*{{noise}}\()'
scope: variable.function.go
pop: true
- include: pop-member
- # Note: newlines between dot and assertion/field are ok
+ # Note: newlines between dot and assertion/field are ok.
- include: pop-before-nonblank
match-parens:
@@ -356,7 +363,7 @@ contexts:
- match: \)
scope: punctuation.section.parens.end.go
pop: true
- - include: pop-call-or-cast
+ - include: pop-call-or-type-conversion
- include: match-any
- match: \)
scope: punctuation.section.parens.end.go
@@ -378,6 +385,15 @@ contexts:
- include: pop-type-identifier
- include: pop-before-nonblank
+ # TODO: consider detecting composite literals. In principle, it should allow
+ # us to drop the erroneous "meta.block" from composite literals, detect field
+ # names, and also detect labeled statements by disambiguating them from field
+ # names.
+ #
+ # For future reference:
+ #
+ # https://golang.org/ref/spec#Composite_literals
+ # https://golang.org/ref/spec#Labeled_statements
match-braces:
- match: \{
scope: punctuation.section.braces.begin.go
@@ -399,24 +415,20 @@ contexts:
match-imaginary:
# Decimal imaginary numbers
- - match: '({{dec_digits}})(?:(\.)({{dec_digits}})?)?({{dec_exponent}})?(i)'
+ - match: '({{dec_digits}}(?:(\.){{dec_digits}}?)?{{dec_exponent}}?)(i)'
scope: meta.number.imaginary.decimal.go
captures:
1: constant.numeric.value.go
2: punctuation.separator.decimal.go
- 3: constant.numeric.value.go
- 4: constant.numeric.value.exponent.go
- 5: constant.numeric.suffix.go
+ 3: constant.numeric.suffix.go
# Hexadecimal imaginary numbers
- - match: (0[xX])({{hex_digits}})?(?:(\.)({{hex_digits}})?)?({{hex_exponent}})?(i)
+ - match: (0[xX])({{hex_digits}}?(?:(\.){{hex_digits}}?)?{{hex_exponent}}?)(i)
scope: meta.number.imaginary.hexadecimal.go
captures:
1: constant.numeric.base.go
2: constant.numeric.value.go
3: punctuation.separator.decimal.go
- 4: constant.numeric.value.go
- 5: constant.numeric.value.exponent.go
- 6: constant.numeric.suffix.go
+ 4: constant.numeric.suffix.go
# Octal imaginary numbers
- match: (0[oO])({{oct_digits}})(i)
scope: meta.number.imaginary.octal.go
@@ -436,28 +448,24 @@ contexts:
# Decimal float literal
- match: |-
(?x:
- ({{dec_digits}})(?:(\.)({{dec_digits}})?({{dec_exponent}})?|({{dec_exponent}}))
- | (\.)({{dec_digits}})({{dec_exponent}})?
+ # 1.1, 1., 1.1e1, 1.e1
+ {{dec_digits}}(\.){{dec_digits}}?{{dec_exponent}}?
+ # 1e1
+ | {{dec_digits}}{{dec_exponent}}
+ # .1, .1e1
+ | (\.){{dec_digits}}{{dec_exponent}}?
)
- scope: meta.number.float.decimal.go
+ scope: meta.number.float.decimal.go constant.numeric.value.go
captures:
- 1: constant.numeric.value.go
+ 1: punctuation.separator.decimal.go
2: punctuation.separator.decimal.go
- 3: constant.numeric.value.go
- 4: constant.numeric.value.exponent.go
- 5: constant.numeric.value.exponent.go
- 6: punctuation.separator.decimal.go
- 7: constant.numeric.value.go
- 8: constant.numeric.value.exponent.go
# Hexadecimal float literal
- - match: (0[xX])({{hex_digits}})?(?:(\.)({{hex_digits}})?)?({{hex_exponent}})
+ - match: (0[xX])({{hex_digits}}?(?:(\.){{hex_digits}}?)?{{hex_exponent}})
scope: meta.number.float.hexadecimal.go
captures:
1: constant.numeric.base.go
2: constant.numeric.value.go
3: punctuation.separator.decimal.go
- 4: constant.numeric.value.go
- 5: constant.numeric.value.exponent.go
match-integers:
- include: match-octal-integer
@@ -598,7 +606,7 @@ contexts:
match-keyword-const:
- match: \bconst\b
- scope: storage.type.keyword.const.go
+ scope: keyword.declaration.const.go
push:
- match: \(
scope: punctuation.section.parens.begin.go
@@ -664,7 +672,7 @@ contexts:
match-keyword-func:
- match: \bfunc\b
- scope: storage.type.keyword.function.go
+ scope: keyword.declaration.function.go
push:
- include: match-comments
@@ -705,7 +713,6 @@ contexts:
match-keyword-interface:
- match: (?=\binterface\b)
- scope: storage.type.keyword.interface.go
push: pop-interface
match-keyword-map:
@@ -744,7 +751,7 @@ contexts:
match-keyword-type:
- match: \btype\b
- scope: storage.type.keyword.type.go
+ scope: keyword.declaration.type.go
push:
- include: match-comments
@@ -779,7 +786,7 @@ contexts:
match-keyword-var:
- match: \bvar\b
- scope: storage.type.keyword.var.go
+ scope: keyword.declaration.var.go
push:
- match: \(
scope: punctuation.section.parens.begin.go
@@ -969,7 +976,7 @@ contexts:
- match: (?=\bstruct\b)
set: pop-struct
- match: \bfunc\b
- scope: storage.type.keyword.function.go
+ scope: keyword.declaration.function.go
set: pop-func-parameter-and-return-lists
- match: (?={{ident}})
set: pop-named-type
@@ -984,7 +991,7 @@ contexts:
pop-struct:
- match: \bstruct\b
- scope: storage.type.keyword.struct.go
+ scope: keyword.declaration.struct.go
set:
- include: match-comments
- match: \{
@@ -1026,7 +1033,7 @@ contexts:
pop-interface:
- match: \binterface\b
- scope: storage.type.keyword.interface.go
+ scope: keyword.declaration.interface.go
set:
- include: match-comments
- match: \{
@@ -1063,7 +1070,7 @@ contexts:
# Note: newlines between `map` and `[` are ok, but newlines after `]`
# terminate the type.
- match: \bmap\b
- scope: storage.type.keyword.map.go
+ scope: keyword.declaration.map.go
set:
- include: match-comments
- include: pop-on-semicolon
@@ -1087,7 +1094,7 @@ contexts:
# perfectly ok.
pop-chan:
- match: \bchan\b
- scope: storage.type.keyword.chan.go
+ scope: keyword.declaration.chan.go
set: pop-type
pop-named-type:
@@ -1202,6 +1209,8 @@ contexts:
pop-arguments-starting-with-type:
- include: match-comments
+ # Go allows functions and types to be wrapped in an arbitrary number of
+ # parens. These are not part of the call.
- match: \)
scope: punctuation.section.parens.end.go
- match: \(
diff --git a/Go/Indention Rules.tmPreferences b/Go/Indention Rules.tmPreferences
index 5e1c32852a..b3a7b31c2e 100644
--- a/Go/Indention Rules.tmPreferences
+++ b/Go/Indention Rules.tmPreferences
@@ -1,3 +1,4 @@
+
-
-
scope
diff --git a/Go/syntax_test_go.go b/Go/syntax_test_go.go
index 30766e6362..991b2e68f0 100644
--- a/Go/syntax_test_go.go
+++ b/Go/syntax_test_go.go
@@ -61,13 +61,13 @@ You may have to disable Go-specific linters when working on this file.
//go:
// ^ -comment -meta -punctuation
// ^^ punctuation.definition.comment.go
-// ^^^^^ comment.line.go meta.annotation.go
+// ^^^^^ meta.annotation.go comment.line.go
// ^ comment.line.go -meta.annotation
//go:generate one two three
// ^ -comment -meta -punctuation
// ^^ punctuation.definition.comment.go
-// ^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.go meta.annotation.go
+// ^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.annotation.go comment.line.go
// ^ comment.line.go -meta.annotation
@@ -121,32 +121,32 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
// ## chan
chan _
-// ^^^^ storage.type.keyword.chan.go
+// ^^^^ keyword.declaration.chan.go
// ^ variable.language.blank.go
chan typ
-// ^^^^ storage.type.keyword.chan.go
+// ^^^^ keyword.declaration.chan.go
// ^^^ storage.type.go
chan typ ident
-// ^^^^ storage.type.keyword.chan.go
+// ^^^^ keyword.declaration.chan.go
// ^^^ storage.type.go
// ^^^^^ variable.other.go
chan ((typ))
-// ^^^^ storage.type.keyword.chan.go
+// ^^^^ keyword.declaration.chan.go
// ^^ punctuation.section.parens.begin.go
// ^^^ storage.type.go
// ^^ punctuation.section.parens.end.go
chan ident.typ
-// ^^^^ storage.type.keyword.chan.go
+// ^^^^ keyword.declaration.chan.go
// ^^^^^ variable.other.go
// ^ punctuation.accessor.dot.go
// ^^^ storage.type.go
chan ident.ident.typ
-// ^^^^ storage.type.keyword.chan.go
+// ^^^^ keyword.declaration.chan.go
// ^^^^^ variable.other.go
// ^ punctuation.accessor.dot.go
// ^^^^^ variable.other.go
@@ -154,7 +154,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
// ^^^ storage.type.go
chan ((ident.ident.typ))
-// ^^^^ storage.type.keyword.chan.go
+// ^^^^ keyword.declaration.chan.go
// ^^ punctuation.section.parens.begin.go
// ^^^^^ variable.other.go
// ^ punctuation.accessor.dot.go
@@ -165,14 +165,14 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
<- chan ident.typ
// ^^ keyword.operator.assignment.go
-// ^^^^ storage.type.keyword.chan.go
+// ^^^^ keyword.declaration.chan.go
// ^^^^^ variable.other.go
// ^ punctuation.accessor.dot.go
// ^^^ storage.type.go
<- chan ident.ident.typ
// ^^ keyword.operator.assignment.go
-// ^^^^ storage.type.keyword.chan.go
+// ^^^^ keyword.declaration.chan.go
// ^^^^^ variable.other.go
// ^ punctuation.accessor.dot.go
// ^^^^^ variable.other.go
@@ -180,14 +180,14 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
// ^^^ storage.type.go
chan <- ident.typ
-// ^^^^ storage.type.keyword.chan.go
+// ^^^^ keyword.declaration.chan.go
// ^^ keyword.operator.assignment.go
// ^^^^^ variable.other.go
// ^ punctuation.accessor.dot.go
// ^^^ storage.type.go
chan <- ident.ident.typ
-// ^^^^ storage.type.keyword.chan.go
+// ^^^^ keyword.declaration.chan.go
// ^^ keyword.operator.assignment.go
// ^^^^^ variable.other.go
// ^ punctuation.accessor.dot.go
@@ -196,12 +196,12 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
// ^^^ storage.type.go
chan
-// ^^^^ storage.type.keyword.chan.go
+// ^^^^ keyword.declaration.chan.go
typ
// ^^^ storage.type.go
chan
-// ^^^^ storage.type.keyword.chan.go
+// ^^^^ keyword.declaration.chan.go
ident /**/ . /**/
// ^^^^^ variable.other.go
// ^^^^ comment.block.go
@@ -213,7 +213,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
<-
// ^^ keyword.operator.assignment.go
chan
-// ^^^^ storage.type.keyword.chan.go
+// ^^^^ keyword.declaration.chan.go
ident /**/ . /**/
// ^^^^^ variable.other.go
// ^^^^ comment.block.go
@@ -228,7 +228,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
// ^^^ storage.type.go
chan
-// ^^^^ storage.type.keyword.chan.go
+// ^^^^ keyword.declaration.chan.go
<- /**/
// ^^ keyword.operator.assignment.go
// ^^^^ comment.block.go
@@ -246,68 +246,68 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
// ^^^ storage.type.go
chan chan chan typ
-// ^^^^ storage.type.keyword.chan.go
-// ^^^^ storage.type.keyword.chan.go
-// ^^^^ storage.type.keyword.chan.go
+// ^^^^ keyword.declaration.chan.go
+// ^^^^ keyword.declaration.chan.go
+// ^^^^ keyword.declaration.chan.go
// ^^^ storage.type.go
chan *chan **chan ***typ
-// ^^^^ storage.type.keyword.chan.go
+// ^^^^ keyword.declaration.chan.go
// ^ keyword.operator.go
-// ^^^^ storage.type.keyword.chan.go
+// ^^^^ keyword.declaration.chan.go
// ^^ keyword.operator.go
-// ^^^^ storage.type.keyword.chan.go
+// ^^^^ keyword.declaration.chan.go
// ^^^ keyword.operator.go
// ^^^ storage.type.go
chan struct{}
-// ^^^^ storage.type.keyword.chan.go
-// ^^^^^^ storage.type.keyword.struct.go
+// ^^^^ keyword.declaration.chan.go
+// ^^^^^^ keyword.declaration.struct.go
chan struct{} ident
-// ^^^^ storage.type.keyword.chan.go
-// ^^^^^^ storage.type.keyword.struct.go
+// ^^^^ keyword.declaration.chan.go
+// ^^^^^^ keyword.declaration.struct.go
// ^^^^^ variable.other.go
chan interface{}
-// ^^^^ storage.type.keyword.chan.go
-// ^^^^^^^^^ storage.type.keyword.interface.go
+// ^^^^ keyword.declaration.chan.go
+// ^^^^^^^^^ keyword.declaration.interface.go
chan interface{} ident
-// ^^^^ storage.type.keyword.chan.go
-// ^^^^^^^^^ storage.type.keyword.interface.go
+// ^^^^ keyword.declaration.chan.go
+// ^^^^^^^^^ keyword.declaration.interface.go
// ^^^^^ variable.other.go
chan func() func() typ
-// ^^^^ storage.type.keyword.chan.go
-// ^^^^ storage.type.keyword.function.go
-// ^^^^ storage.type.keyword.function.go
+// ^^^^ keyword.declaration.chan.go
+// ^^^^ keyword.declaration.function.go
+// ^^^^ keyword.declaration.function.go
// ^^^ storage.type.go
chan func() func() typ ident
-// ^^^^ storage.type.keyword.chan.go
-// ^^^^ storage.type.keyword.function.go
-// ^^^^ storage.type.keyword.function.go
+// ^^^^ keyword.declaration.chan.go
+// ^^^^ keyword.declaration.function.go
+// ^^^^ keyword.declaration.function.go
// ^^^ storage.type.go
// ^^^^^ variable.other.go
chan
-// ^^^^ storage.type.keyword.chan.go
+// ^^^^ keyword.declaration.chan.go
func() typ
-// ^^^^ storage.type.keyword.function.go
+// ^^^^ keyword.declaration.function.go
// ^^^ storage.type.go
chan []typ
-// ^^^^ storage.type.keyword.chan.go
+// ^^^^ keyword.declaration.chan.go
// ^^^ storage.type.go
chan [][][]typ
-// ^^^^ storage.type.keyword.chan.go
+// ^^^^ keyword.declaration.chan.go
// ^^^ storage.type.go
chan map[typ]typ
-// ^^^^ storage.type.keyword.chan.go
-// ^^^ storage.type.keyword.map.go
+// ^^^^ keyword.declaration.chan.go
+// ^^^ keyword.declaration.map.go
// ^^^ storage.type.go
// ^^^ storage.type.go
@@ -320,12 +320,12 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
// function types.
func()
-// ^^^^ storage.type.keyword.function.go
+// ^^^^ keyword.declaration.function.go
// ^ punctuation.section.parens.begin.go
// ^ punctuation.section.parens.end.go
func(typ, typ)
-// ^^^^ storage.type.keyword.function.go
+// ^^^^ keyword.declaration.function.go
// ^ punctuation.section.parens.begin.go
// ^^^ storage.type.go
// ^ punctuation.separator.go
@@ -341,12 +341,12 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
// ^^^ storage.type.go
func()
-// ^^^^ storage.type.keyword.function.go
+// ^^^^ keyword.declaration.function.go
ident
// ^^^^^ variable.other.go -storage
func(true false) (nil iota)
-// ^^^^ storage.type.keyword.function.go
+// ^^^^ keyword.declaration.function.go
// ^^^^ variable.parameter.go
// ^^^^^ storage.type.go
// ^^^ variable.parameter.go
@@ -358,7 +358,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
// ^^^ storage.type.go
func(param /**/ ... /**/ typ)
-// ^^^^ storage.type.keyword.function.go
+// ^^^^ keyword.declaration.function.go
// ^^^^^ variable.parameter.go
// ^^^^ comment.block.go
// ^^^ keyword.operator.variadic.go
@@ -366,7 +366,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
// ^^^ storage.type.go
func(param ((typ)), param ...typ)
-// ^^^^ storage.type.keyword.function.go
+// ^^^^ keyword.declaration.function.go
// ^^^^^ variable.parameter.go
// ^^^ storage.type.go
// ^^^^^ variable.parameter.go
@@ -374,7 +374,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
// ^^^ storage.type.go
func(param, param ((typ)), param, param ...typ)
-// ^^^^ storage.type.keyword.function.go
+// ^^^^ keyword.declaration.function.go
// ^^^^^ variable.parameter.go
// ^^^^^ variable.parameter.go
// ^^^ storage.type.go
@@ -455,14 +455,14 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
// ^^^^ storage.type.go
func(...ident.Type)
-// ^^^^ storage.type.keyword.function.go
+// ^^^^ keyword.declaration.function.go
// ^^^ keyword.operator.variadic.go
// ^^^^^ variable.other.go
// ^ punctuation.accessor.dot.go
// ^^^^ storage.type.go
func(...*ident.Type)
-// ^^^^ storage.type.keyword.function.go
+// ^^^^ keyword.declaration.function.go
// ^^^ keyword.operator.variadic.go
// ^ keyword.operator.go
// ^^^^^ variable.other.go
@@ -479,13 +479,13 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
)
func(param...typ)
-// ^^^^ storage.type.keyword.function.go
+// ^^^^ keyword.declaration.function.go
// ^^^^^ variable.parameter.go
// ^^^ keyword.operator.variadic.go
// ^^^ storage.type.go
func(param...ident.Type)
-// ^^^^ storage.type.keyword.function.go
+// ^^^^ keyword.declaration.function.go
// ^^^^^ variable.parameter.go
// ^^^ keyword.operator.variadic.go
// ^^^^^ variable.other.go
@@ -493,7 +493,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
// ^^^^ storage.type.go
func(param...*ident.Type)
-// ^^^^ storage.type.keyword.function.go
+// ^^^^ keyword.declaration.function.go
// ^^^^^ variable.parameter.go
// ^^^ keyword.operator.variadic.go
// ^ keyword.operator.go
@@ -539,7 +539,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
// Deranged case
func /**/ (
-// ^^^^ storage.type.keyword.function.go
+// ^^^^ keyword.declaration.function.go
// ^^^^ comment.block.go
// ^ punctuation.section.parens.begin.go
/**/
@@ -611,9 +611,9 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
// ^^^ storage.type.go
func() func() func() typ
-// ^^^^ storage.type.keyword.function.go
-// ^^^^ storage.type.keyword.function.go
-// ^^^^ storage.type.keyword.function.go
+// ^^^^ keyword.declaration.function.go
+// ^^^^ keyword.declaration.function.go
+// ^^^^ keyword.declaration.function.go
// ^^^ storage.type.go
func() func() func() ((typ))
@@ -621,25 +621,25 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
// Deranged case
func(param func(param func(param ...typ) func() typ) ...func(param typ))
-// ^^^^ storage.type.keyword.function.go
+// ^^^^ keyword.declaration.function.go
// ^ punctuation.section.parens.begin.go
// ^^^^^ variable.parameter.go
-// ^^^^ storage.type.keyword.function.go
+// ^^^^ keyword.declaration.function.go
// ^ punctuation.section.parens.begin.go
// ^^^^^ variable.parameter.go
-// ^^^^ storage.type.keyword.function.go
+// ^^^^ keyword.declaration.function.go
// ^ punctuation.section.parens.begin.go
// ^^^^^ variable.parameter.go
// ^^^ keyword.operator.variadic.go
// ^^^ storage.type.go
// ^ punctuation.section.parens.end.go
-// ^^^^ storage.type.keyword.function.go
+// ^^^^ keyword.declaration.function.go
// ^ punctuation.section.parens.begin.go
// ^ punctuation.section.parens.end.go
// ^^^ storage.type.go
// ^ punctuation.section.parens.end.go
// ^^^ keyword.operator.variadic.go
-// ^^^^ storage.type.keyword.function.go
+// ^^^^ keyword.declaration.function.go
// ^ punctuation.section.parens.begin.go
// ^^^^^ variable.parameter.go
// ^^^ storage.type.go
@@ -649,12 +649,12 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
// ## interface
interface{}
-// ^^^^^^^^^ storage.type.keyword.interface.go
+// ^^^^^^^^^ keyword.declaration.interface.go
// ^ meta.type.go punctuation.section.braces.begin.go
// ^ meta.type.go punctuation.section.braces.end.go
interface /**/ {
-// ^^^^^^^^^ storage.type.keyword.interface.go
+// ^^^^^^^^^ keyword.declaration.interface.go
// ^^^^ comment.block.go
// ^ meta.type.go punctuation.section.braces.begin.go
@@ -722,7 +722,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
// ^ meta.type.go punctuation.section.braces.end.go
interface
-// ^^^^^^^^^ storage.type.keyword.interface.go
+// ^^^^^^^^^ keyword.declaration.interface.go
{Method(param typ) typ; Inherit; Method(param typ) typ;}
// ^ meta.type.go punctuation.section.braces.begin.go
// ^^^^^^ meta.type.go entity.name.function.go
@@ -747,14 +747,14 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
// ## map
map[typ]typ
-// ^^^ storage.type.keyword.map.go
+// ^^^ keyword.declaration.map.go
// ^ punctuation.section.brackets.begin.go
// ^^^ storage.type.go
// ^ punctuation.section.brackets.end.go
// ^^^ storage.type.go
map[typ]typ ident
-// ^^^ storage.type.keyword.map.go
+// ^^^ keyword.declaration.map.go
// ^ punctuation.section.brackets.begin.go
// ^^^ storage.type.go
// ^ punctuation.section.brackets.end.go
@@ -762,13 +762,13 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
// ^^^^^ variable.other.go -storage
map[typ]
-// ^^^ storage.type.keyword.map.go
+// ^^^ keyword.declaration.map.go
// ^^^ storage.type.go
ident
// ^^^^^ variable.other.go
map /**/ [/**/ typ /**/] /**/ typ
-// ^^^ storage.type.keyword.map.go
+// ^^^ keyword.declaration.map.go
// ^^^^ comment.block.go
// ^ punctuation.section.brackets.begin.go
// ^^^^ comment.block.go
@@ -779,7 +779,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
// ^^^ storage.type.go
map /**/
-// ^^^ storage.type.keyword.map.go
+// ^^^ keyword.declaration.map.go
// ^^^^ comment.block.go
/**/ [ /**/
// ^^^^ comment.block.go
@@ -794,63 +794,63 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
// ^^^ storage.type.go
map[typ]map[typ]map[typ]map[typ]typ
-// ^^^ storage.type.keyword.map.go
+// ^^^ keyword.declaration.map.go
// ^^^ storage.type.go
-// ^^^ storage.type.keyword.map.go
+// ^^^ keyword.declaration.map.go
// ^^^ storage.type.go
-// ^^^ storage.type.keyword.map.go
+// ^^^ keyword.declaration.map.go
// ^^^ storage.type.go
-// ^^^ storage.type.keyword.map.go
+// ^^^ keyword.declaration.map.go
// ^^^ storage.type.go
// ^^^ storage.type.go
map[chan chan typ]chan chan typ ident
-// ^^^ storage.type.keyword.map.go
-// ^^^^ storage.type.keyword.chan.go
-// ^^^^ storage.type.keyword.chan.go
+// ^^^ keyword.declaration.map.go
+// ^^^^ keyword.declaration.chan.go
+// ^^^^ keyword.declaration.chan.go
// ^^^ storage.type.go
-// ^^^^ storage.type.keyword.chan.go
-// ^^^^ storage.type.keyword.chan.go
+// ^^^^ keyword.declaration.chan.go
+// ^^^^ keyword.declaration.chan.go
// ^^^ storage.type.go
// ^^^^^ variable.other.go
map[<- chan typ] chan <- typ
-// ^^^ storage.type.keyword.map.go
+// ^^^ keyword.declaration.map.go
// ^^ keyword.operator.assignment.go
-// ^^^^ storage.type.keyword.chan.go
+// ^^^^ keyword.declaration.chan.go
// ^^^ storage.type.go
-// ^^^^ storage.type.keyword.chan.go
+// ^^^^ keyword.declaration.chan.go
// ^^ keyword.operator.assignment.go
// ^^^ storage.type.go
map[func(param typ) typ]func(param typ) typ
-// ^^^ storage.type.keyword.map.go
-// ^^^^ storage.type.keyword.function.go
+// ^^^ keyword.declaration.map.go
+// ^^^^ keyword.declaration.function.go
// ^^^^^ variable.parameter.go
// ^^^ storage.type.go
// ^^^ storage.type.go
-// ^^^^ storage.type.keyword.function.go
+// ^^^^ keyword.declaration.function.go
// ^^^^^ variable.parameter.go
// ^^^ storage.type.go
// ^^^ storage.type.go
map[map[typ]typ]map[typ]typ
-// ^^^ storage.type.keyword.map.go
-// ^^^ storage.type.keyword.map.go
+// ^^^ keyword.declaration.map.go
+// ^^^ keyword.declaration.map.go
// ^^^ storage.type.go
// ^^^ storage.type.go
-// ^^^ storage.type.keyword.map.go
+// ^^^ keyword.declaration.map.go
// ^^^ storage.type.go
// ^^^ storage.type.go
map[struct{
-// ^^^ storage.type.keyword.map.go
-// ^^^^^^ storage.type.keyword.struct.go
+// ^^^ keyword.declaration.map.go
+// ^^^^^^ keyword.declaration.struct.go
field typ
// ^^^^^ meta.type.go variable.other.member.declaration.go
// ^^^ meta.type.go storage.type.go
}] struct {
-// ^^^^^^ storage.type.keyword.struct.go
+// ^^^^^^ keyword.declaration.struct.go
// ^ meta.type.go
field typ
// ^^^^^ meta.type.go variable.other.member.declaration.go
@@ -859,14 +859,14 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
}
map[*typ]*typ
-// ^^^ storage.type.keyword.map.go
+// ^^^ keyword.declaration.map.go
// ^ keyword.operator.go
// ^^^ storage.type.go
// ^ keyword.operator.go
// ^^^ storage.type.go
map[ident.Type]ident.Type
-// ^^^ storage.type.keyword.map.go
+// ^^^ keyword.declaration.map.go
// ^^^^^ variable.other.go
// ^ punctuation.accessor.dot.go
// ^^^^ storage.type.go
@@ -875,7 +875,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
// ^^^^ storage.type.go
map[*ident.Type]*ident.Type
-// ^^^ storage.type.keyword.map.go
+// ^^^ keyword.declaration.map.go
// ^ keyword.operator.go
// ^^^^^ variable.other.go
// ^ punctuation.accessor.dot.go
@@ -886,7 +886,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
// ^^^^ storage.type.go
map[typ]ident /**/ . /**/
-// ^^^ storage.type.keyword.map.go
+// ^^^ keyword.declaration.map.go
// ^^^ storage.type.go
// ^^^^^ variable.other.go
// ^^^^ comment.block.go
@@ -901,14 +901,14 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
// ^^^ storage.type.go
map[[0]typ][0]typ
-// ^^^ storage.type.keyword.map.go
+// ^^^ keyword.declaration.map.go
// ^ meta.number.integer.decimal.go constant.numeric.value.go
// ^^^ storage.type.go
// ^ meta.number.integer.decimal.go constant.numeric.value.go
// ^^^ storage.type.go
map[/**/ [0] /**/ typ /**/ ] /**/ [0] /**/ typ
-// ^^^ storage.type.keyword.map.go
+// ^^^ keyword.declaration.map.go
// ^^^^ comment.block.go
// ^ meta.number.integer.decimal.go constant.numeric.value.go
// ^^^^ comment.block.go
@@ -923,35 +923,35 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
// ## struct
struct{}
-// ^^^^^^ storage.type.keyword.struct.go
+// ^^^^^^ keyword.declaration.struct.go
// ^ meta.type.go punctuation.section.braces.begin.go
// ^ meta.type.go punctuation.section.braces.end.go
struct {field typ}
-// ^^^^^^ storage.type.keyword.struct.go
+// ^^^^^^ keyword.declaration.struct.go
// ^^^^^ meta.type.go variable.other.member.declaration.go
// ^^^ meta.type.go storage.type.go
struct {field typ;}
-// ^^^^^^ storage.type.keyword.struct.go
+// ^^^^^^ keyword.declaration.struct.go
// ^^^^^ meta.type.go variable.other.member.declaration.go
// ^^^ meta.type.go storage.type.go
struct {true nil}
-// ^^^^^^ storage.type.keyword.struct.go
+// ^^^^^^ keyword.declaration.struct.go
// ^^^^ meta.type.go variable.other.member.declaration.go
// ^^^ meta.type.go storage.type.go
struct {embed}
-// ^^^^^^ storage.type.keyword.struct.go
+// ^^^^^^ keyword.declaration.struct.go
// ^^^^^ meta.type.go entity.other.inherited-class.go
struct {embed;}
-// ^^^^^^ storage.type.keyword.struct.go
+// ^^^^^^ keyword.declaration.struct.go
// ^^^^^ meta.type.go entity.other.inherited-class.go
struct {embed; field typ; *embed; field typ;}
-// ^^^^^^ storage.type.keyword.struct.go
+// ^^^^^^ keyword.declaration.struct.go
// ^ meta.type.go punctuation.section.braces.begin.go
// ^^^^^ meta.type.go entity.other.inherited-class.go
// ^ meta.type.go punctuation.terminator.go
@@ -967,7 +967,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
// ^ meta.type.go punctuation.section.braces.end.go
struct {
-// ^^^^^^ storage.type.keyword.struct.go
+// ^^^^^^ keyword.declaration.struct.go
field typ `json:"field"`
// ^^^^^ meta.type.go variable.other.member.declaration.go
// ^^^ meta.type.go storage.type.go
@@ -998,7 +998,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
}
struct
-// ^^^^^^ storage.type.keyword.struct.go
+// ^^^^^^ keyword.declaration.struct.go
/**/
// ^^^^ comment.block.go
{
@@ -1062,7 +1062,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
}
struct {
-// ^^^^^^ storage.type.keyword.struct.go
+// ^^^^^^ keyword.declaration.struct.go
/**/ field /**/ typ /**/
// ^^^^ meta.type.go comment.block.go
// ^^^^^ meta.type.go variable.other.member.declaration.go
@@ -1078,7 +1078,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
}
struct {
-// ^^^^^^ storage.type.keyword.struct.go
+// ^^^^^^ keyword.declaration.struct.go
field, field typ
// ^^^^^ meta.type.go variable.other.member.declaration.go
// ^ meta.type.go punctuation.separator.go
@@ -1095,10 +1095,10 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
}
struct {
-// ^^^^^^ storage.type.keyword.struct.go
+// ^^^^^^ keyword.declaration.struct.go
field chan typ
// ^^^^^ meta.type.go variable.other.member.declaration.go
-// ^^^^ meta.type.go storage.type.keyword.chan.go
+// ^^^^ meta.type.go keyword.declaration.chan.go
// ^^^ meta.type.go storage.type.go
embed
@@ -1107,7 +1107,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
field <- chan typ
// ^^^^^ meta.type.go variable.other.member.declaration.go
// ^^ meta.type.go keyword.operator.assignment.go
-// ^^^^ meta.type.go storage.type.keyword.chan.go
+// ^^^^ meta.type.go keyword.declaration.chan.go
// ^^^ meta.type.go storage.type.go
embed
@@ -1115,7 +1115,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
field chan <- typ
// ^^^^^ meta.type.go variable.other.member.declaration.go
-// ^^^^ meta.type.go storage.type.keyword.chan.go
+// ^^^^ meta.type.go keyword.declaration.chan.go
// ^^ meta.type.go keyword.operator.assignment.go
// ^^^ meta.type.go storage.type.go
@@ -1124,7 +1124,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
field func(param typ) typ
// ^^^^^ meta.type.go variable.other.member.declaration.go
-// ^^^^ meta.type.go storage.type.keyword.function.go
+// ^^^^ meta.type.go keyword.declaration.function.go
// ^ meta.type.go punctuation.section.parens.begin.go
// ^^^^^ meta.type.go variable.parameter.go
// ^^^ meta.type.go storage.type.go
@@ -1137,7 +1137,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
field func(
// ^^^^^ meta.type.go variable.other.member.declaration.go
-// ^^^^ meta.type.go storage.type.keyword.function.go
+// ^^^^ meta.type.go keyword.declaration.function.go
param typ
// ^^^^^ meta.type.go variable.parameter.go
// ^^^ meta.type.go storage.type.go
@@ -1152,7 +1152,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
field map[
// ^^^^^ meta.type.go variable.other.member.declaration.go
-// ^^^ meta.type.go storage.type.keyword.map.go
+// ^^^ meta.type.go keyword.declaration.map.go
typ
// ^^^ meta.type.go storage.type.go
] typ
@@ -1163,7 +1163,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
field interface{
// ^^^^^ meta.type.go variable.other.member.declaration.go
-// ^^^^^^^^^ meta.type.go storage.type.keyword.interface.go
+// ^^^^^^^^^ meta.type.go keyword.declaration.interface.go
method()
// ^^^^^^ meta.type.go meta.type.go entity.name.function.go
}
@@ -1173,7 +1173,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
field struct{
// ^^^^^ meta.type.go variable.other.member.declaration.go
-// ^^^^^^ meta.type.go storage.type.keyword.struct.go
+// ^^^^^^ meta.type.go keyword.declaration.struct.go
field typ
// ^^^^^ meta.type.go meta.type.go variable.other.member.declaration.go
// ^^^ meta.type.go meta.type.go storage.type.go
@@ -1262,7 +1262,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
// ^^^^^ variable.other.go -storage
[]func(
-// ^^^^ storage.type.keyword.function.go
+// ^^^^ keyword.declaration.function.go
param typ
// ^^^^^ variable.parameter.go
// ^^^ storage.type.go
@@ -1274,17 +1274,17 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
// ## type
type _ typ
-// ^^^^ storage.type.keyword.type.go
+// ^^^^ keyword.declaration.type.go
// ^ variable.language.blank.go
// ^^^ storage.type.go
type Type typ
-// ^^^^ storage.type.keyword.type.go
+// ^^^^ keyword.declaration.type.go
// ^^^^ entity.name.type.go
// ^^^ storage.type.go
type
-// ^^^^ storage.type.keyword.type.go
+// ^^^^ keyword.declaration.type.go
/**/
// ^^^^ comment.block.go
Type /**/ * /**/ * /**/ ident /**/ . /**/
@@ -1309,46 +1309,46 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
// ^^^^ storage.type.go
type Type
-// ^^^^ storage.type.keyword.type.go
+// ^^^^ keyword.declaration.type.go
// ^^^^ entity.name.type.go
ident
// ^^^^^ variable.other.go
type Type; ident
-// ^^^^ storage.type.keyword.type.go
+// ^^^^ keyword.declaration.type.go
// ^^^^ entity.name.type.go
// ^ punctuation.terminator.go
// ^^^^^ variable.other.go
type Type chan typ
-// ^^^^ storage.type.keyword.type.go
+// ^^^^ keyword.declaration.type.go
// ^^^^ entity.name.type.go
-// ^^^^ storage.type.keyword.chan.go
+// ^^^^ keyword.declaration.chan.go
// ^^^ storage.type.go
type Type <- chan typ
-// ^^^^ storage.type.keyword.type.go
+// ^^^^ keyword.declaration.type.go
// ^^^^ entity.name.type.go
// ^^ keyword.operator.assignment.go
-// ^^^^ storage.type.keyword.chan.go
+// ^^^^ keyword.declaration.chan.go
// ^^^ storage.type.go
type Type chan <- typ
-// ^^^^ storage.type.keyword.type.go
+// ^^^^ keyword.declaration.type.go
// ^^^^ entity.name.type.go
-// ^^^^ storage.type.keyword.chan.go
+// ^^^^ keyword.declaration.chan.go
// ^^ keyword.operator.assignment.go
// ^^^ storage.type.go
type Type chan typ ident
-// ^^^^ storage.type.keyword.type.go
+// ^^^^ keyword.declaration.type.go
// ^^^^ entity.name.type.go
-// ^^^^ storage.type.keyword.chan.go
+// ^^^^ keyword.declaration.chan.go
// ^^^ storage.type.go
// ^^^^^ variable.other.go
type Type func(
-// ^^^^ storage.type.keyword.function.go
+// ^^^^ keyword.declaration.function.go
param typ
// ^^^^^ variable.parameter.go
// ^^^ storage.type.go
@@ -1357,21 +1357,21 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
// ^^^^^ variable.other.go
type Type map[typ]typ ident
-// ^^^^ storage.type.keyword.type.go
+// ^^^^ keyword.declaration.type.go
// ^^^^ entity.name.type.go
-// ^^^ storage.type.keyword.map.go
+// ^^^ keyword.declaration.map.go
// ^^^ storage.type.go
// ^^^ storage.type.go
// ^^^^^ variable.other.go
type Type []typ ident
-// ^^^^ storage.type.keyword.type.go
+// ^^^^ keyword.declaration.type.go
// ^^^^ entity.name.type.go
// ^^^ storage.type.go
// ^^^^^ variable.other.go
type Type interface {
-// ^^^^^^^^^ storage.type.keyword.interface.go
+// ^^^^^^^^^ keyword.declaration.interface.go
Method()
// ^^^^^^ meta.type.go entity.name.function.go
Inherit
@@ -1380,7 +1380,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
// ^^^^^ variable.other.go
type Type struct {
-// ^^^^^^ storage.type.keyword.struct.go
+// ^^^^^^ keyword.declaration.struct.go
field typ
// ^^^^^ meta.type.go variable.other.member.declaration.go
// ^^^ meta.type.go storage.type.go
@@ -1406,12 +1406,12 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
Type func(
// ^^^^ entity.name.type.go
-// ^^^^ storage.type.keyword.function.go
+// ^^^^ keyword.declaration.function.go
)
Type map
// ^^^^ entity.name.type.go
-// ^^^ storage.type.keyword.map.go
+// ^^^ keyword.declaration.map.go
[typ]typ
// ^^^ storage.type.go
// ^^^ storage.type.go
@@ -1422,14 +1422,14 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
Type interface {
// ^^^^ entity.name.type.go
-// ^^^^^^^^^ storage.type.keyword.interface.go
+// ^^^^^^^^^ keyword.declaration.interface.go
Method()
// ^^^^^^ meta.type.go entity.name.function.go
}
Type struct {
// ^^^^ entity.name.type.go
-// ^^^^^^ storage.type.keyword.struct.go
+// ^^^^^^ keyword.declaration.struct.go
field typ
// ^^^^^ meta.type.go variable.other.member.declaration.go
// ^^^ meta.type.go storage.type.go
@@ -1445,14 +1445,14 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
// or variables.
const _ = 10
-// ^^^^^ storage.type.keyword.const.go
+// ^^^^^ keyword.declaration.const.go
// ^ variable.language.blank.go
// ^ keyword.operator.assignment.go
// ^^ meta.number.integer.decimal.go constant.numeric.value.go
/**/ const
// ^^^^ comment.block.go
-// ^^^^^ storage.type.keyword.const.go
+// ^^^^^ keyword.declaration.const.go
/**/ ident /**/ typ /**/ = /**/ iota /**/
// ^^^^ comment.block.go
// ^^^^^ variable.other.constant.declaration.go
@@ -1465,27 +1465,27 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
// ^^^^ comment.block.go
const ident, ident = 10, 20
-// ^^^^^ storage.type.keyword.const.go
+// ^^^^^ keyword.declaration.const.go
// ^^^^^ variable.other.constant.declaration.go
// ^ punctuation.separator.go
// ^^^^^ variable.other.constant.declaration.go
const ident, ident typ
-// ^^^^^ storage.type.keyword.const.go
+// ^^^^^ keyword.declaration.const.go
// ^^^^^ variable.other.constant.declaration.go
// ^ punctuation.separator.go
// ^^^^^ variable.other.constant.declaration.go
// ^^^ storage.type.go
const ident,
-// ^^^^^ storage.type.keyword.const.go
+// ^^^^^ keyword.declaration.const.go
// ^^^^^ variable.other.constant.declaration.go
// ^ punctuation.separator.go
ident = 10, 20
// ^^^^^ variable.other.constant.declaration.go
const ident,
-// ^^^^^ storage.type.keyword.const.go
+// ^^^^^ keyword.declaration.const.go
// ^^^^^ variable.other.constant.declaration.go
// ^ punctuation.separator.go
ident typ
@@ -1494,7 +1494,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
/**/ const
// ^^^^ comment.block.go
-// ^^^^^ storage.type.keyword.const.go
+// ^^^^^ keyword.declaration.const.go
(
// ^ punctuation.section.parens.begin.go
/**/ ident /**/ typ /**/ = /**/ iota + iota /**/
@@ -1594,7 +1594,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
)
const ident typ = ident +
-// ^^^^^ storage.type.keyword.const.go
+// ^^^^^ keyword.declaration.const.go
// ^^^^^ variable.other.constant.declaration.go
// ^^^ storage.type.go
// ^ keyword.operator.assignment.go
@@ -1610,7 +1610,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
// ^^^^^ variable.other.go
const (
-// ^^^^^ storage.type.keyword.const.go
+// ^^^^^ keyword.declaration.const.go
ident typ = ident +
// ^^^^^ variable.other.constant.declaration.go
// ^^^ storage.type.go
@@ -1632,19 +1632,19 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
// iota is predefined only in constant declarations. It's not a reserved word.
func _() {
var iota = 0
-// ^^^ storage.type.keyword.var.go
+// ^^^ keyword.declaration.var.go
// ^^^^ variable.declaration.go
// ^ keyword.operator.assignment.go
// ^ meta.number.integer.decimal.go constant.numeric.value.go
var _ = iota
-// ^^^ storage.type.keyword.var.go
+// ^^^ keyword.declaration.var.go
// ^ variable.language.blank.go
// ^ keyword.operator.assignment.go
// ^^^^ variable.other.go -constant
}
var _ = log.Println
-// ^^^ storage.type.keyword.var.go
+// ^^^ keyword.declaration.var.go
// ^ variable.language.blank.go
// ^ keyword.operator.assignment.go
// ^^^ variable.other.go
@@ -1653,7 +1653,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
/**/ var
// ^^^^ comment.block.go
-// ^^^ storage.type.keyword.var.go
+// ^^^ keyword.declaration.var.go
/**/ ident /**/ typ /**/ = /**/ 10 /**/
// ^^^^ comment.block.go
// ^^^^^ variable.declaration.go
@@ -1666,27 +1666,27 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
// ^^^^ comment.block.go
var ident, ident = 10, 20
-// ^^^ storage.type.keyword.var.go
+// ^^^ keyword.declaration.var.go
// ^^^^^ variable.declaration.go
// ^ punctuation.separator.go
// ^^^^^ variable.declaration.go
var ident, ident typ
-// ^^^ storage.type.keyword.var.go
+// ^^^ keyword.declaration.var.go
// ^^^^^ variable.declaration.go
// ^ punctuation.separator.go
// ^^^^^ variable.declaration.go
// ^^^ storage.type.go
var ident,
-// ^^^ storage.type.keyword.var.go
+// ^^^ keyword.declaration.var.go
// ^^^^^ variable.declaration.go
// ^ punctuation.separator.go
ident = 10, 20
// ^^^^^ variable.declaration.go
var ident,
-// ^^^ storage.type.keyword.var.go
+// ^^^ keyword.declaration.var.go
// ^^^^^ variable.declaration.go
// ^ punctuation.separator.go
ident typ
@@ -1695,7 +1695,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
/**/ var
// ^^^^ comment.block.go
-// ^^^ storage.type.keyword.var.go
+// ^^^ keyword.declaration.var.go
(
// ^ punctuation.section.parens.begin.go
/**/ ident /**/ typ /**/ = /**/ ident /**/ + /**/ 20 /**/
@@ -1846,184 +1846,116 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
// ## Floats
000.000; 123.456; .0; 1.;
-// ^^^^^^^ meta.number.float.decimal.go
-// ^^^ constant.numeric.value.go
+// ^^^^^^^ meta.number.float.decimal.go constant.numeric.value.go
// ^ punctuation.separator.decimal.go
-// ^^^ constant.numeric.value.go
-// ^^^^^^^ meta.number.float.decimal.go
-// ^^^ constant.numeric.value.go
+// ^^^^^^^ meta.number.float.decimal.go constant.numeric.value.go
// ^ punctuation.separator.decimal.go
-// ^^^ constant.numeric.value.go
-// ^^ meta.number.float.decimal.go
+// ^^ meta.number.float.decimal.go constant.numeric.value.go
// ^ punctuation.separator.decimal.go
-// ^ constant.numeric.value.go
-// ^^ meta.number.float.decimal.go
-// ^ constant.numeric.value.go
+// ^^ meta.number.float.decimal.go constant.numeric.value.go
// ^ punctuation.separator.decimal.go
0_1.0_1; 1_23.4_6;
-// ^^^^^^^ meta.number.float.decimal.go
-// ^^^ constant.numeric.value.go
+// ^^^^^^^ meta.number.float.decimal.go constant.numeric.value.go
// ^ punctuation.separator.decimal.go
-// ^^^ constant.numeric.value.go
-// ^^^^^^^^ meta.number.float.decimal.go
-// ^^^^ constant.numeric.value.go
+// ^^^^^^^^ meta.number.float.decimal.go constant.numeric.value.go
// ^ punctuation.separator.decimal.go
-// ^^^ constant.numeric.value.go
-000.000; -123.456; -.0; -1. -1.. ;
// ^ keyword.operator.arithmetic.go
-// ^^^^^^^ meta.number.float.decimal.go
-// ^^^ constant.numeric.value.go
+// ^^^^^^^ meta.number.float.decimal.go constant.numeric.value.go
// ^ punctuation.separator.decimal.go
-// ^^^ constant.numeric.value.go
// ^ keyword.operator.arithmetic.go
-// ^^^^^^^ meta.number.float.decimal.go
-// ^^^ constant.numeric.value.go
+// ^^^^^^^ meta.number.float.decimal.go constant.numeric.value.go
// ^ punctuation.separator.decimal.go
-// ^^^ constant.numeric.value.go
// ^ keyword.operator.arithmetic.go
-// ^^ meta.number.float.decimal.go
+// ^^ meta.number.float.decimal.go constant.numeric.value.go
// ^ punctuation.separator.decimal.go
-// ^ constant.numeric.value.go
// ^ keyword.operator.arithmetic.go
-// ^^ meta.number.float.decimal.go
-// ^ constant.numeric.value.go
+// ^^ meta.number.float.decimal.go constant.numeric.value.go
// ^ punctuation.separator.decimal.go
// ^ keyword.operator.arithmetic.go
-// ^^ meta.number.float.decimal.go
-// ^ constant.numeric.value.go
+// ^^ meta.number.float.decimal.go constant.numeric.value.go
// ^ punctuation.separator.decimal.go
// ^ punctuation.accessor.dot.go - meta.number
0e+0; 0E+0; 0.0e+0; 0.0E+0; 123.456e+789;
-// ^^^^ meta.number.float.decimal.go
-// ^ constant.numeric.value.go
-// ^^^ constant.numeric.value.exponent.go
-// ^^^^ meta.number.float.decimal.go
-// ^ constant.numeric.value.go
-// ^^^ constant.numeric.value.exponent.go
-// ^^^^^^ meta.number.float.decimal.go
-// ^ constant.numeric.value.go
+// ^^^^ meta.number.float.decimal.go constant.numeric.value.go
+// ^^^^ meta.number.float.decimal.go constant.numeric.value.go
+// ^^^^^^ meta.number.float.decimal.go constant.numeric.value.go
// ^ punctuation.separator.decimal.go
-// ^ constant.numeric.value.go
-// ^^^ constant.numeric.value.exponent.go
-// ^^^^^^ meta.number.float.decimal.go
-// ^ constant.numeric.value.go
+// ^^^^^^ meta.number.float.decimal.go constant.numeric.value.go
// ^ punctuation.separator.decimal.go
-// ^ constant.numeric.value.go
-// ^^^ constant.numeric.value.exponent.go
-// ^^^^^^^^^^^^ meta.number.float.decimal.go
-// ^^^ constant.numeric.value.go
+// ^^^^^^^^^^^^ meta.number.float.decimal.go constant.numeric.value.go
// ^ punctuation.separator.decimal.go
-// ^^^ constant.numeric.value.go
-// ^^^^^ constant.numeric.value.exponent.go
1_2e+0; 1E+0_1; 0.1_2e2; 1_23.4_56e+78_9;
-// ^^^ meta.number.float.decimal.go constant.numeric.value.go
-// ^^^ meta.number.float.decimal.go constant.numeric.value.exponent.go
-// ^ meta.number.float.decimal.go constant.numeric.value.go
-// ^^^^^ meta.number.float.decimal.go constant.numeric.value.exponent.go
-// ^ meta.number.float.decimal.go constant.numeric.value.go
-// ^ meta.number.float.decimal.go punctuation.separator.decimal.go
-// ^^^ meta.number.float.decimal.go constant.numeric.value.go
-// ^^ meta.number.float.decimal.go constant.numeric.value.exponent.go
-// ^^^^ meta.number.float.decimal.go constant.numeric.value.go
-// ^ meta.number.float.decimal.go punctuation.separator.decimal.go
-// ^^^^ meta.number.float.decimal.go constant.numeric.value.go
-// ^^^^^^ meta.number.float.decimal.go constant.numeric.value.exponent.go
+// ^^^^^^ meta.number.float.decimal.go constant.numeric.value.go
+// ^^^^^^ meta.number.float.decimal.go constant.numeric.value.go
+// ^^^^^^^ meta.number.float.decimal.go constant.numeric.value.go
+// ^ punctuation.separator.decimal.go
+// ^^^^^^^^^^^^^^^ meta.number.float.decimal.go constant.numeric.value.go
+// ^ punctuation.separator.decimal.go
0e-0; 0E-0; 0.0e-0; 0.0E-0; 123.456e-789;
-// ^ meta.number.float.decimal.go constant.numeric.value.go
-// ^^^ meta.number.float.decimal.go constant.numeric.value.exponent.go
-// ^ meta.number.float.decimal.go constant.numeric.value.go
-// ^^^ meta.number.float.decimal.go constant.numeric.value.exponent.go
-// ^ meta.number.float.decimal.go constant.numeric.value.go
-// ^ meta.number.float.decimal.go punctuation.separator.decimal.go
-// ^ meta.number.float.decimal.go constant.numeric.value.go
-// ^^^ meta.number.float.decimal.go constant.numeric.value.exponent.go
-// ^ meta.number.float.decimal.go constant.numeric.value.go
-// ^ meta.number.float.decimal.go punctuation.separator.decimal.go
-// ^ meta.number.float.decimal.go constant.numeric.value.go
-// ^^^ meta.number.float.decimal.go constant.numeric.value.exponent.go
-// ^^^ meta.number.float.decimal.go constant.numeric.value.go
-// ^ meta.number.float.decimal.go punctuation.separator.decimal.go
-// ^^^ meta.number.float.decimal.go constant.numeric.value.go
-// ^^^^^ meta.number.float.decimal.go constant.numeric.value.exponent.go
+// ^^^^ meta.number.float.decimal.go constant.numeric.value.go
+// ^^^^ meta.number.float.decimal.go constant.numeric.value.go
+// ^^^^^^ meta.number.float.decimal.go constant.numeric.value.go
+// ^ punctuation.separator.decimal.go
+// ^^^^^^ meta.number.float.decimal.go constant.numeric.value.go
+// ^ punctuation.separator.decimal.go
+// ^^^^^^^^^^^^ meta.number.float.decimal.go constant.numeric.value.go
+// ^ punctuation.separator.decimal.go
0.e+0; .0e+0; 0.e-0; .0e-0;
-// ^^^^^ meta.number.float.decimal.go
-// ^ constant.numeric.value.go
+// ^^^^^ meta.number.float.decimal.go constant.numeric.value.go
// ^ punctuation.separator.decimal.go
-// ^^^ constant.numeric.value.exponent.go
-// ^^^^^ meta.number.float.decimal.go
+// ^^^^^ meta.number.float.decimal.go constant.numeric.value.go
// ^ punctuation.separator.decimal.go
-// ^ constant.numeric.value.go
-// ^^^ constant.numeric.value.exponent.go
-// ^^^^^ meta.number.float.decimal.go
-// ^ constant.numeric.value.go
+// ^^^^^ meta.number.float.decimal.go constant.numeric.value.go
// ^ punctuation.separator.decimal.go
-// ^^^ constant.numeric.value.exponent.go
-// ^^^^^ meta.number.float.decimal.go
+// ^^^^^ meta.number.float.decimal.go constant.numeric.value.go
// ^ punctuation.separator.decimal.go
-// ^ constant.numeric.value.go
-// ^^^ constant.numeric.value.exponent.go
0x1p-2; 0X1P+2; 0x1p2;
// ^^ meta.number.float.hexadecimal.go constant.numeric.base.go
-// ^ meta.number.float.hexadecimal.go constant.numeric.value.go
-// ^^^ meta.number.float.hexadecimal.go constant.numeric.value.exponent.go
+// ^^^^ meta.number.float.hexadecimal.go constant.numeric.value.go
// ^^ meta.number.float.hexadecimal.go constant.numeric.base.go
-// ^ meta.number.float.hexadecimal.go constant.numeric.value.go
-// ^^^ meta.number.float.hexadecimal.go constant.numeric.value.exponent.go
+// ^^^^ meta.number.float.hexadecimal.go constant.numeric.value.go
// ^^ meta.number.float.hexadecimal.go constant.numeric.base.go
-// ^ meta.number.float.hexadecimal.go constant.numeric.value.go
-// ^^ meta.number.float.hexadecimal.go constant.numeric.value.exponent.go
+// ^^^ meta.number.float.hexadecimal.go constant.numeric.value.go
0x_1p-2; 0X1_1P+2; 0x_1p2_1;
// ^^ meta.number.float.hexadecimal.go constant.numeric.base.go
-// ^^ meta.number.float.hexadecimal.go constant.numeric.value.go
-// ^^^ meta.number.float.hexadecimal.go constant.numeric.value.exponent.go
+// ^^^^^ meta.number.float.hexadecimal.go constant.numeric.value.go
// ^^ meta.number.float.hexadecimal.go constant.numeric.base.go
-// ^^^ meta.number.float.hexadecimal.go constant.numeric.value.go
-// ^^^ meta.number.float.hexadecimal.go constant.numeric.value.exponent.go
+// ^^^^^^ meta.number.float.hexadecimal.go constant.numeric.value.go
// ^^ meta.number.float.hexadecimal.go constant.numeric.base.go
-// ^^ meta.number.float.hexadecimal.go constant.numeric.value.go
-// ^^^^ meta.number.float.hexadecimal.go constant.numeric.value.exponent.go
+// ^^^^^^ meta.number.float.hexadecimal.go constant.numeric.value.go
0x1.0P-1021; 0X1.0p-1021;
// ^^ meta.number.float.hexadecimal.go constant.numeric.base.go
-// ^ meta.number.float.hexadecimal.go constant.numeric.value.go
-// ^ meta.number.float.hexadecimal.go punctuation.separator.decimal.go
-// ^ meta.number.float.hexadecimal.go constant.numeric.value.go
-// ^^^^^^ meta.number.float.hexadecimal.go constant.numeric.value.exponent.go
+// ^^^^^^^^^ meta.number.float.hexadecimal.go constant.numeric.value.go
+// ^ punctuation.separator.decimal.go
// ^^ meta.number.float.hexadecimal.go constant.numeric.base.go
-// ^ meta.number.float.hexadecimal.go constant.numeric.value.go
-// ^ meta.number.float.hexadecimal.go punctuation.separator.decimal.go
-// ^ meta.number.float.hexadecimal.go constant.numeric.value.go
-// ^^^^^^ meta.number.float.hexadecimal.go constant.numeric.value.exponent.go
+// ^^^^^^^^^ meta.number.float.hexadecimal.go constant.numeric.value.go
+// ^ punctuation.separator.decimal.go
0x_1_1.0_7P-1_021;
// ^^ meta.number.float.hexadecimal.go constant.numeric.base.go
-// ^^^^ meta.number.float.hexadecimal.go constant.numeric.value.go
-// ^ meta.number.float.hexadecimal.go punctuation.separator.decimal.go
-// ^^^ meta.number.float.hexadecimal.go constant.numeric.value.go
-// ^^^^^^^ meta.number.float.hexadecimal.go constant.numeric.value.exponent.go
+// ^^^^^^^^^^^^^^^ meta.number.float.hexadecimal.go constant.numeric.value.go
+// ^ punctuation.separator.decimal.go
0x2.p10; 0x1.Fp+0; 0X.8p-0;
// ^^ meta.number.float.hexadecimal.go constant.numeric.base.go
-// ^ meta.number.float.hexadecimal.go constant.numeric.value.go
-// ^ meta.number.float.hexadecimal.go punctuation.separator.decimal.go
-// ^^^ meta.number.float.hexadecimal.go constant.numeric.value.exponent.go
+// ^^^^^ meta.number.float.hexadecimal.go constant.numeric.value.go
+// ^ punctuation.separator.decimal.go
// ^^ meta.number.float.hexadecimal.go constant.numeric.base.go
-// ^ meta.number.float.hexadecimal.go constant.numeric.value.go
-// ^ meta.number.float.hexadecimal.go punctuation.separator.decimal.go
-// ^ meta.number.float.hexadecimal.go constant.numeric.value.go
-// ^^^ meta.number.float.hexadecimal.go constant.numeric.value.exponent.go
+// ^^^^^^ meta.number.float.hexadecimal.go constant.numeric.value.go
+// ^ punctuation.separator.decimal.go
// ^^ meta.number.float.hexadecimal.go constant.numeric.base.go
-// ^ meta.number.float.hexadecimal.go punctuation.separator.decimal.go
-// ^ meta.number.float.hexadecimal.go constant.numeric.value.go
-// ^^^ meta.number.float.hexadecimal.go constant.numeric.value.exponent.go
+// ^^^^^ meta.number.float.hexadecimal.go constant.numeric.value.go
+// ^ punctuation.separator.decimal.go
// ## Imaginary
@@ -2044,72 +1976,54 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
123.456i; -123.456i; 1_23.45_6i;
// ^^^^^^^^ meta.number.imaginary.decimal.go
-// ^^^ constant.numeric.value.go
+// ^^^^^^^ constant.numeric.value.go
// ^ punctuation.separator.decimal.go
-// ^^^ constant.numeric.value.go
// ^ constant.numeric.suffix.go
// ^ keyword.operator.arithmetic.go
// ^^^^^^^^ meta.number.imaginary.decimal.go
-// ^^^ constant.numeric.value.go
+// ^^^^^^^ constant.numeric.value.go
// ^ punctuation.separator.decimal.go
-// ^^^ constant.numeric.value.go
// ^ constant.numeric.suffix.go
// ^^^^^^^^^^ meta.number.imaginary.decimal.go
-// ^^^^ constant.numeric.value.go
+// ^^^^^^^^^ constant.numeric.value.go
// ^ punctuation.separator.decimal.go
-// ^^^^ constant.numeric.value.go
// ^ constant.numeric.suffix.go
1e+2i; 1e-2i; 1.2e+3i; 1.2e-3i; 1E+2i; 1E-2i; 1.2E+3i; 1.2E-3i;
-// ^ meta.number.imaginary.decimal.go constant.numeric.value.go
-// ^^^ meta.number.imaginary.decimal.go constant.numeric.value.exponent.go
+// ^^^^ meta.number.imaginary.decimal.go constant.numeric.value.go
// ^ meta.number.imaginary.decimal.go constant.numeric.suffix.go
// ^ punctuation.terminator.go
-// ^ meta.number.imaginary.decimal.go constant.numeric.value.go
-// ^^^ meta.number.imaginary.decimal.go constant.numeric.value.exponent.go
+// ^^^^ meta.number.imaginary.decimal.go constant.numeric.value.go
// ^ meta.number.imaginary.decimal.go constant.numeric.suffix.go
// ^ punctuation.terminator.go
-// ^ meta.number.imaginary.decimal.go constant.numeric.value.go
-// ^ meta.number.imaginary.decimal.go punctuation.separator.decimal.go
-// ^ meta.number.imaginary.decimal.go constant.numeric.value.go
-// ^^^ meta.number.imaginary.decimal.go constant.numeric.value.exponent.go
+// ^^^^^^ meta.number.imaginary.decimal.go constant.numeric.value.go
+// ^ punctuation.separator.decimal.go
// ^ meta.number.imaginary.decimal.go constant.numeric.suffix.go
// ^ punctuation.terminator.go
-// ^ meta.number.imaginary.decimal.go constant.numeric.value.go
-// ^ meta.number.imaginary.decimal.go punctuation.separator.decimal.go
-// ^ meta.number.imaginary.decimal.go constant.numeric.value.go
-// ^^^ meta.number.imaginary.decimal.go constant.numeric.value.exponent.go
+// ^^^^^^ meta.number.imaginary.decimal.go constant.numeric.value.go
+// ^ punctuation.separator.decimal.go
// ^ meta.number.imaginary.decimal.go constant.numeric.suffix.go
// ^ punctuation.terminator.go
-// ^ meta.number.imaginary.decimal.go constant.numeric.value.go
-// ^^^ meta.number.imaginary.decimal.go constant.numeric.value.exponent.go
+// ^^^^ meta.number.imaginary.decimal.go constant.numeric.value.go
// ^ meta.number.imaginary.decimal.go constant.numeric.suffix.go
// ^ punctuation.terminator.go
-// ^ meta.number.imaginary.decimal.go constant.numeric.value.go
-// ^^^ meta.number.imaginary.decimal.go constant.numeric.value.exponent.go
+// ^^^^ meta.number.imaginary.decimal.go constant.numeric.value.go
// ^ meta.number.imaginary.decimal.go constant.numeric.suffix.go
// ^ punctuation.terminator.go
-// ^ meta.number.imaginary.decimal.go constant.numeric.value.go
-// ^ meta.number.imaginary.decimal.go punctuation.separator.decimal.go
-// ^ meta.number.imaginary.decimal.go constant.numeric.value.go
-// ^^^ meta.number.imaginary.decimal.go constant.numeric.value.exponent.go
+// ^^^^^^ meta.number.imaginary.decimal.go constant.numeric.value.go
+// ^ punctuation.separator.decimal.go
// ^ meta.number.imaginary.decimal.go constant.numeric.suffix.go
// ^ punctuation.terminator.go
-// ^ meta.number.imaginary.decimal.go constant.numeric.value.go
-// ^ meta.number.imaginary.decimal.go punctuation.separator.decimal.go
-// ^ meta.number.imaginary.decimal.go constant.numeric.value.go
-// ^^^ meta.number.imaginary.decimal.go constant.numeric.value.exponent.go
+// ^^^^^^ meta.number.imaginary.decimal.go constant.numeric.value.go
+// ^ punctuation.separator.decimal.go
// ^ meta.number.imaginary.decimal.go constant.numeric.suffix.go
// ^ punctuation.terminator.go
1_1e+2_1i; 1.2_1E-3_5i;
-// ^^^ meta.number.imaginary.decimal.go constant.numeric.value.go
-// ^^^^^ meta.number.imaginary.decimal.go constant.numeric.value.exponent.go
+// ^^^^^^^^ meta.number.imaginary.decimal.go constant.numeric.value.go
// ^ meta.number.imaginary.decimal.go constant.numeric.suffix.go
-// ^ meta.number.imaginary.decimal.go constant.numeric.value.go
-// ^ meta.number.imaginary.decimal.go punctuation.separator.decimal.go
-// ^^^ meta.number.imaginary.decimal.go constant.numeric.value.go
-// ^^^^^ meta.number.imaginary.decimal.go constant.numeric.value.exponent.go
+// ^^^^^^^^^^ meta.number.imaginary.decimal.go constant.numeric.value.go
+// ^ punctuation.separator.decimal.go
// ^ meta.number.imaginary.decimal.go constant.numeric.suffix.go
0o6i; 0O35i; 0o_6i; 0O3_5i;
@@ -2153,32 +2067,24 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
0x1p-2i; 0x1.0P-1021i; 0x1.Fp+0i;
// ^^ meta.number.imaginary.hexadecimal.go constant.numeric.base.go
-// ^ meta.number.imaginary.hexadecimal.go constant.numeric.value.go
-// ^^^ meta.number.imaginary.hexadecimal.go constant.numeric.value.exponent.go
+// ^^^^ meta.number.imaginary.hexadecimal.go constant.numeric.value.go
// ^ meta.number.imaginary.hexadecimal.go constant.numeric.suffix.go
// ^^ meta.number.imaginary.hexadecimal.go constant.numeric.base.go
-// ^ meta.number.imaginary.hexadecimal.go constant.numeric.value.go
-// ^ meta.number.imaginary.hexadecimal.go punctuation.separator.decimal.go
-// ^ meta.number.imaginary.hexadecimal.go constant.numeric.value.go
-// ^^^^^^ meta.number.imaginary.hexadecimal.go constant.numeric.value.exponent.go
+// ^^^^^^^^^ meta.number.imaginary.hexadecimal.go constant.numeric.value.go
+// ^ punctuation.separator.decimal.go
// ^ meta.number.imaginary.hexadecimal.go constant.numeric.suffix.go
// ^^ meta.number.imaginary.hexadecimal.go constant.numeric.base.go
-// ^ meta.number.imaginary.hexadecimal.go constant.numeric.value.go
-// ^ meta.number.imaginary.hexadecimal.go punctuation.separator.decimal.go
-// ^ meta.number.imaginary.hexadecimal.go constant.numeric.value.go
-// ^^^ meta.number.imaginary.hexadecimal.go constant.numeric.value.exponent.go
+// ^^^^^^ meta.number.imaginary.hexadecimal.go constant.numeric.value.go
+// ^ punctuation.separator.decimal.go
// ^ meta.number.imaginary.hexadecimal.go constant.numeric.suffix.go
0x_1p-2i; 0x1_4.0_5P-102_1i;
// ^^ meta.number.imaginary.hexadecimal.go constant.numeric.base.go
-// ^^ meta.number.imaginary.hexadecimal.go constant.numeric.value.go
-// ^^^ meta.number.imaginary.hexadecimal.go constant.numeric.value.exponent.go
+// ^^^^^ meta.number.imaginary.hexadecimal.go constant.numeric.value.go
// ^ meta.number.imaginary.hexadecimal.go constant.numeric.suffix.go
// ^^ meta.number.imaginary.hexadecimal.go constant.numeric.base.go
-// ^^^ meta.number.imaginary.hexadecimal.go constant.numeric.value.go
-// ^ meta.number.imaginary.hexadecimal.go punctuation.separator.decimal.go
-// ^^^ meta.number.imaginary.hexadecimal.go constant.numeric.value.go
-// ^^^^^^^ meta.number.imaginary.hexadecimal.go constant.numeric.value.exponent.go
+// ^^^^^^^^^^^^^^ meta.number.imaginary.hexadecimal.go constant.numeric.value.go
+// ^ punctuation.separator.decimal.go
// ^ meta.number.imaginary.hexadecimal.go constant.numeric.suffix.go
// ## Runes
@@ -2501,7 +2407,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
ident.(chan typ)
// ^^^^^ variable.other.go
// ^ punctuation.accessor.dot.go
-// ^^^^ storage.type.keyword.chan.go
+// ^^^^ keyword.declaration.chan.go
// ^^^ storage.type.go
ident.(***ident)
@@ -2562,7 +2468,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
// ## Parens
-// Note: we can't syntactically disambiguate calls and casts.
+// Note: we can't syntactically disambiguate calls and type conversions.
ident()
// ^^^^ variable.function.go
@@ -2652,18 +2558,18 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
(*chan typ)(ident)
// ^ keyword.operator.go
-// ^^^^ storage.type.keyword.chan.go
+// ^^^^ keyword.declaration.chan.go
// ^^^ storage.type.go
// ^^^^^ variable.other.go
map[typ]typ(ident)
-// ^^^ storage.type.keyword.map.go
+// ^^^ keyword.declaration.map.go
// ^^^ storage.type.go
// ^^^ storage.type.go
// ^^^^^ variable.other.go
(map[typ]typ)(ident)
-// ^^^ storage.type.keyword.map.go
+// ^^^ keyword.declaration.map.go
// ^^^ storage.type.go
// ^^^ storage.type.go
// ^^^^^ variable.other.go
@@ -2720,14 +2626,14 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
// declarations, anonymous functions, and function types.
func() {}
-// ^^^^ storage.type.keyword.function.go
+// ^^^^ keyword.declaration.function.go
// ^ punctuation.section.parens.begin.go
// ^ punctuation.section.parens.end.go
// ^ meta.block.go punctuation.section.braces.begin.go
// ^ meta.block.go punctuation.section.braces.end.go
func ident() {}
-// ^^^^ storage.type.keyword.function.go
+// ^^^^ keyword.declaration.function.go
// ^^^^^ entity.name.function.go
// ^ punctuation.section.parens.begin.go
// ^ punctuation.section.parens.end.go
@@ -2735,17 +2641,17 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
// ^ meta.block.go punctuation.section.braces.end.go
func ident /**/ () {}
-// ^^^^ storage.type.keyword.function.go
+// ^^^^ keyword.declaration.function.go
// ^^^^^ entity.name.function.go
// ^^^^ comment.block.go
func ident /* * */ () {}
-// ^^^^ storage.type.keyword.function.go
+// ^^^^ keyword.declaration.function.go
// ^^^^^ entity.name.function.go
// ^^^^^^^ comment.block.go
func ident(
-// ^^^^ storage.type.keyword.function.go
+// ^^^^ keyword.declaration.function.go
// ^^^^^ entity.name.function.go
param typ
// ^^^^^ variable.parameter.go
@@ -2765,7 +2671,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
// ^ punctuation.section.parens.end.go
func (Type) Method() {}
-// ^^^^ storage.type.keyword.function.go
+// ^^^^ keyword.declaration.function.go
// ^ meta.function.declaration.go punctuation.section.parens.begin.go
// ^^^^ meta.function.declaration.go storage.type.go
// ^ meta.function.declaration.go punctuation.section.parens.end.go
@@ -2774,7 +2680,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types".
// ^ punctuation.section.parens.end.go
func /**/
-// ^^^^ storage.type.keyword.function.go
+// ^^^^ keyword.declaration.function.go
// ^^^^ comment.block.go
( /**/ self /**/ * /**/ ident /**/ . /**/ Type /**/ ) /**/ Method /**/ (
// ^ meta.function.declaration.go punctuation.section.parens.begin.go
@@ -2821,49 +2727,49 @@ every type individually.
*/
chan typ
-// ^^^^ storage.type.keyword.chan.go
+// ^^^^ keyword.declaration.chan.go
// ^^^ storage.type.go -support
chan int
-// ^^^^ storage.type.keyword.chan.go
+// ^^^^ keyword.declaration.chan.go
// ^^^ storage.type.go support.type.builtin.go
func(typ)
-// ^^^^ storage.type.keyword.function.go
+// ^^^^ keyword.declaration.function.go
// ^^^ storage.type.go -support
func(int)
-// ^^^^ storage.type.keyword.function.go
+// ^^^^ keyword.declaration.function.go
// ^^^ storage.type.go support.type.builtin.go
map[typ]typ
-// ^^^ storage.type.keyword.map.go
+// ^^^ keyword.declaration.map.go
// ^^^ storage.type.go -support
// ^^^ storage.type.go -support
map[int]int
-// ^^^ storage.type.keyword.map.go
+// ^^^ keyword.declaration.map.go
// ^^^ storage.type.go support.type.builtin.go
// ^^^ storage.type.go support.type.builtin.go
struct { ident typ; typ }
-// ^^^^^^ storage.type.keyword.struct.go
+// ^^^^^^ keyword.declaration.struct.go
// ^^^^^ meta.type.go variable.other.member.declaration.go
// ^^^ meta.type.go storage.type.go -support
// ^^^ meta.type.go entity.other.inherited-class.go -support
struct { ident int; int }
-// ^^^^^^ storage.type.keyword.struct.go
+// ^^^^^^ keyword.declaration.struct.go
// ^^^^^ meta.type.go variable.other.member.declaration.go
// ^^^ meta.type.go storage.type.go support.type.builtin.go
// ^^^ meta.type.go entity.other.inherited-class.go support.type.builtin.go
interface { typ }
-// ^^^^^^^^^ storage.type.keyword.interface.go
+// ^^^^^^^^^ keyword.declaration.interface.go
// ^^^ meta.type.go entity.other.inherited-class.go -support
interface { error }
-// ^^^^^^^^^ storage.type.keyword.interface.go
+// ^^^^^^^^^ keyword.declaration.interface.go
// ^^^^^ meta.type.go entity.other.inherited-class.go support.type.builtin.go
[...]typ
@@ -2881,32 +2787,32 @@ every type individually.
// ^^^ storage.type.go support.type.builtin.go
type _ typ
-// ^^^^ storage.type.keyword.type.go
+// ^^^^ keyword.declaration.type.go
// ^ variable.language.blank.go
// ^^^ storage.type.go -support
type _ int
-// ^^^^ storage.type.keyword.type.go
+// ^^^^ keyword.declaration.type.go
// ^ variable.language.blank.go
// ^^^ storage.type.go support.type.builtin.go
const ident typ
-// ^^^^^ storage.type.keyword.const.go
+// ^^^^^ keyword.declaration.const.go
// ^^^^^ variable.other.constant.declaration.go
// ^^^ storage.type.go -support
const ident int
-// ^^^^^ storage.type.keyword.const.go
+// ^^^^^ keyword.declaration.const.go
// ^^^^^ variable.other.constant.declaration.go
// ^^^ storage.type.go support.type.builtin.go
var ident typ
-// ^^^ storage.type.keyword.var.go
+// ^^^ keyword.declaration.var.go
// ^^^^^ variable.declaration.go
// ^^^ storage.type.go -support
var ident int
-// ^^^ storage.type.keyword.var.go
+// ^^^ keyword.declaration.var.go
// ^^^^^ variable.declaration.go
// ^^^ storage.type.go support.type.builtin.go
@@ -2969,7 +2875,7 @@ every type individually.
// ^^^^ variable.other.go -support
var make
-// ^^^ storage.type.keyword.var.go
+// ^^^ keyword.declaration.var.go
// ^^^^ variable.declaration.go -support
new(typ, ident)
@@ -3014,7 +2920,7 @@ every type individually.
// ^^^ variable.other.go -support
var new
-// ^^^ storage.type.keyword.var.go
+// ^^^ keyword.declaration.var.go
// ^^^ variable.declaration.go -support
// ## Other Functions
@@ -3047,7 +2953,7 @@ every function individually.
// ^^^^^ variable.other.go -support
var close
-// ^^^ storage.type.keyword.var.go
+// ^^^ keyword.declaration.var.go
// ^^^^^ variable.declaration.go -support
diff --git a/HTML/HTML (Plain).sublime-syntax b/HTML/HTML (Plain).sublime-syntax
index 6ac6f381ed..59a4e11cd5 100644
--- a/HTML/HTML (Plain).sublime-syntax
+++ b/HTML/HTML (Plain).sublime-syntax
@@ -208,6 +208,10 @@ contexts:
captures:
1: punctuation.definition.tag.begin.html
2: punctuation.definition.tag.end.html
+ - match: '<'
+ scope: meta.character.less-than.html
+ - match: '>'
+ scope: meta.character.greater-than.html
tag-end:
- match: '>'
@@ -287,6 +291,7 @@ contexts:
- include: else-pop
tag-generic-attribute-value:
+ - meta_include_prototype: false
- match: \"
scope:
meta.string.html string.quoted.double.html
diff --git a/HTML/HTML.sublime-syntax b/HTML/HTML.sublime-syntax
index f24c4b6e6e..46d9dbca91 100644
--- a/HTML/HTML.sublime-syntax
+++ b/HTML/HTML.sublime-syntax
@@ -43,25 +43,6 @@ variables:
| text/livescript
)
- custom_element_char: |-
- (?x:
- # https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-core-concepts
- [-._a-z0-9\x{00B7}]
- | [\x{00C0}-\x{00D6}]
- | [\x{00D8}-\x{00F6}]
- | [\x{00F8}-\x{02FF}]
- | [\x{0300}-\x{037D}]
- | [\x{037F}-\x{1FFF}]
- | [\x{200C}-\x{200D}]
- | [\x{203F}-\x{2040}]
- | [\x{2070}-\x{218F}]
- | [\x{2C00}-\x{2FEF}]
- | [\x{3001}-\x{D7FF}]
- | [\x{F900}-\x{FDCF}]
- | [\x{FDF0}-\x{FFFD}]
- | [\x{10000}-\x{EFFFF}]
- )
-
script_close_lookahead: (?=(?:-->\s*)?(?i:script){{tag_name_break_char}})
style_close_lookahead: (?=(?i:style){{tag_name_break_char}})
@@ -71,7 +52,7 @@ contexts:
tag:
- include: tag-html
- - include: tag-custom
+ - include: tag-other
- include: tag-incomplete
###[ HTML TAGS ]##############################################################
@@ -152,34 +133,15 @@ contexts:
- include: tag-end-maybe-self-closing
- include: tag-attributes
-###[ CUSTOM TAG ]#############################################################
+###[ OTHER TAG ]##############################################################
- tag-custom:
- - match: ?(?=[A-Za-z]{{tag_name_char}}*?-)
- scope: punctuation.definition.tag.begin.html
- push:
- - tag-custom-content
- - tag-custom-name
+ tag-other:
- match: ?(?=[A-Za-z])
scope: punctuation.definition.tag.begin.html
push:
- tag-other-content
- tag-other-name
- tag-custom-name:
- - meta_content_scope: entity.name.tag.custom.html
- - match: '{{tag_name_break}}'
- pop: 1
- - match: '{{custom_element_char}}+'
- # no scope
- - match: '{{tag_name_char}}'
- scope: invalid.illegal.custom-tag-name.html
-
- tag-custom-content:
- - meta_scope: meta.tag.custom.html
- - include: tag-end-maybe-self-closing
- - include: tag-attributes
-
tag-other-name:
- meta_content_scope: entity.name.tag.other.html
- match: '{{tag_name_break}}'
@@ -406,6 +368,7 @@ contexts:
- include: else-pop
tag-class-attribute-value:
+ - meta_include_prototype: false
- match: \"
scope:
meta.string.html string.quoted.double.html
@@ -519,6 +482,7 @@ contexts:
- include: else-pop
tag-href-attribute-value:
+ - meta_include_prototype: false
- match: \"
scope:
meta.string.html string.quoted.double.html
@@ -559,11 +523,13 @@ contexts:
- include: tag-attribute-value-unquoted-invalid-char
tag-href-attribute-value-content:
+ - include: tag-attribute-value-content
- match: (%)\h{2}
scope: constant.character.escape.url.html
captures:
1: punctuation.definition.escape.html
- - include: tag-attribute-value-content
+ - match: '[/&?#]|://'
+ scope: punctuation.separator.path.html
###[ ID ATTRIBUTE ]###########################################################
@@ -586,6 +552,7 @@ contexts:
- include: else-pop
tag-id-attribute-value:
+ - meta_include_prototype: false
- match: \"
scope:
meta.string.html string.quoted.double.html
diff --git a/HTML/Indentation Rules.tmPreferences b/HTML/Indentation Rules.tmPreferences
index b9b896259b..9a4c97d284 100644
--- a/HTML/Indentation Rules.tmPreferences
+++ b/HTML/Indentation Rules.tmPreferences
@@ -44,8 +44,8 @@
| <\?(?!.*?\?>)
# sections that don't close themselves on the same line
| <\%(?!.*?\%>)
- # open curly braces that don't have close braces or string punctuation after them
- | \{(?![}"'])
+ # open curly braces at the end of a line with comments allowed
+ | \{(?=\s*(?:
+
+ <{{template}} {{attr}}={{value}} />
+ ## ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.tag
+
+ <[[template]] [[attr]]=[[value]] />
+ ## ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.tag
+
+ < attr=" echo value ?>" />
+ ## ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.tag