From 5c16d332a96f792146d0b68a18516b9779fa2e65 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 2 Dec 2017 08:15:29 -0200 Subject: [PATCH 001/407] [FJSX15] Fix comment scope --- syntaxes/fjsx15/comment/normal.sublime-syntax | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/syntaxes/fjsx15/comment/normal.sublime-syntax b/syntaxes/fjsx15/comment/normal.sublime-syntax index c25583cb..cd84425b 100644 --- a/syntaxes/fjsx15/comment/normal.sublime-syntax +++ b/syntaxes/fjsx15/comment/normal.sublime-syntax @@ -28,7 +28,7 @@ contexts: - match: \s*(/\*) captures: 1: >- - comment.line.js.fjsx15 + comment.block.js.fjsx15 punctuation.definition.comment.begin.js.fjsx15 set: block @@ -54,7 +54,7 @@ contexts: - match: \s*$\n? scope: meta.block-end.js.fjsx15 pop: true - - match: '' + - match: "" pop: true link: From b95f591808ff3702daa9aa7ff33e3b92a242ca31 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 2 Dec 2017 08:18:42 -0200 Subject: [PATCH 002/407] [FJSX15] Fix doc comments greedness --- syntaxes/fjsx15/comment/documentation.sublime-syntax | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/comment/documentation.sublime-syntax b/syntaxes/fjsx15/comment/documentation.sublime-syntax index a27ed19d..be8fb4b9 100644 --- a/syntaxes/fjsx15/comment/documentation.sublime-syntax +++ b/syntaxes/fjsx15/comment/documentation.sublime-syntax @@ -19,7 +19,7 @@ scope: ... contexts: main: - - match: \s*(/\*\*) + - match: \s*(/\*\*)(?!/) captures: 1: punctuation.definition.comment.documentation.begin.js.fjsx15 set: content From 1eff0a541df4cb3680d213dabf8ed54b44abb875 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 2 Dec 2017 08:33:07 -0200 Subject: [PATCH 003/407] Add property access operator to candyman --- Candyman.tmTheme | 9 +++++++++ schemes/candyman/shared/_object.scss | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/Candyman.tmTheme b/Candyman.tmTheme index dde2433b..545508ef 100644 --- a/Candyman.tmTheme +++ b/Candyman.tmTheme @@ -914,6 +914,15 @@ #aed581 + + scope + .punctuation.definition.property.access + settings + + foreground + #aed581 + + scope .object .keyword.operator diff --git a/schemes/candyman/shared/_object.scss b/schemes/candyman/shared/_object.scss index 2afdf4ef..a69e6dd5 100644 --- a/schemes/candyman/shared/_object.scss +++ b/schemes/candyman/shared/_object.scss @@ -14,6 +14,10 @@ foreground: $light-green-300; } +.punctuation.definition.property.access { + foreground: $light-green-300; +} + .object { .keyword.operator { foreground: $light-green-300; From b5785d270cea6156fdc71693ee690ad5d5a54056 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 2 Dec 2017 08:34:06 -0200 Subject: [PATCH 004/407] [FJSX15] Rename array operator to property access --- syntaxes/fjsx15/constant.sublime-syntax | 7 ++++++- ...ess.sublime-syntax => property-access.sublime-syntax} | 8 ++------ syntaxes/fjsx15/statement-and-expression.sublime-syntax | 1 - syntaxes/fjsx15/variable.sublime-syntax | 9 +++++++-- 4 files changed, 15 insertions(+), 10 deletions(-) rename syntaxes/fjsx15/{array-access.sublime-syntax => property-access.sublime-syntax} (83%) diff --git a/syntaxes/fjsx15/constant.sublime-syntax b/syntaxes/fjsx15/constant.sublime-syntax index 339d500d..384fd685 100644 --- a/syntaxes/fjsx15/constant.sublime-syntax +++ b/syntaxes/fjsx15/constant.sublime-syntax @@ -34,7 +34,7 @@ contexts: storage.modifier.js.fjsx15 keyword.operator.other.access.js.fjsx15 2: entity.name.constant.js.fjsx15 - pop: true + set: optional-property-access # Two or more characters. - match: | (?x)\s* @@ -50,4 +50,9 @@ contexts: storage.modifier.js.fjsx15 keyword.operator.other.access.js.fjsx15 2: entity.name.constant.js.fjsx15 + set: optional-property-access + + optional-property-access: + - include: Packages/Naomi/syntaxes/fjsx15/property-access.sublime-syntax + - match: (?=\S) pop: true diff --git a/syntaxes/fjsx15/array-access.sublime-syntax b/syntaxes/fjsx15/property-access.sublime-syntax similarity index 83% rename from syntaxes/fjsx15/array-access.sublime-syntax rename to syntaxes/fjsx15/property-access.sublime-syntax index 9e2eec87..f09cc8ba 100644 --- a/syntaxes/fjsx15/array-access.sublime-syntax +++ b/syntaxes/fjsx15/property-access.sublime-syntax @@ -21,20 +21,16 @@ contexts: main: - match: | (?x) - (?<= [$_[:alnum:]] - | ] - | \) - ) (?- support.js.fjsx15 entity.name.variable.js.fjsx15 + set: optional-property-access + + optional-property-access: + - include: Packages/Naomi/syntaxes/fjsx15/property-access.sublime-syntax + - match: (?=\S) pop: true From 536c76f0e18803be47c8aab1b8f1ccd6a119fbb3 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 2 Dec 2017 08:38:09 -0200 Subject: [PATCH 005/407] [FJSX15] Add optional property access to values --- syntaxes/fjsx15/function/body.sublime-syntax | 7 ++++++- syntaxes/fjsx15/literal/number.sublime-syntax | 15 ++++++++++----- syntaxes/fjsx15/literal/object.sublime-syntax | 7 ++++++- .../literal/string/double-quoted.sublime-syntax | 7 ++++++- .../literal/string/single-quoted.sublime-syntax | 7 ++++++- .../fjsx15/literal/string/template.sublime-syntax | 5 +++++ 6 files changed, 39 insertions(+), 9 deletions(-) diff --git a/syntaxes/fjsx15/function/body.sublime-syntax b/syntaxes/fjsx15/function/body.sublime-syntax index 114587ac..09d92c27 100644 --- a/syntaxes/fjsx15/function/body.sublime-syntax +++ b/syntaxes/fjsx15/function/body.sublime-syntax @@ -28,9 +28,14 @@ contexts: - match: \s*(}) captures: 1: punctuation.definition.function.body.end.js.fjsx15 - pop: true + set: optional-property-access - match: "" push: - match: (?=\s*}) pop: true - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + + optional-property-access: + - include: Packages/Naomi/syntaxes/fjsx15/property-access.sublime-syntax + - match: (?=\S) + pop: true diff --git a/syntaxes/fjsx15/literal/number.sublime-syntax b/syntaxes/fjsx15/literal/number.sublime-syntax index 9941241d..915d8b5f 100644 --- a/syntaxes/fjsx15/literal/number.sublime-syntax +++ b/syntaxes/fjsx15/literal/number.sublime-syntax @@ -44,26 +44,31 @@ contexts: - match: (?xi)\s*({{scientificNotation}}) captures: 1: constant.numeric.float.scientific.js.fjsx15 - pop: true + set: optional-property-access - match: (?x)\s*({{literalFloat}}) captures: 1: constant.numeric.float.js.fjsx15 - pop: true + set: optional-property-access integer: - match: \s*(0[bB][01_]+) captures: 1: constant.numeric.binary.js.fjsx15 - pop: true + set: optional-property-access - match: \s*(0[oO][0-7]+) captures: 1: constant.numeric.octal.js.fjsx15 - pop: true + set: optional-property-access - match: (?i)\s*(0[xX][0-9a-f_]+) captures: 1: constant.numeric.hex.js.fjsx15 - pop: true + set: optional-property-access - match: \s*([1-9][0-9_]*|0) captures: 1: constant.numeric.decimal.js.fjsx15 + set: optional-property-access + + optional-property-access: + - include: Packages/Naomi/syntaxes/fjsx15/property-access.sublime-syntax + - match: (?=\S) pop: true diff --git a/syntaxes/fjsx15/literal/object.sublime-syntax b/syntaxes/fjsx15/literal/object.sublime-syntax index 50241bcd..08df41bf 100644 --- a/syntaxes/fjsx15/literal/object.sublime-syntax +++ b/syntaxes/fjsx15/literal/object.sublime-syntax @@ -35,12 +35,17 @@ contexts: captures: 1: punctuation.definition.object.begin.js.fjsx15 2: punctuation.definition.object.end.js.fjsx15 - pop: true + set: optional-property-access # Normal object literal. - match: \s*({) scope: punctuation.definition.object.begin.js.fjsx15 set: declaration + optional-property-access: + - include: Packages/Naomi/syntaxes/fjsx15/property-access.sublime-syntax + - match: (?=\S) + pop: true + declaration: - match: \s*(,) captures: diff --git a/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax b/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax index fd3dff87..086a447d 100644 --- a/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax +++ b/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax @@ -48,9 +48,14 @@ contexts: 1: >- string.quoted.double.js.fjsx15 punctuation.definition.string.end.js.fjsx15 - pop: true + set: optional-property-access set: escape-a + optional-property-access: + - include: Packages/Naomi/syntaxes/fjsx15/property-access.sublime-syntax + - match: (?=\S) + pop: true + trap: - meta_content_scope: context.trap diff --git a/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax b/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax index df5c8bcb..e52a0f61 100644 --- a/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax +++ b/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax @@ -48,9 +48,14 @@ contexts: 1: >- string.quoted.single.js.fjsx15 punctuation.definition.string.end.js.fjsx15 - pop: true + set: optional-property-access set: escape-a + optional-property-access: + - include: Packages/Naomi/syntaxes/fjsx15/property-access.sublime-syntax + - match: (?=\S) + pop: true + trap: - meta_content_scope: context.trap diff --git a/syntaxes/fjsx15/literal/string/template.sublime-syntax b/syntaxes/fjsx15/literal/string/template.sublime-syntax index 38fc5436..27649cd1 100644 --- a/syntaxes/fjsx15/literal/string/template.sublime-syntax +++ b/syntaxes/fjsx15/literal/string/template.sublime-syntax @@ -87,4 +87,9 @@ contexts: scope: >- string.template.js.fjsx15 punctuation.definition.string.end.js.fjsx15 + set: optional-property-access + + optional-property-access: + - include: Packages/Naomi/syntaxes/fjsx15/property-access.sublime-syntax + - match: (?=\S) pop: true From b0466872f8afcf1860475390f1f78c4f403b7350 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 2 Dec 2017 08:40:23 -0200 Subject: [PATCH 006/407] [FJSX15] Expect operator near numbers --- syntaxes/fjsx15/literal/number.sublime-syntax | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/syntaxes/fjsx15/literal/number.sublime-syntax b/syntaxes/fjsx15/literal/number.sublime-syntax index 915d8b5f..c9b1a19c 100644 --- a/syntaxes/fjsx15/literal/number.sublime-syntax +++ b/syntaxes/fjsx15/literal/number.sublime-syntax @@ -44,31 +44,33 @@ contexts: - match: (?xi)\s*({{scientificNotation}}) captures: 1: constant.numeric.float.scientific.js.fjsx15 - set: optional-property-access + set: optional-property-access-or-operator - match: (?x)\s*({{literalFloat}}) captures: 1: constant.numeric.float.js.fjsx15 - set: optional-property-access + set: optional-property-access-or-operator integer: - match: \s*(0[bB][01_]+) captures: 1: constant.numeric.binary.js.fjsx15 - set: optional-property-access + set: optional-property-access-or-operator - match: \s*(0[oO][0-7]+) captures: 1: constant.numeric.octal.js.fjsx15 - set: optional-property-access + set: optional-property-access-or-operator - match: (?i)\s*(0[xX][0-9a-f_]+) captures: 1: constant.numeric.hex.js.fjsx15 - set: optional-property-access + set: optional-property-access-or-operator - match: \s*([1-9][0-9_]*|0) captures: 1: constant.numeric.decimal.js.fjsx15 - set: optional-property-access + set: optional-property-access-or-operator - optional-property-access: + optional-property-access-or-operator: + - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/property-access.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/operator.sublime-syntax - match: (?=\S) pop: true From 6fcdb8fe0684bd9e684f57089f846f8b44b61227 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 2 Dec 2017 08:52:30 -0200 Subject: [PATCH 007/407] [FJSX15] Fix comma delimiters near numbers --- syntaxes/fjsx15/literal/number.sublime-syntax | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/syntaxes/fjsx15/literal/number.sublime-syntax b/syntaxes/fjsx15/literal/number.sublime-syntax index c9b1a19c..56337a13 100644 --- a/syntaxes/fjsx15/literal/number.sublime-syntax +++ b/syntaxes/fjsx15/literal/number.sublime-syntax @@ -71,6 +71,11 @@ contexts: optional-property-access-or-operator: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/property-access.sublime-syntax + # Comma operators are usually used to delimit arguments. + - match: (?=\s*\,) + pop: true + # Other operators. - include: Packages/Naomi/syntaxes/fjsx15/operator.sublime-syntax + # Anything else. - match: (?=\S) pop: true From f2a32281bef6f6d8e96554cf929335e158146a20 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 2 Dec 2017 08:52:36 -0200 Subject: [PATCH 008/407] Fix tests --- .../fjsx15/literal/syntax_test_number.js | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/tests/syntaxes/fjsx15/literal/syntax_test_number.js b/tests/syntaxes/fjsx15/literal/syntax_test_number.js index bacd351e..0a52838f 100644 --- a/tests/syntaxes/fjsx15/literal/syntax_test_number.js +++ b/tests/syntaxes/fjsx15/literal/syntax_test_number.js @@ -12,35 +12,35 @@ // License for the specific language governing permissions and limitations under // the License. - 0 + 0; // ^ .constant.numeric.decimal.js.fjsx15 - 123 + 123; // ^^^ .constant.numeric.decimal.js.fjsx15 - 1_2_3 + 1_2_3; // ^^^^^ .constant.numeric.decimal.js.fjsx15 - 123_456_789 + 123_456_789; // ^^^^^^^^^^^ .constant.numeric.decimal.js.fjsx15 - 123. + 123.; // ^^^^ .constant.numeric.float.js.fjsx15 - 1_2_3. + 1_2_3.; // ^^^^^^ .constant.numeric.float.js.fjsx15 - 123_456_789. + 123_456_789.; // ^^^^^^^^^^^^ .constant.numeric.float.js.fjsx15 - 123.0 + 123.0; // ^^^^^ .constant.numeric.float.js.fjsx15 - .123 + .123; // ^^^^ .constant.numeric.float.js.fjsx15 - 0.123 + 0.123; // ^^^^^ .constant.numeric.float.js.fjsx15 - 123e10 + 123e10; // ^^^^^^ .constant.numeric.float.scientific.js.fjsx15 - 123e+10 + 123e+10; // ^^^^^^^ .constant.numeric.float.scientific.js.fjsx15 - 123e-10 + 123e-10; // ^^^^^^^ .constant.numeric.float.scientific.js.fjsx15 - 0x123 + 0x123; // ^^^^^ .constant.numeric.hex.js.fjsx15 - 0x1_2_3 + 0x1_2_3; // ^^^^^^^ .constant.numeric.hex.js.fjsx15 - 0x123_456_789 + 0x123_456_789; // ^^^^^^^^^^^^^ .constant.numeric.hex.js.fjsx15 From ec5eef5b3308ade3c8d30dd2035d0074d31920a4 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 2 Dec 2017 11:12:23 -0200 Subject: [PATCH 009/407] [FJSX15] Make body optional in statements --- syntaxes/fjsx15/statement/bodied.sublime-syntax | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/syntaxes/fjsx15/statement/bodied.sublime-syntax b/syntaxes/fjsx15/statement/bodied.sublime-syntax index 1aa169f6..1d4ef914 100644 --- a/syntaxes/fjsx15/statement/bodied.sublime-syntax +++ b/syntaxes/fjsx15/statement/bodied.sublime-syntax @@ -29,7 +29,7 @@ contexts: ))\b captures: 1: keyword.control.js.fjsx15 - set: body + set: optional-body # Optional header. - match: | (?x)\s*\b @@ -37,7 +37,7 @@ contexts: captures: 1: keyword.control.js.fjsx15 set: [ - body, + optional-body, optional-header ] # Header and body. @@ -56,7 +56,7 @@ contexts: 1: keyword.control.js.fjsx15 2: keyword.control.js.fjsx15 set: [ - body, + optional-body, header ] @@ -89,7 +89,9 @@ contexts: 1: keyword.operator.other.terminator.js.fjsx15 pop: true - body: + optional-body: + - match: (?=\s*(?>}|]|)) + pop: true - match: \s*(\{) captures: 1: punctuation.definition.control.body.begin.js.fjsx15 From 7ba0477fcbf49cc8838119589c2d74ea315d85a2 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 2 Dec 2017 11:12:50 -0200 Subject: [PATCH 010/407] [FJSX15] Fix keyFor --- syntaxes/fjsx15/core.sublime-syntax | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/core.sublime-syntax b/syntaxes/fjsx15/core.sublime-syntax index 975c11a0..1dffb860 100644 --- a/syntaxes/fjsx15/core.sublime-syntax +++ b/syntaxes/fjsx15/core.sublime-syntax @@ -170,7 +170,7 @@ contexts: \s*(Symbol) \s*(\.)\s* ((?> for - | KeyFor + | keyFor ))\b captures: 1: >- From d4a9ad09e234c52b90a6ecc4117a90c9524d0d43 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 2 Dec 2017 11:13:01 -0200 Subject: [PATCH 011/407] [FJSX15] Add function.sent --- syntaxes/fjsx15/function.sublime-syntax | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/syntaxes/fjsx15/function.sublime-syntax b/syntaxes/fjsx15/function.sublime-syntax index 58b5d965..124901c2 100644 --- a/syntaxes/fjsx15/function.sublime-syntax +++ b/syntaxes/fjsx15/function.sublime-syntax @@ -24,6 +24,16 @@ variables: contexts: main: + # Function property. + - match: | + (?x)\s* + (function.sent) + captures: + 1: >- + support.core.js.fjsx15 + entity.name.variable.js.fjsx15 + pop: true + # Function declaration. - match: | (?x)\s* (?: From fed5ab6f6eca0b42adcfbda95fbb5870d4ca53ac Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 2 Dec 2017 11:14:18 -0200 Subject: [PATCH 012/407] [FJSX15] Fix optional body escape regex --- syntaxes/fjsx15/statement/bodied.sublime-syntax | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/statement/bodied.sublime-syntax b/syntaxes/fjsx15/statement/bodied.sublime-syntax index 1d4ef914..880c9767 100644 --- a/syntaxes/fjsx15/statement/bodied.sublime-syntax +++ b/syntaxes/fjsx15/statement/bodied.sublime-syntax @@ -90,7 +90,7 @@ contexts: pop: true optional-body: - - match: (?=\s*(?>}|]|)) + - match: (?=\s*(?>}|]|\))) pop: true - match: \s*(\{) captures: From 89ec26a76cfc9b3dee82cc78e996e62033506977 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 2 Dec 2017 11:20:04 -0200 Subject: [PATCH 013/407] [FJSX15] Extract header --- .../fjsx15/statement/bodied.sublime-syntax | 22 +--------- .../fjsx15/statement/header.sublime-syntax | 43 +++++++++++++++++++ 2 files changed, 44 insertions(+), 21 deletions(-) create mode 100644 syntaxes/fjsx15/statement/header.sublime-syntax diff --git a/syntaxes/fjsx15/statement/bodied.sublime-syntax b/syntaxes/fjsx15/statement/bodied.sublime-syntax index 880c9767..e71fe657 100644 --- a/syntaxes/fjsx15/statement/bodied.sublime-syntax +++ b/syntaxes/fjsx15/statement/bodied.sublime-syntax @@ -67,27 +67,7 @@ contexts: set: header header: - - match: \s*(\() - captures: - 1: punctuation.definition.control.header.begin.js.fjsx15 - set: header-content - - header-content: - - match: \s*(\)) - captures: - 1: punctuation.definition.control.header.end.js.fjsx15 - pop: true - - match: "" - push: - - match: (?=\s*\)) - pop: true - - include: statement-and-expression - - terminator: - - match: \s*(;) - captures: - 1: keyword.operator.other.terminator.js.fjsx15 - pop: true + - include: Packages/Naomi/syntaxes/fjsx15/statement/header.sublime-syntax optional-body: - match: (?=\s*(?>}|]|\))) diff --git a/syntaxes/fjsx15/statement/header.sublime-syntax b/syntaxes/fjsx15/statement/header.sublime-syntax new file mode 100644 index 00000000..b2e869cb --- /dev/null +++ b/syntaxes/fjsx15/statement/header.sublime-syntax @@ -0,0 +1,43 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +contexts: + main: + - match: (?=\s*\() + set: header + + header: + - match: \s*(\() + captures: + 1: punctuation.definition.control.header.begin.js.fjsx15 + set: header-content + + header-content: + - match: \s*(\)) + captures: + 1: punctuation.definition.control.header.end.js.fjsx15 + pop: true + - match: "" + push: + - match: (?=\s*\)) + pop: true + - include: statement-and-expression + + statement-and-expression: + - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax From fe387dcad222f67d558653e271ab090d4dc8e350 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 2 Dec 2017 11:20:30 -0200 Subject: [PATCH 014/407] [FJXS15] Use header for dynamic imports --- syntaxes/fjsx15/import.sublime-syntax | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/import.sublime-syntax b/syntaxes/fjsx15/import.sublime-syntax index 108cd0c1..c428e441 100644 --- a/syntaxes/fjsx15/import.sublime-syntax +++ b/syntaxes/fjsx15/import.sublime-syntax @@ -38,7 +38,7 @@ contexts: (?=\s*\() captures: 1: keyword.control.import.js.fjsx15 - set: function-arguments + set: header # Import the entire module. - match: | (?x)\s* @@ -56,6 +56,9 @@ contexts: 1: keyword.control.import.js.fjsx15 set: targets + header: + - include: Packages/Naomi/syntaxes/fjsx15/statement/header.sublime-syntax + comment: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax From f8faec30399042a59529c79e7aad5f502a6f8fd6 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 2 Dec 2017 11:47:14 -0200 Subject: [PATCH 015/407] [FJSX15] Highlight operator between function.sent --- syntaxes/fjsx15/function.sublime-syntax | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/function.sublime-syntax b/syntaxes/fjsx15/function.sublime-syntax index 124901c2..f388b74a 100644 --- a/syntaxes/fjsx15/function.sublime-syntax +++ b/syntaxes/fjsx15/function.sublime-syntax @@ -27,11 +27,15 @@ contexts: # Function property. - match: | (?x)\s* - (function.sent) + (function)(.)(sent) captures: 1: >- support.core.js.fjsx15 entity.name.variable.js.fjsx15 + 2: keyword.operator.other.member-access.js.fjsx15 + 3: >- + support.core.js.fjsx15 + entity.name.variable.js.fjsx15 pop: true # Function declaration. - match: | From 2bc9337a90faebf83486b5f0f2c00cd33d6d41bb Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 2 Dec 2017 12:51:57 -0200 Subject: [PATCH 016/407] [FJSX15] Fix export statements edge cases --- syntaxes/fjsx15/export.sublime-syntax | 81 +++++++++++++++------------ 1 file changed, 45 insertions(+), 36 deletions(-) diff --git a/syntaxes/fjsx15/export.sublime-syntax b/syntaxes/fjsx15/export.sublime-syntax index c9093b53..fe12eabe 100644 --- a/syntaxes/fjsx15/export.sublime-syntax +++ b/syntaxes/fjsx15/export.sublime-syntax @@ -98,6 +98,18 @@ contexts: storage.modifier.js.fjsx15 keyword.control.export.default.js.fjsx15 set: object-literal + # Export default from. + - match: | + (?x) + \s*(export) + \s*(default) + (?=\s*from) + captures: + 1: keyword.control.export.js.fjsx15 + 2: >- + storage.modifier.js.fjsx15 + keyword.control.export.default.js.fjsx15 + set: origin # Export statements. - match: | (?x) @@ -117,18 +129,6 @@ contexts: captures: 1: keyword.control.export.js.fjsx15 set: statement-and-expression - # Export default from. - - match: | - (?x) - \s*(export) - \s*(default) - (?=\s*from) - captures: - 1: keyword.control.export.js.fjsx15 - 2: >- - storage.modifier.js.fjsx15 - keyword.control.export.default.js.fjsx15 - set: origin # Export default. - match: | (?x) @@ -169,13 +169,24 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/literal/string/template.sublime-syntax - punctuation: + export-list-begin: - match: \s*(\{) captures: 1: punctuation.definition.export.list.begin.js.fjsx15 + set: export-list + + export-list: - match: \s*(}) captures: 1: punctuation.definition.export.list.end.js.fjsx15 + set: comma-origin-escape + - match: "" + push: + - include: targets + - match: "" + pop: true + + comma: - match: \s*(,) captures: 1: punctuation.definition.export.item.js.fjsx15 @@ -183,42 +194,43 @@ contexts: targets: - include: comment - include: origin - - include: punctuation - - match: | - (?x) - (?=\s*export) - pop: true - - include: sequence - - sequence: + - include: export-list-begin + - include: comma + - include: alias # Default. - match: \s*(default)\b captures: 1: >- storage.modifier.js.fjsx15 keyword.control.export.default.js.fjsx15 - push: alias # All. - match: \s*(\*) captures: 1: keyword.operator.other.export.all.js.fjsx15 - push: optional-alias # Simple. - match: | (?xi)\s* + (?!{{keywords}}) ({{commonIdentifier}}) captures: 1: >- export.js.fjsx15 entity.name.ambiguous.js.fjsx15 - push: optional-alias + set: alias-comma-origin-escape + - match: (?=\s*\S) + pop: true - optional-alias: - - match: | - (?x) - (?=\s*(?>,|}|from)) + comma-origin-escape: + - match: (?=\s*(?>,|from)) + set: targets + - match: (?=\s*\S) + pop: true + + alias-comma-origin-escape: + - match: (?=\s*(?>,|as|from)) + set: targets + - match: (?=\s*\S) pop: true - - include: alias alias: - match: \s*(as)\b @@ -242,17 +254,14 @@ contexts: captures: 1: punctuation.definition.export.list.end.js.fjsx15 pop: true - - match: "" - push: aliased-type + - include: alias + - include: type - aliased-type: + type: - match: | (?xi) (?={{commonIdentifier}}) - set: [ - optional-alias, - simple-type - ] + push: simple-type simple-type: - include: Packages/Naomi/syntaxes/fjsx15/flowtype/simple.sublime-syntax From c1559389b8b766f17cd446a73c7f70f874ad4655 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 2 Dec 2017 14:08:08 -0200 Subject: [PATCH 017/407] Simplify candyman modifiers --- Candyman.tmTheme | 26 ++++++++++++++++++++++---- schemes/candyman/_main.scss | 1 - schemes/candyman/shared/_keyword.scss | 9 +++++++++ schemes/candyman/shared/_modifier.scss | 18 ------------------ 4 files changed, 31 insertions(+), 23 deletions(-) delete mode 100644 schemes/candyman/shared/_modifier.scss diff --git a/Candyman.tmTheme b/Candyman.tmTheme index 545508ef..a4006190 100644 --- a/Candyman.tmTheme +++ b/Candyman.tmTheme @@ -817,7 +817,7 @@ scope - .storage.type .keyword + .storage.modifier settings foreground @@ -826,22 +826,40 @@ scope - .entity.name.label, .punctuation.definition.label + .storage.modifier .keyword, .storage.modifier .keyword.operator settings foreground - #ffffff + #b39ddb scope - .storage.modifier .keyword, .storage.modifier .keyword.operator + .storage.type + settings + + foreground + #b39ddb + + + + scope + .storage.type .keyword settings foreground #b39ddb + + scope + .entity.name.label, .punctuation.definition.label + settings + + foreground + #ffffff + + scope .entity.name.namespace diff --git a/schemes/candyman/_main.scss b/schemes/candyman/_main.scss index b56f9ee4..356c7de1 100644 --- a/schemes/candyman/_main.scss +++ b/schemes/candyman/_main.scss @@ -50,7 +50,6 @@ @import "shared/interface"; @import "shared/keyword"; @import "shared/label"; -@import "shared/modifier"; @import "shared/namespace"; @import "shared/number"; @import "shared/object"; diff --git a/schemes/candyman/shared/_keyword.scss b/schemes/candyman/shared/_keyword.scss index 818b74ef..158305cc 100644 --- a/schemes/candyman/shared/_keyword.scss +++ b/schemes/candyman/shared/_keyword.scss @@ -14,7 +14,16 @@ foreground: $pink-a100; } +.storage.modifier { + foreground: $deep-purple-200; + .keyword, + .keyword.operator { + foreground: $deep-purple-200; + } +} + .storage.type { + foreground: $deep-purple-200; .keyword { foreground: $deep-purple-200; } diff --git a/schemes/candyman/shared/_modifier.scss b/schemes/candyman/shared/_modifier.scss deleted file mode 100644 index 1668eb26..00000000 --- a/schemes/candyman/shared/_modifier.scss +++ /dev/null @@ -1,18 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.storage.modifier { - .keyword, - .keyword.operator { - foreground: $deep-purple-200; - } -} From ab053a91192b6aa4c8333591b3647533cc865f57 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 2 Dec 2017 22:27:04 -0200 Subject: [PATCH 018/407] [FJSX15] Enhance regex prediction --- syntaxes/fjsx15/function/body.sublime-syntax | 5 +- syntaxes/fjsx15/literal.sublime-syntax | 2 +- .../string/guarded-regex.sublime-syntax | 101 ++++++++++++++++++ .../literal/string/regex.sublime-syntax | 32 ------ .../fjsx15/statement/bodied.sublime-syntax | 4 + 5 files changed, 109 insertions(+), 35 deletions(-) create mode 100644 syntaxes/fjsx15/literal/string/guarded-regex.sublime-syntax diff --git a/syntaxes/fjsx15/function/body.sublime-syntax b/syntaxes/fjsx15/function/body.sublime-syntax index 09d92c27..cb376c00 100644 --- a/syntaxes/fjsx15/function/body.sublime-syntax +++ b/syntaxes/fjsx15/function/body.sublime-syntax @@ -28,14 +28,15 @@ contexts: - match: \s*(}) captures: 1: punctuation.definition.function.body.end.js.fjsx15 - set: optional-property-access + set: optional-property-access-or-regex - match: "" push: - match: (?=\s*}) pop: true - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax - optional-property-access: + optional-property-access-or-regex: - include: Packages/Naomi/syntaxes/fjsx15/property-access.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/literal/string/regex.sublime-syntax - match: (?=\S) pop: true diff --git a/syntaxes/fjsx15/literal.sublime-syntax b/syntaxes/fjsx15/literal.sublime-syntax index e5b6119c..211dff4b 100644 --- a/syntaxes/fjsx15/literal.sublime-syntax +++ b/syntaxes/fjsx15/literal.sublime-syntax @@ -23,6 +23,6 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/literal/object.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/regex.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/literal/string/guarded-regex.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/literal/string/template.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/literal/number.sublime-syntax diff --git a/syntaxes/fjsx15/literal/string/guarded-regex.sublime-syntax b/syntaxes/fjsx15/literal/string/guarded-regex.sublime-syntax new file mode 100644 index 00000000..5d0ab226 --- /dev/null +++ b/syntaxes/fjsx15/literal/string/guarded-regex.sublime-syntax @@ -0,0 +1,101 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +contexts: + main: + # Regex literals are a bit hard to predict and there are some cases where + # this pattern will fail, for example: + # + # if (something) /regex/.exec(x); + # + # It’s impossible to know that the closing parenthesis is closing the + # statement’s header, that would only be possible with a parser. + # + # http://stackoverflow.com/questions/5519596/when-parsing-javascript-what-determines-the-meaning-of-a-slash + - match: | + (?x) + (?<= ^ + | \. + | , + | ; + | \( + | \{ + | } + | \[ + | < + | > + | = + | \+ + | - + | \& + | \| + | \^ + | ! + | ~ + | \? + | : + | / + | case + | export + | import + | in + | instanceof + | new + | return + | throw + | typeof + | yield + ) + \s*/ + (?= + .*? + (?- + string.unquoted.regex.js.fjsx15 + punctuation.definition.string.begin.js.fjsx15 + set: escape-a + + regex-end: + - match: | + (?x) + (/) + ([a-z]{0,5}) + captures: + 0: string.unquoted.regex.js.fjsx15 + 1: punctuation.definition.string.end.js.fjsx15 + 2: regex.flag.js.fjsx15 + pop: true + + escape-a: + - meta_content_scope: string.unquoted.regex.js.fjsx15 + - match: \\. + scope: constant.character.escape.a.js.fjsx15 + set: escape-b + # If the slash was not consumed before, it probably is the end of the regex. + - include: regex-end + + escape-b: + - meta_content_scope: string.unquoted.regex.js.fjsx15 + - match: \\. + scope: constant.character.escape.b.js.fjsx15 + set: escape-a + # If the slash was not consumed before, it probably is the end of the regex. + - include: regex-end diff --git a/syntaxes/fjsx15/literal/string/regex.sublime-syntax b/syntaxes/fjsx15/literal/string/regex.sublime-syntax index 5d0ab226..d538dbb9 100644 --- a/syntaxes/fjsx15/literal/string/regex.sublime-syntax +++ b/syntaxes/fjsx15/literal/string/regex.sublime-syntax @@ -30,38 +30,6 @@ contexts: # http://stackoverflow.com/questions/5519596/when-parsing-javascript-what-determines-the-meaning-of-a-slash - match: | (?x) - (?<= ^ - | \. - | , - | ; - | \( - | \{ - | } - | \[ - | < - | > - | = - | \+ - | - - | \& - | \| - | \^ - | ! - | ~ - | \? - | : - | / - | case - | export - | import - | in - | instanceof - | new - | return - | throw - | typeof - | yield - ) \s*/ (?= .*? diff --git a/syntaxes/fjsx15/statement/bodied.sublime-syntax b/syntaxes/fjsx15/statement/bodied.sublime-syntax index e71fe657..d771b9f8 100644 --- a/syntaxes/fjsx15/statement/bodied.sublime-syntax +++ b/syntaxes/fjsx15/statement/bodied.sublime-syntax @@ -72,10 +72,14 @@ contexts: optional-body: - match: (?=\s*(?>}|]|\))) pop: true + # Regex right after header. + - include: Packages/Naomi/syntaxes/fjsx15/literal/string/regex.sublime-syntax + # Body beginning. - match: \s*(\{) captures: 1: punctuation.definition.control.body.begin.js.fjsx15 set: body-content + # Other statements and expressions. - include: statement-and-expression body-content: From 169e48dc19f68ef463be0efc5133fa05241e673c Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 2 Dec 2017 22:28:32 -0200 Subject: [PATCH 019/407] [FJSX15] Highlight comments before regex --- syntaxes/fjsx15/function/body.sublime-syntax | 1 + 1 file changed, 1 insertion(+) diff --git a/syntaxes/fjsx15/function/body.sublime-syntax b/syntaxes/fjsx15/function/body.sublime-syntax index cb376c00..d092a91d 100644 --- a/syntaxes/fjsx15/function/body.sublime-syntax +++ b/syntaxes/fjsx15/function/body.sublime-syntax @@ -36,6 +36,7 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax optional-property-access-or-regex: + - include: Packages/Naomi/syntaxes/fjsx15/comment.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/property-access.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/literal/string/regex.sublime-syntax - match: (?=\S) From 5e3e16ec436add9238a6754a497b67cf2167740d Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 2 Dec 2017 22:31:59 -0200 Subject: [PATCH 020/407] [FJSX15] Add property access for classes --- syntaxes/fjsx15/class/body.sublime-syntax | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/class/body.sublime-syntax b/syntaxes/fjsx15/class/body.sublime-syntax index 20120ce5..04596f7e 100644 --- a/syntaxes/fjsx15/class/body.sublime-syntax +++ b/syntaxes/fjsx15/class/body.sublime-syntax @@ -25,12 +25,19 @@ contexts: 1: punctuation.definition.class.body.begin.js.fjsx15 set: body + optional-property-access-or-regex: + - include: Packages/Naomi/syntaxes/fjsx15/comment.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/property-access.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/literal/string/regex.sublime-syntax + - match: (?=\S) + pop: true + body: - include: comment - match: \s*(}) captures: 1: punctuation.definition.class.body.end.js.fjsx15 - pop: true + set: optional-property-access-or-regex - match: "" push: # This is necessary because normally these instance variables would be From f94a40d170f437f70926af9f1265e810a7054435 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 2 Dec 2017 22:37:26 -0200 Subject: [PATCH 021/407] [FJSX15] Add property access near parenthesis --- syntaxes/fjsx15/statement-and-expression.sublime-syntax | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/syntaxes/fjsx15/statement-and-expression.sublime-syntax b/syntaxes/fjsx15/statement-and-expression.sublime-syntax index b66bf119..0d86139f 100644 --- a/syntaxes/fjsx15/statement-and-expression.sublime-syntax +++ b/syntaxes/fjsx15/statement-and-expression.sublime-syntax @@ -54,7 +54,7 @@ contexts: - match: \s*(\)) captures: 1: punctuation.definition.expression.group.b.end.js.fjsx15 - pop: true + set: optional-property-access # Expression contents. - match: "" push: @@ -76,7 +76,7 @@ contexts: - match: \s*(\)) captures: 1: punctuation.definition.expression.group.a.end.js.fjsx15 - pop: true + set: optional-property-access # Expression contents. - match: "" push: @@ -84,6 +84,11 @@ contexts: - match: \s* pop: true + optional-property-access: + - include: Packages/Naomi/syntaxes/fjsx15/property-access.sublime-syntax + - match: (?=\S) + pop: true + comment: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax From 5b31d53a4b9dbd3e8e91f41ac76b970e054d73c9 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 3 Dec 2017 18:29:19 -0200 Subject: [PATCH 022/407] [FJSX15] Disable main loop --- .../fjsx15/arrow-function/body.sublime-syntax | 6 +- .../arrow-function/parameters.sublime-syntax | 6 +- syntaxes/fjsx15/class/method.sublime-syntax | 6 +- syntaxes/fjsx15/class/property.sublime-syntax | 4 +- .../fjsx15/decorator/arguments.sublime-syntax | 2 +- .../fjsx15/destructuring/array.sublime-syntax | 6 +- .../destructuring/object.sublime-syntax | 6 +- .../object/property.sublime-syntax | 6 +- syntaxes/fjsx15/export.sublime-syntax | 8 +- .../fjsx15/flowtype/interface.sublime-syntax | 2 +- .../fjsx15/flowtype/module.sublime-syntax | 2 +- .../support/jest-arguments.sublime-syntax | 2 +- .../support/react-js-arguments.sublime-syntax | 2 +- .../parameters/content.sublime-syntax | 2 +- .../function/support/body.sublime-syntax | 2 +- .../support/react-js-body.sublime-syntax | 2 +- syntaxes/fjsx15/jsx1.sublime-syntax | 2 +- .../literal/string/template.sublime-syntax | 2 +- .../fjsx15/operator/spread.sublime-syntax | 6 +- .../statement-and-expression.sublime-syntax | 141 ------------------ .../fjsx15/statement/bodied.sublime-syntax | 8 +- .../fjsx15/statement/hanging.sublime-syntax | 8 +- .../fjsx15/statement/header.sublime-syntax | 6 +- syntaxes/fjsx15/type/arguments.sublime-syntax | 2 +- .../type/support/arguments.sublime-syntax | 2 +- syntaxes/naomi.fjsx15.sublime-syntax | 1 - 26 files changed, 50 insertions(+), 192 deletions(-) delete mode 100644 syntaxes/fjsx15/statement-and-expression.sublime-syntax diff --git a/syntaxes/fjsx15/arrow-function/body.sublime-syntax b/syntaxes/fjsx15/arrow-function/body.sublime-syntax index 5ac38dc6..0dc98979 100644 --- a/syntaxes/fjsx15/arrow-function/body.sublime-syntax +++ b/syntaxes/fjsx15/arrow-function/body.sublime-syntax @@ -48,12 +48,12 @@ contexts: pop: true - match: "" push: - - include: statement-and-expression + # - include: statement-and-expression - match: "" pop: true comment: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - statement-and-expression: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + # statement-and-expression: + # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax diff --git a/syntaxes/fjsx15/arrow-function/parameters.sublime-syntax b/syntaxes/fjsx15/arrow-function/parameters.sublime-syntax index 4d8e09b5..a4f19c45 100644 --- a/syntaxes/fjsx15/arrow-function/parameters.sublime-syntax +++ b/syntaxes/fjsx15/arrow-function/parameters.sublime-syntax @@ -81,7 +81,7 @@ contexts: pop: true - match: "" push: - - include: statement-and-expression + # - include: statement-and-expression - match: "" pop: true @@ -107,5 +107,5 @@ contexts: type: - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type.sublime-syntax - statement-and-expression: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + # statement-and-expression: + # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax diff --git a/syntaxes/fjsx15/class/method.sublime-syntax b/syntaxes/fjsx15/class/method.sublime-syntax index c1f675c1..0823c708 100644 --- a/syntaxes/fjsx15/class/method.sublime-syntax +++ b/syntaxes/fjsx15/class/method.sublime-syntax @@ -249,7 +249,7 @@ contexts: push: - match: (?=\s*]) pop: true - - include: statement-and-expression + # - include: statement-and-expression - statement-and-expression: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + # statement-and-expression: + # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax diff --git a/syntaxes/fjsx15/class/property.sublime-syntax b/syntaxes/fjsx15/class/property.sublime-syntax index d61c4315..c8eb690a 100644 --- a/syntaxes/fjsx15/class/property.sublime-syntax +++ b/syntaxes/fjsx15/class/property.sublime-syntax @@ -129,5 +129,5 @@ contexts: terminator: - include: Packages/Naomi/syntaxes/fjsx15/terminator.sublime-syntax - statement-and-expression: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + # statement-and-expression: + # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax diff --git a/syntaxes/fjsx15/decorator/arguments.sublime-syntax b/syntaxes/fjsx15/decorator/arguments.sublime-syntax index f09594e2..4ef49809 100644 --- a/syntaxes/fjsx15/decorator/arguments.sublime-syntax +++ b/syntaxes/fjsx15/decorator/arguments.sublime-syntax @@ -34,6 +34,6 @@ contexts: 1: punctuation.definition.decorator.arguments.js.fjsx15 - match: "" push: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax - match: "" pop: true diff --git a/syntaxes/fjsx15/destructuring/array.sublime-syntax b/syntaxes/fjsx15/destructuring/array.sublime-syntax index 2acd03d3..c2bd9526 100644 --- a/syntaxes/fjsx15/destructuring/array.sublime-syntax +++ b/syntaxes/fjsx15/destructuring/array.sublime-syntax @@ -75,12 +75,12 @@ contexts: pop: true - match: "" push: - - include: statement-and-expression + # - include: statement-and-expression - match: "" pop: true comment: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - statement-and-expression: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + # statement-and-expression: + # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax diff --git a/syntaxes/fjsx15/destructuring/object.sublime-syntax b/syntaxes/fjsx15/destructuring/object.sublime-syntax index 520e988b..1c95685c 100644 --- a/syntaxes/fjsx15/destructuring/object.sublime-syntax +++ b/syntaxes/fjsx15/destructuring/object.sublime-syntax @@ -85,12 +85,12 @@ contexts: pop: true - match: "" push: - - include: statement-and-expression + # - include: statement-and-expression - match: "" pop: true comment: - include: Packages/Naomi/syntaxes/fjsx15/comment.sublime-syntax - statement-and-expression: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + # statement-and-expression: + # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax diff --git a/syntaxes/fjsx15/destructuring/object/property.sublime-syntax b/syntaxes/fjsx15/destructuring/object/property.sublime-syntax index 62952381..a5ab22fe 100644 --- a/syntaxes/fjsx15/destructuring/object/property.sublime-syntax +++ b/syntaxes/fjsx15/destructuring/object/property.sublime-syntax @@ -109,7 +109,7 @@ contexts: push: - match: (?=\s*]) pop: true - - include: statement-and-expression + # - include: statement-and-expression - statement-and-expression: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + # statement-and-expression: + # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax diff --git a/syntaxes/fjsx15/export.sublime-syntax b/syntaxes/fjsx15/export.sublime-syntax index fe12eabe..7b15a674 100644 --- a/syntaxes/fjsx15/export.sublime-syntax +++ b/syntaxes/fjsx15/export.sublime-syntax @@ -128,7 +128,7 @@ contexts: ) captures: 1: keyword.control.export.js.fjsx15 - set: statement-and-expression + # set: statement-and-expression # Export default. - match: | (?x) @@ -139,7 +139,7 @@ contexts: 2: >- storage.modifier.js.fjsx15 keyword.control.export.default.js.fjsx15 - set: statement-and-expression + # set: statement-and-expression # Other. - match: | (?x) @@ -152,8 +152,8 @@ contexts: comment: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - statement-and-expression: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + # statement-and-expression: + # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax object-literal: - include: Packages/Naomi/syntaxes/fjsx15/literal/object.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/interface.sublime-syntax b/syntaxes/fjsx15/flowtype/interface.sublime-syntax index 4ac118ad..03836ff4 100644 --- a/syntaxes/fjsx15/flowtype/interface.sublime-syntax +++ b/syntaxes/fjsx15/flowtype/interface.sublime-syntax @@ -116,7 +116,7 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/flowtype/indexer.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/class/method.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/class/property.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax comment: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/module.sublime-syntax b/syntaxes/fjsx15/flowtype/module.sublime-syntax index e74b1fa8..ae143b51 100644 --- a/syntaxes/fjsx15/flowtype/module.sublime-syntax +++ b/syntaxes/fjsx15/flowtype/module.sublime-syntax @@ -69,7 +69,7 @@ contexts: pop: true - match: "" push: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax - match: "" pop: true diff --git a/syntaxes/fjsx15/function-call/support/jest-arguments.sublime-syntax b/syntaxes/fjsx15/function-call/support/jest-arguments.sublime-syntax index 0f658f33..53b1a15b 100644 --- a/syntaxes/fjsx15/function-call/support/jest-arguments.sublime-syntax +++ b/syntaxes/fjsx15/function-call/support/jest-arguments.sublime-syntax @@ -40,6 +40,6 @@ contexts: punctuation.definition.function.arguments.js.fjsx15 - match: "" push: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax - match: "" pop: true diff --git a/syntaxes/fjsx15/function-call/support/react-js-arguments.sublime-syntax b/syntaxes/fjsx15/function-call/support/react-js-arguments.sublime-syntax index 0f658f33..53b1a15b 100644 --- a/syntaxes/fjsx15/function-call/support/react-js-arguments.sublime-syntax +++ b/syntaxes/fjsx15/function-call/support/react-js-arguments.sublime-syntax @@ -40,6 +40,6 @@ contexts: punctuation.definition.function.arguments.js.fjsx15 - match: "" push: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax - match: "" pop: true diff --git a/syntaxes/fjsx15/function/parameters/content.sublime-syntax b/syntaxes/fjsx15/function/parameters/content.sublime-syntax index 3ae770f3..0b216822 100644 --- a/syntaxes/fjsx15/function/parameters/content.sublime-syntax +++ b/syntaxes/fjsx15/function/parameters/content.sublime-syntax @@ -65,6 +65,6 @@ contexts: pop: true - match: "" push: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax - match: "" pop: true diff --git a/syntaxes/fjsx15/function/support/body.sublime-syntax b/syntaxes/fjsx15/function/support/body.sublime-syntax index dc80c1ea..8a88a7e2 100644 --- a/syntaxes/fjsx15/function/support/body.sublime-syntax +++ b/syntaxes/fjsx15/function/support/body.sublime-syntax @@ -37,5 +37,5 @@ contexts: push: - match: (?=\s*}) pop: true - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax diff --git a/syntaxes/fjsx15/function/support/react-js-body.sublime-syntax b/syntaxes/fjsx15/function/support/react-js-body.sublime-syntax index 3a492346..af8b7fa3 100644 --- a/syntaxes/fjsx15/function/support/react-js-body.sublime-syntax +++ b/syntaxes/fjsx15/function/support/react-js-body.sublime-syntax @@ -37,5 +37,5 @@ contexts: push: - match: (?=\s*}) pop: true - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax diff --git a/syntaxes/fjsx15/jsx1.sublime-syntax b/syntaxes/fjsx15/jsx1.sublime-syntax index 215ed80c..1074959c 100644 --- a/syntaxes/fjsx15/jsx1.sublime-syntax +++ b/syntaxes/fjsx15/jsx1.sublime-syntax @@ -72,6 +72,6 @@ contexts: pop: true - match: "" push: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax - match: "" pop: true diff --git a/syntaxes/fjsx15/literal/string/template.sublime-syntax b/syntaxes/fjsx15/literal/string/template.sublime-syntax index 27649cd1..d6abcc71 100644 --- a/syntaxes/fjsx15/literal/string/template.sublime-syntax +++ b/syntaxes/fjsx15/literal/string/template.sublime-syntax @@ -80,7 +80,7 @@ contexts: push: - match: (?=}) pop: true - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax template-end: - match: \` diff --git a/syntaxes/fjsx15/operator/spread.sublime-syntax b/syntaxes/fjsx15/operator/spread.sublime-syntax index be33bdb1..71d474ab 100644 --- a/syntaxes/fjsx15/operator/spread.sublime-syntax +++ b/syntaxes/fjsx15/operator/spread.sublime-syntax @@ -22,7 +22,7 @@ contexts: - match: \s*(\.{3}) captures: 1: keyword.operator.other.spread.js.fjsx15 - set: statement-and-expression + # set: statement-and-expression - statement-and-expression: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + # statement-and-expression: + # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax diff --git a/syntaxes/fjsx15/statement-and-expression.sublime-syntax b/syntaxes/fjsx15/statement-and-expression.sublime-syntax deleted file mode 100644 index 0d86139f..00000000 --- a/syntaxes/fjsx15/statement-and-expression.sublime-syntax +++ /dev/null @@ -1,141 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - - expressionGroupBegin: | - (? Date: Sun, 3 Dec 2017 18:36:57 -0200 Subject: [PATCH 023/407] [FJSX15] Add basic statements and expressions --- syntaxes/fjsx15/expression.sublime-syntax | 117 ++++++++++++++++++++++ syntaxes/fjsx15/statement.sublime-syntax | 24 +++++ syntaxes/naomi.fjsx15.sublime-syntax | 3 + 3 files changed, 144 insertions(+) create mode 100644 syntaxes/fjsx15/expression.sublime-syntax create mode 100644 syntaxes/fjsx15/statement.sublime-syntax diff --git a/syntaxes/fjsx15/expression.sublime-syntax b/syntaxes/fjsx15/expression.sublime-syntax new file mode 100644 index 00000000..0c1cb47e --- /dev/null +++ b/syntaxes/fjsx15/expression.sublime-syntax @@ -0,0 +1,117 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + expressionGroupBegin: \s*(\() + expressionBegin: (?=\s*\S) + +contexts: + main: + - include: comment-no-pop + - include: Packages/Naomi/syntaxes/fjsx15/operator/assignment.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/terminator.sublime-syntax + - match: "{{expressionGroupBegin}}" + captures: + 1: punctuation.definition.expression.group.a.begin.js.fjsx15 + push: open-b-close-a + # Start of the expression. + - match: "{{expressionBegin}}" + embed: head-tail + escape: (?=\s*;) + + comment-no-pop: + - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax + + comma-no-pop: + - include: Packages/Naomi/syntaxes/fjsx15/operator/comma.no-pop.sublime-syntax + + head-tail: + - match: "" + push: [ + expression-tail, + expression-head + ] + + open-a-close-b: + - include: comment-no-pop + - include: comma-no-pop + # Open new expression group. + - match: "{{expressionGroupBegin}}" + captures: + 1: punctuation.definition.expression.group.a.begin.js.fjsx15 + push: open-b-close-a + # Close the previous expression group. + - match: \s*(\)) + captures: + 1: punctuation.definition.expression.group.b.end.js.fjsx15 + pop: true + # Start of the expression. + - match: "{{expressionBegin}}" + embed: head-tail + escape: (?=\s*;) + + open-b-close-a: + - include: comment-no-pop + - include: comma-no-pop + # Open new expression group. + - match: "{{expressionGroupBegin}}" + captures: + 1: punctuation.definition.expression.group.b.begin.js.fjsx15 + push: open-a-close-b + # Close the previous expression group. + - match: \s*(\)) + captures: + 1: punctuation.definition.expression.group.a.end.js.fjsx15 + pop: true + # Start of the expression. + - match: "{{expressionBegin}}" + embed: head-tail + escape: (?=\s*;) + + expression-head: + - include: comment-no-pop + - include: Packages/Naomi/syntaxes/fjsx15/literal.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/operator/word.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/class.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/function.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/function-call.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/constant.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/variable.sublime-syntax + # Prefix operators. + - match: (?=\s*\S) + push: + - include: comment-no-pop + - include: Packages/Naomi/syntaxes/fjsx15/operator.sublime-syntax + + expression-tail: + - include: comment-no-pop + - include: Packages/Naomi/syntaxes/fjsx15/operator.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax + # Suffix operator. + - match: (?=\s*[\[(]) + push: + - include: comment-no-pop + - include: Packages/Naomi/syntaxes/fjsx15/property-access.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/function-call/arguments.sublime-syntax + # Expression ended. + - match: (?=\s*\S) + pop: true diff --git a/syntaxes/fjsx15/statement.sublime-syntax b/syntaxes/fjsx15/statement.sublime-syntax new file mode 100644 index 00000000..79cfe6e1 --- /dev/null +++ b/syntaxes/fjsx15/statement.sublime-syntax @@ -0,0 +1,24 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +contexts: + main: + - include: Packages/Naomi/syntaxes/fjsx15/class.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/function.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/variable-declaration.sublime-syntax diff --git a/syntaxes/naomi.fjsx15.sublime-syntax b/syntaxes/naomi.fjsx15.sublime-syntax index 0370ef5b..299281b2 100644 --- a/syntaxes/naomi.fjsx15.sublime-syntax +++ b/syntaxes/naomi.fjsx15.sublime-syntax @@ -26,3 +26,6 @@ scope: source.js.fjsx15 contexts: main: + - include: Packages/Naomi/syntaxes/fjsx15/comment.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/statement.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax From 55daf02d1295a98b0b439e8136278d874b6119b8 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 3 Dec 2017 18:37:14 -0200 Subject: [PATCH 024/407] [FJSX15] Simplify variable declaration --- .../variable-declaration.sublime-syntax | 50 ++++--------------- 1 file changed, 10 insertions(+), 40 deletions(-) diff --git a/syntaxes/fjsx15/variable-declaration.sublime-syntax b/syntaxes/fjsx15/variable-declaration.sublime-syntax index b76b1a10..ea226c9b 100644 --- a/syntaxes/fjsx15/variable-declaration.sublime-syntax +++ b/syntaxes/fjsx15/variable-declaration.sublime-syntax @@ -22,49 +22,29 @@ contexts: # Destructuring object. - match: | (?x) - (?=\s* - (?> const - | let - | var - )\s+\{ - ) + (?=\s*(?>const|let|var)\s+\{) set: [ - punctuation, destructuring-object, keyword ] # Destructuring array. - match: | (?x) - (?=\s* - (?> const - | let - | var - )\s+\[ - ) + (?=\s*(?>const|let|var)\s+\[) set: [ - punctuation, destructuring-array, keyword ] # Simple variable. - match: | (?x) - (?=\s* - (?> const - | let - | var - )\s+ - ) + (?=\s*(?>const|let|var)\s+) set: [ - punctuation, + optional-type, variable-or-constant, keyword ] - comment: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - destructuring-object: - include: Packages/Naomi/syntaxes/fjsx15/destructuring/object.sublime-syntax @@ -72,15 +52,10 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/destructuring/array.sublime-syntax keyword: - - include: comment + - include: comment-no-pop - match: | (?x)\s* - ( - (?> const - | let - | var - ) - ) + ((?>const|let|var)) captures: 1: >- storage.type.js.fjsx15 @@ -92,13 +67,8 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/constant.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/variable.sublime-syntax - punctuation: - - include: comment - - match: (?=\s*:) - set: type - - match: "" - pop: true - - type: - - include: comment + optional-type: + - include: comment-no-pop - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax + - match: (?=\s*\S) + pop: true From ef1388c7dec47b2d831cd842461b818058b1a324 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 3 Dec 2017 18:37:55 -0200 Subject: [PATCH 025/407] [FJSX15] Simplify operators --- syntaxes/fjsx15/operator.sublime-syntax | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/syntaxes/fjsx15/operator.sublime-syntax b/syntaxes/fjsx15/operator.sublime-syntax index 8aaa7c10..bfe40297 100644 --- a/syntaxes/fjsx15/operator.sublime-syntax +++ b/syntaxes/fjsx15/operator.sublime-syntax @@ -19,14 +19,12 @@ scope: ... contexts: main: - - include: Packages/Naomi/syntaxes/fjsx15/operator/comma.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/operator/pipe.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/operator/spread.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/operator/arithmetic.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/operator/bitwise.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/comparison.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/operator/assignment.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/operator/shebang.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/operator/relational.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/operator/other.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/logical.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/operator/bitwise.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/operator/arithmetic.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/operator/other.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/operator/pipe.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/operator/relational.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/operator/shebang.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/operator/spread.sublime-syntax From 6bf9b23b51ee0ef850653305f599bdbf828fc591 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 3 Dec 2017 18:38:14 -0200 Subject: [PATCH 026/407] [FJSX15] Sort literals --- syntaxes/fjsx15/literal.sublime-syntax | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/syntaxes/fjsx15/literal.sublime-syntax b/syntaxes/fjsx15/literal.sublime-syntax index 211dff4b..818dabae 100644 --- a/syntaxes/fjsx15/literal.sublime-syntax +++ b/syntaxes/fjsx15/literal.sublime-syntax @@ -19,10 +19,10 @@ scope: ... contexts: main: + - include: Packages/Naomi/syntaxes/fjsx15/literal/number.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/literal/array.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/literal/object.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/guarded-regex.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/literal/string/template.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/number.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/literal/string/regex.sublime-syntax From 2f48718484b35c223655b24c994bd988b1371602 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 3 Dec 2017 18:39:55 -0200 Subject: [PATCH 027/407] [FJSX15] Remove old loop --- syntaxes/fjsx15/class/body.sublime-syntax | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/class/body.sublime-syntax b/syntaxes/fjsx15/class/body.sublime-syntax index 04596f7e..cc9ff610 100644 --- a/syntaxes/fjsx15/class/body.sublime-syntax +++ b/syntaxes/fjsx15/class/body.sublime-syntax @@ -68,7 +68,7 @@ contexts: # Class variables. - include: Packages/Naomi/syntaxes/fjsx15/class/property.sublime-syntax # Any other statement or expression. - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax - match: "" pop: true From af6acf5c3e0279bf1c46b43b37e8c1d75f54c023 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 3 Dec 2017 18:41:10 -0200 Subject: [PATCH 028/407] [FJSX15] Revert property access expectation --- syntaxes/fjsx15/class/body.sublime-syntax | 9 +------- syntaxes/fjsx15/constant.sublime-syntax | 7 +----- syntaxes/fjsx15/function/body.sublime-syntax | 11 ++-------- syntaxes/fjsx15/literal/number.sublime-syntax | 22 +++++-------------- syntaxes/fjsx15/variable.sublime-syntax | 9 ++------ 5 files changed, 11 insertions(+), 47 deletions(-) diff --git a/syntaxes/fjsx15/class/body.sublime-syntax b/syntaxes/fjsx15/class/body.sublime-syntax index cc9ff610..5cbc620b 100644 --- a/syntaxes/fjsx15/class/body.sublime-syntax +++ b/syntaxes/fjsx15/class/body.sublime-syntax @@ -25,19 +25,12 @@ contexts: 1: punctuation.definition.class.body.begin.js.fjsx15 set: body - optional-property-access-or-regex: - - include: Packages/Naomi/syntaxes/fjsx15/comment.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/property-access.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/regex.sublime-syntax - - match: (?=\S) - pop: true - body: - include: comment - match: \s*(}) captures: 1: punctuation.definition.class.body.end.js.fjsx15 - set: optional-property-access-or-regex + pop: true - match: "" push: # This is necessary because normally these instance variables would be diff --git a/syntaxes/fjsx15/constant.sublime-syntax b/syntaxes/fjsx15/constant.sublime-syntax index 384fd685..339d500d 100644 --- a/syntaxes/fjsx15/constant.sublime-syntax +++ b/syntaxes/fjsx15/constant.sublime-syntax @@ -34,7 +34,7 @@ contexts: storage.modifier.js.fjsx15 keyword.operator.other.access.js.fjsx15 2: entity.name.constant.js.fjsx15 - set: optional-property-access + pop: true # Two or more characters. - match: | (?x)\s* @@ -50,9 +50,4 @@ contexts: storage.modifier.js.fjsx15 keyword.operator.other.access.js.fjsx15 2: entity.name.constant.js.fjsx15 - set: optional-property-access - - optional-property-access: - - include: Packages/Naomi/syntaxes/fjsx15/property-access.sublime-syntax - - match: (?=\S) pop: true diff --git a/syntaxes/fjsx15/function/body.sublime-syntax b/syntaxes/fjsx15/function/body.sublime-syntax index d092a91d..93284a00 100644 --- a/syntaxes/fjsx15/function/body.sublime-syntax +++ b/syntaxes/fjsx15/function/body.sublime-syntax @@ -28,16 +28,9 @@ contexts: - match: \s*(}) captures: 1: punctuation.definition.function.body.end.js.fjsx15 - set: optional-property-access-or-regex + pop: true - match: "" push: - match: (?=\s*}) pop: true - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax - - optional-property-access-or-regex: - - include: Packages/Naomi/syntaxes/fjsx15/comment.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/property-access.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/regex.sublime-syntax - - match: (?=\S) - pop: true + # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax diff --git a/syntaxes/fjsx15/literal/number.sublime-syntax b/syntaxes/fjsx15/literal/number.sublime-syntax index 56337a13..9941241d 100644 --- a/syntaxes/fjsx15/literal/number.sublime-syntax +++ b/syntaxes/fjsx15/literal/number.sublime-syntax @@ -44,38 +44,26 @@ contexts: - match: (?xi)\s*({{scientificNotation}}) captures: 1: constant.numeric.float.scientific.js.fjsx15 - set: optional-property-access-or-operator + pop: true - match: (?x)\s*({{literalFloat}}) captures: 1: constant.numeric.float.js.fjsx15 - set: optional-property-access-or-operator + pop: true integer: - match: \s*(0[bB][01_]+) captures: 1: constant.numeric.binary.js.fjsx15 - set: optional-property-access-or-operator + pop: true - match: \s*(0[oO][0-7]+) captures: 1: constant.numeric.octal.js.fjsx15 - set: optional-property-access-or-operator + pop: true - match: (?i)\s*(0[xX][0-9a-f_]+) captures: 1: constant.numeric.hex.js.fjsx15 - set: optional-property-access-or-operator + pop: true - match: \s*([1-9][0-9_]*|0) captures: 1: constant.numeric.decimal.js.fjsx15 - set: optional-property-access-or-operator - - optional-property-access-or-operator: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/property-access.sublime-syntax - # Comma operators are usually used to delimit arguments. - - match: (?=\s*\,) - pop: true - # Other operators. - - include: Packages/Naomi/syntaxes/fjsx15/operator.sublime-syntax - # Anything else. - - match: (?=\S) pop: true diff --git a/syntaxes/fjsx15/variable.sublime-syntax b/syntaxes/fjsx15/variable.sublime-syntax index 521b3e87..02ab64b7 100644 --- a/syntaxes/fjsx15/variable.sublime-syntax +++ b/syntaxes/fjsx15/variable.sublime-syntax @@ -40,7 +40,7 @@ contexts: storage.modifier.js.fjsx15 keyword.operator.other.access.js.fjsx15 2: entity.name.variable.js.fjsx15 - set: optional-property-access + pop: true # Two or more characters. - match: | (?xi)\s* @@ -56,7 +56,7 @@ contexts: storage.modifier.js.fjsx15 keyword.operator.other.access.js.fjsx15 2: entity.name.variable.js.fjsx15 - set: optional-property-access + pop: true support-variable: - match: | @@ -68,9 +68,4 @@ contexts: 1: >- support.js.fjsx15 entity.name.variable.js.fjsx15 - set: optional-property-access - - optional-property-access: - - include: Packages/Naomi/syntaxes/fjsx15/property-access.sublime-syntax - - match: (?=\S) pop: true From 35d95193600c2fc76063f9b46fb63197f81570bf Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 3 Dec 2017 18:43:20 -0200 Subject: [PATCH 029/407] [FJSX15] Disable old loop --- syntaxes/fjsx15/operator/pipe.sublime-syntax | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/operator/pipe.sublime-syntax b/syntaxes/fjsx15/operator/pipe.sublime-syntax index 5acc13f6..d8b2a7fe 100644 --- a/syntaxes/fjsx15/operator/pipe.sublime-syntax +++ b/syntaxes/fjsx15/operator/pipe.sublime-syntax @@ -46,5 +46,5 @@ contexts: 1: entity.name.function.js.fjsx15 pop: true # Other expressions. - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax From 3d03e1335ecfd0f8acef7a8ae660c08e73a7b2f2 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 3 Dec 2017 18:54:01 -0200 Subject: [PATCH 030/407] [FJSX15] Rename comma file --- .../{comma.sublime-syntax => comma.no-pop.sublime-syntax} | 4 ---- 1 file changed, 4 deletions(-) rename syntaxes/fjsx15/operator/{comma.sublime-syntax => comma.no-pop.sublime-syntax} (82%) diff --git a/syntaxes/fjsx15/operator/comma.sublime-syntax b/syntaxes/fjsx15/operator/comma.no-pop.sublime-syntax similarity index 82% rename from syntaxes/fjsx15/operator/comma.sublime-syntax rename to syntaxes/fjsx15/operator/comma.no-pop.sublime-syntax index 5833627d..3e279237 100644 --- a/syntaxes/fjsx15/operator/comma.sublime-syntax +++ b/syntaxes/fjsx15/operator/comma.no-pop.sublime-syntax @@ -22,7 +22,3 @@ contexts: - match: \s*(,) captures: 1: keyword.operator.other.comma.js.fjsx15 - set: statement-and-expression - - statement-and-expression: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax From 0f54c39f506be921cca6dc394271082fca598c40 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 3 Dec 2017 18:54:28 -0200 Subject: [PATCH 031/407] [FJSX15] Extract word operators and disable ternary --- syntaxes/fjsx15/operator/other.sublime-syntax | 86 ++++++++----------- .../operator/word.no-pop.sublime-syntax | 33 +++++++ 2 files changed, 69 insertions(+), 50 deletions(-) create mode 100644 syntaxes/fjsx15/operator/word.no-pop.sublime-syntax diff --git a/syntaxes/fjsx15/operator/other.sublime-syntax b/syntaxes/fjsx15/operator/other.sublime-syntax index 74974859..40b02627 100644 --- a/syntaxes/fjsx15/operator/other.sublime-syntax +++ b/syntaxes/fjsx15/operator/other.sublime-syntax @@ -20,8 +20,6 @@ scope: ... contexts: # | Operator | Description | # |:----------:|:--------------------| - # | typeof | | - # | void | | # | ... | Spread. | # | :: | Bind. | # | . | Member access. | @@ -29,18 +27,6 @@ contexts: # | ?? | Nullish coalescing. | # | ? | Ternary. | main: - - match: \s*(typeof)\b - captures: - 1: >- - word.js.fjsx15 - keyword.operator.other.js.fjsx15 - pop: true - - match: \s*(void)\b - captures: - 1: >- - word.js.fjsx15 - keyword.operator.other.void.js.fjsx15 - pop: true - match: \s*(\:{2}) captures: 1: keyword.operator.other.bind.js.fjsx15 @@ -52,45 +38,45 @@ contexts: - match: \s*(\?\.) captures: 1: keyword.operator.other.optional-chain.js.fjsx15 - set: member-access - - match: \s*(\?) - captures: - 1: keyword.operator.other.ternary.js.fjsx15 - set: ternary-condition + pop: true - match: \s*(\.) captures: 1: keyword.operator.other.member-access.js.fjsx15 - set: member-access + pop: true + # - match: \s*(\?) + # captures: + # 1: keyword.operator.other.ternary.js.fjsx15 + # set: ternary-condition - comment: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax + # comment: + # - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - ternary-condition: - - match: \s*(:) - captures: - 1: keyword.operator.other.ternary.js.fjsx15 - pop: true - - match: "" - push: - - match: (?=\s*:) - pop: true - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + # ternary-condition: + # - match: \s*(:) + # captures: + # 1: keyword.operator.other.ternary.js.fjsx15 + # pop: true + # - match: "" + # push: + # - match: (?=\s*:) + # pop: true + # # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax - member-access: - - include: comment - # Jest “not”. - - match: | - (?x) - \s*(not\b) - (?=\s*\.) - captures: - 1: >- - support.lib.jest.fjsx15 - entity.name.function.js.fjsx15 - pop: true - # Other members. - - include: Packages/Naomi/syntaxes/fjsx15/arrow-function.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/jest.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/function-call.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/constant.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/variable.sublime-syntax + # member-access: + # - include: comment + # # Jest “not”. + # - match: | + # (?x) + # \s*(not\b) + # (?=\s*\.) + # captures: + # 1: >- + # support.lib.jest.fjsx15 + # entity.name.function.js.fjsx15 + # pop: true + # # Other members. + # - include: Packages/Naomi/syntaxes/fjsx15/arrow-function.sublime-syntax + # - include: Packages/Naomi/syntaxes/fjsx15/jest.sublime-syntax + # - include: Packages/Naomi/syntaxes/fjsx15/function-call.sublime-syntax + # - include: Packages/Naomi/syntaxes/fjsx15/constant.sublime-syntax + # - include: Packages/Naomi/syntaxes/fjsx15/variable.sublime-syntax diff --git a/syntaxes/fjsx15/operator/word.no-pop.sublime-syntax b/syntaxes/fjsx15/operator/word.no-pop.sublime-syntax new file mode 100644 index 00000000..48444682 --- /dev/null +++ b/syntaxes/fjsx15/operator/word.no-pop.sublime-syntax @@ -0,0 +1,33 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +contexts: + main: + - match: \s*(typeof)\b + captures: + 1: >- + word.js.fjsx15 + keyword.operator.other.js.fjsx15 + pop: true + - match: \s*(void)\b + captures: + 1: >- + word.js.fjsx15 + keyword.operator.other.void.js.fjsx15 + pop: true From da84de9e3fd6ac051de4a76d1c314e116bb53c1d Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 3 Dec 2017 18:55:57 -0200 Subject: [PATCH 032/407] [FJSX15] Simplify --- syntaxes/fjsx15/comment.no-pop.sublime-syntax | 8 +---- syntaxes/fjsx15/function-call.sublime-syntax | 32 ++++++++++--------- syntaxes/fjsx15/literal/array.sublime-syntax | 8 +---- .../fjsx15/property-access.sublime-syntax | 5 +-- 4 files changed, 20 insertions(+), 33 deletions(-) diff --git a/syntaxes/fjsx15/comment.no-pop.sublime-syntax b/syntaxes/fjsx15/comment.no-pop.sublime-syntax index d7fb1c45..2c260ddb 100644 --- a/syntaxes/fjsx15/comment.no-pop.sublime-syntax +++ b/syntaxes/fjsx15/comment.no-pop.sublime-syntax @@ -19,12 +19,6 @@ scope: ... contexts: main: - - match: | - (?x) - (?=\s*/ - (?> / - | \* - ) - ) + - match: (?=\s*/(?>/|\*)) push: - include: Packages/Naomi/syntaxes/fjsx15/comment.sublime-syntax diff --git a/syntaxes/fjsx15/function-call.sublime-syntax b/syntaxes/fjsx15/function-call.sublime-syntax index 15f2c895..808f16c5 100644 --- a/syntaxes/fjsx15/function-call.sublime-syntax +++ b/syntaxes/fjsx15/function-call.sublime-syntax @@ -31,12 +31,6 @@ variables: contexts: main: - # Function call at the result of an expression. - - match: | - (?x) - (?<=\)|]|}|"|'|`) - (?=\s*\() - set: optional-chain-and-arguments # Template function. - match: | (?xi) @@ -58,6 +52,8 @@ contexts: \s*\( ) set: modifier-and-name + # Function call near expression. + - include: function-arguments modifier-and-name: # Private modifier. @@ -74,6 +70,7 @@ contexts: ))\b captures: 1: >- + call.js.fjsx15 support.js.fjsx15 entity.name.function.js.fjsx15 set: [ @@ -85,7 +82,9 @@ contexts: (?xi) \s*({{commonIdentifier}}) captures: - 1: entity.name.function.js.fjsx15 + 1: >- + call.js.fjsx + entity.name.function.js.fjsx15 set: [ optional-chain-and-arguments, possible-template-arguments @@ -97,17 +96,20 @@ contexts: pop: true optional-chain-and-arguments: - # Optional chain operator. - - match: \s*(\?\.) - captures: - 1: keyword.operator.other.optional-chain.js.fjsx15 - # Actual arguments. - - include: Packages/Naomi/syntaxes/fjsx15/function-call/arguments.sublime-syntax + - include: optional-chain-operator + - include: function-arguments optional-chain-and-support-arguments: - # Optional chain operator. + - include: optional-chain-operator + - include: support-function-arguments + + optional-chain-operator: - match: \s*(\?\.) captures: 1: keyword.operator.other.optional-chain.js.fjsx15 - # Actual arguments. + + function-arguments: + - include: Packages/Naomi/syntaxes/fjsx15/function-call/arguments.sublime-syntax + + support-function-arguments: - include: Packages/Naomi/syntaxes/fjsx15/function-call/support/arguments.sublime-syntax diff --git a/syntaxes/fjsx15/literal/array.sublime-syntax b/syntaxes/fjsx15/literal/array.sublime-syntax index 9fdc2426..136efcb8 100644 --- a/syntaxes/fjsx15/literal/array.sublime-syntax +++ b/syntaxes/fjsx15/literal/array.sublime-syntax @@ -19,13 +19,7 @@ scope: ... contexts: main: - - match: | - (?x) - \s*(\[) - (?! - [^;]*?] - \s*=[^=] - ) + - match: \s*(\[) captures: 1: punctuation.definition.array.begin.js.fjsx15 set: items diff --git a/syntaxes/fjsx15/property-access.sublime-syntax b/syntaxes/fjsx15/property-access.sublime-syntax index f09cc8ba..4e371aa2 100644 --- a/syntaxes/fjsx15/property-access.sublime-syntax +++ b/syntaxes/fjsx15/property-access.sublime-syntax @@ -19,10 +19,7 @@ scope: ... contexts: main: - - match: | - (?x) - (? Date: Sun, 3 Dec 2017 18:56:46 -0200 Subject: [PATCH 033/407] [FJSX15] Link to new expression loop --- .../fjsx15/function-call/arguments.sublime-syntax | 6 +----- .../function-call/support/arguments.sublime-syntax | 7 ++----- syntaxes/fjsx15/literal/array.sublime-syntax | 9 +-------- syntaxes/fjsx15/operator/assignment.sublime-syntax | 6 +++--- syntaxes/fjsx15/property-access.sublime-syntax | 14 ++++++++------ 5 files changed, 15 insertions(+), 27 deletions(-) diff --git a/syntaxes/fjsx15/function-call/arguments.sublime-syntax b/syntaxes/fjsx15/function-call/arguments.sublime-syntax index a01bac49..9bc6f0c4 100644 --- a/syntaxes/fjsx15/function-call/arguments.sublime-syntax +++ b/syntaxes/fjsx15/function-call/arguments.sublime-syntax @@ -32,8 +32,4 @@ contexts: - match: \s*(,) captures: 1: punctuation.definition.function.arguments.js.fjsx15 - - match: "" - push: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax - - match: "" - pop: true + - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax diff --git a/syntaxes/fjsx15/function-call/support/arguments.sublime-syntax b/syntaxes/fjsx15/function-call/support/arguments.sublime-syntax index 9b2d6c61..962f14fc 100644 --- a/syntaxes/fjsx15/function-call/support/arguments.sublime-syntax +++ b/syntaxes/fjsx15/function-call/support/arguments.sublime-syntax @@ -38,8 +38,5 @@ contexts: 1: >- support.core.js.fjsx15 punctuation.definition.function.arguments.js.fjsx15 - - match: "" - push: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax - - match: "" - pop: true + - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax + diff --git a/syntaxes/fjsx15/literal/array.sublime-syntax b/syntaxes/fjsx15/literal/array.sublime-syntax index 136efcb8..9b86252b 100644 --- a/syntaxes/fjsx15/literal/array.sublime-syntax +++ b/syntaxes/fjsx15/literal/array.sublime-syntax @@ -28,15 +28,8 @@ contexts: - match: \s*(,) captures: 1: punctuation.definition.array.js.fjsx15 - - include: end - - match: "" - push: - - match: (?=\s*(?>,|])) - pop: true - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax - - end: - match: \s*(]) captures: 1: punctuation.definition.array.end.js.fjsx15 pop: true + - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax diff --git a/syntaxes/fjsx15/operator/assignment.sublime-syntax b/syntaxes/fjsx15/operator/assignment.sublime-syntax index 2a92f5e3..8839431f 100644 --- a/syntaxes/fjsx15/operator/assignment.sublime-syntax +++ b/syntaxes/fjsx15/operator/assignment.sublime-syntax @@ -22,7 +22,7 @@ contexts: - match: \s*(=) captures: 1: keyword.operator.other.assignment.js.fjsx15 - set: statement-and-expression + set: expression - statement-and-expression: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + expression: + - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax diff --git a/syntaxes/fjsx15/property-access.sublime-syntax b/syntaxes/fjsx15/property-access.sublime-syntax index 4e371aa2..7600574b 100644 --- a/syntaxes/fjsx15/property-access.sublime-syntax +++ b/syntaxes/fjsx15/property-access.sublime-syntax @@ -28,9 +28,11 @@ contexts: - match: \s*(]) captures: 1: punctuation.definition.property.access.end.js.fjsx15a - pop: true - - match: "" - push: - - match: (?=\s*]) - pop: true - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + set: expression-tail + - include: expression + + expression: + - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax + + expression-tail: + - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax#expression-tail From f773006f4c4a7f7a0aec09c54f38a7803ffd47a6 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 3 Dec 2017 18:57:24 -0200 Subject: [PATCH 034/407] [FJSX15] Fix typo --- syntaxes/fjsx15/literal/string/regex.sublime-syntax | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/syntaxes/fjsx15/literal/string/regex.sublime-syntax b/syntaxes/fjsx15/literal/string/regex.sublime-syntax index d538dbb9..1e74200c 100644 --- a/syntaxes/fjsx15/literal/string/regex.sublime-syntax +++ b/syntaxes/fjsx15/literal/string/regex.sublime-syntax @@ -57,7 +57,7 @@ contexts: - match: \\. scope: constant.character.escape.a.js.fjsx15 set: escape-b - # If the slash was not consumed before, it probably is the end of the regex. + # If the slash was not consumed before, it is probably the end of the regex. - include: regex-end escape-b: @@ -65,5 +65,5 @@ contexts: - match: \\. scope: constant.character.escape.b.js.fjsx15 set: escape-a - # If the slash was not consumed before, it probably is the end of the regex. + # If the slash was not consumed before, it is probably the end of the regex. - include: regex-end From 40e3dfafe2eea560f6bfdccf76531623446fd0a2 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 3 Dec 2017 18:58:25 -0200 Subject: [PATCH 035/407] [FJSX15] Simplify regex --- .../fjsx15/literal/string/regex.sublime-syntax | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/syntaxes/fjsx15/literal/string/regex.sublime-syntax b/syntaxes/fjsx15/literal/string/regex.sublime-syntax index 1e74200c..10383e62 100644 --- a/syntaxes/fjsx15/literal/string/regex.sublime-syntax +++ b/syntaxes/fjsx15/literal/string/regex.sublime-syntax @@ -19,15 +19,6 @@ scope: ... contexts: main: - # Regex literals are a bit hard to predict and there are some cases where - # this pattern will fail, for example: - # - # if (something) /regex/.exec(x); - # - # It’s impossible to know that the closing parenthesis is closing the - # statement’s header, that would only be possible with a parser. - # - # http://stackoverflow.com/questions/5519596/when-parsing-javascript-what-determines-the-meaning-of-a-slash - match: | (?x) \s*/ @@ -42,10 +33,7 @@ contexts: set: escape-a regex-end: - - match: | - (?x) - (/) - ([a-z]{0,5}) + - match: (/)([a-z]{0,5}) captures: 0: string.unquoted.regex.js.fjsx15 1: punctuation.definition.string.end.js.fjsx15 From 331ee0aa726da1923a677c27231ef666448b1600 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 3 Dec 2017 21:18:13 -0200 Subject: [PATCH 036/407] [FJSX15] Fix main loop context --- syntaxes/fjsx15/expression.sublime-syntax | 26 +++++++++++------------ 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/syntaxes/fjsx15/expression.sublime-syntax b/syntaxes/fjsx15/expression.sublime-syntax index 0c1cb47e..890e2831 100644 --- a/syntaxes/fjsx15/expression.sublime-syntax +++ b/syntaxes/fjsx15/expression.sublime-syntax @@ -27,6 +27,7 @@ variables: contexts: main: - include: comment-no-pop + - include: comma-no-pop - include: Packages/Naomi/syntaxes/fjsx15/operator/assignment.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/terminator.sublime-syntax - match: "{{expressionGroupBegin}}" @@ -35,8 +36,10 @@ contexts: push: open-b-close-a # Start of the expression. - match: "{{expressionBegin}}" - embed: head-tail - escape: (?=\s*;) + push: [ + expression-tail, + expression-head + ] comment-no-pop: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax @@ -44,13 +47,6 @@ contexts: comma-no-pop: - include: Packages/Naomi/syntaxes/fjsx15/operator/comma.no-pop.sublime-syntax - head-tail: - - match: "" - push: [ - expression-tail, - expression-head - ] - open-a-close-b: - include: comment-no-pop - include: comma-no-pop @@ -66,8 +62,10 @@ contexts: pop: true # Start of the expression. - match: "{{expressionBegin}}" - embed: head-tail - escape: (?=\s*;) + push: [ + expression-tail, + expression-head + ] open-b-close-a: - include: comment-no-pop @@ -84,8 +82,10 @@ contexts: pop: true # Start of the expression. - match: "{{expressionBegin}}" - embed: head-tail - escape: (?=\s*;) + push: [ + expression-tail, + expression-head + ] expression-head: - include: comment-no-pop From df789c5e0a689b9debb54a64b5708ecb9796eb4a Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 3 Dec 2017 21:19:05 -0200 Subject: [PATCH 037/407] [FJSX15] Remove state from property access --- syntaxes/fjsx15/property-access.sublime-syntax | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/syntaxes/fjsx15/property-access.sublime-syntax b/syntaxes/fjsx15/property-access.sublime-syntax index 7600574b..50490818 100644 --- a/syntaxes/fjsx15/property-access.sublime-syntax +++ b/syntaxes/fjsx15/property-access.sublime-syntax @@ -28,11 +28,8 @@ contexts: - match: \s*(]) captures: 1: punctuation.definition.property.access.end.js.fjsx15a - set: expression-tail + pop: true - include: expression expression: - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax - - expression-tail: - - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax#expression-tail From c0d28b62e69687d145d8dafe9f88dff1a808181d Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 3 Dec 2017 21:19:34 -0200 Subject: [PATCH 038/407] [FJSX15] Disable object literal parts --- syntaxes/fjsx15/literal/object.sublime-syntax | 88 ++++++++----------- .../literal/object/property.sublime-syntax | 81 +++++++++-------- 2 files changed, 80 insertions(+), 89 deletions(-) diff --git a/syntaxes/fjsx15/literal/object.sublime-syntax b/syntaxes/fjsx15/literal/object.sublime-syntax index 08df41bf..869e4128 100644 --- a/syntaxes/fjsx15/literal/object.sublime-syntax +++ b/syntaxes/fjsx15/literal/object.sublime-syntax @@ -28,24 +28,10 @@ variables: contexts: main: - # Empty object literal. - - match: | - (?x)\s* - ({)\s*(}) - captures: - 1: punctuation.definition.object.begin.js.fjsx15 - 2: punctuation.definition.object.end.js.fjsx15 - set: optional-property-access - # Normal object literal. - match: \s*({) scope: punctuation.definition.object.begin.js.fjsx15 set: declaration - optional-property-access: - - include: Packages/Naomi/syntaxes/fjsx15/property-access.sublime-syntax - - match: (?=\S) - pop: true - declaration: - match: \s*(,) captures: @@ -54,42 +40,40 @@ contexts: captures: 1: punctuation.definition.object.end.js.fjsx15 pop: true - - match: "" - push: - - match: | - (?x) - (?=\s* - (?> , - | } - ) - ) - pop: true - - include: comment - - include: spread-operator - # Associated value. - - match: \s*(:) - scope: >- - object.js.fjsx15 - keyword.operator.other.association.js.fjsx15 - set: associated-value - # Decorators. - - include: Packages/Naomi/syntaxes/fjsx15/decorator.sublime-syntax - # Methods. - - include: Packages/Naomi/syntaxes/fjsx15/class/method.sublime-syntax - # Simple constant. - - match: | - (?x)\s* - (?={{constantIdentifier}}\s*(?>,|}|$)) - set: constant - # Simple variable. - - match: | - (?xi)\s* - (?={{commonIdentifier}}\s*(?>,|}|$)) - set: variable - # Property. - - include: Packages/Naomi/syntaxes/fjsx15/literal/object/property.sublime-syntax - # Other expressions. - - include: statement-and-expression + # Simple constant. + - match: | + (?x)\s* + (?={{constantIdentifier}}\s*(?>,|}|$)) + push: constant + # Simple variable. + - match: | + (?xi)\s* + (?={{commonIdentifier}}\s*(?>,|}|$)) + push: variable + # Property. + - include: Packages/Naomi/syntaxes/fjsx15/literal/object/property.sublime-syntax + + # - match: "" + # push: + # - match: (?=\s*(?>,|})) + # pop: true + # - include: comment + # - include: spread-operator + # # Associated value. + # - match: \s*(:) + # scope: >- + # object.js.fjsx15 + # keyword.operator.other.association.js.fjsx15 + # set: associated-value + # # Decorators. + # - include: Packages/Naomi/syntaxes/fjsx15/decorator.sublime-syntax + # # Methods. + # - include: Packages/Naomi/syntaxes/fjsx15/class/method.sublime-syntax + + # # Property. + # - include: Packages/Naomi/syntaxes/fjsx15/literal/object/property.sublime-syntax + # # Other expressions. + # - include: statement-and-expression associated-value: - match: | @@ -109,7 +93,9 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/operator/spread.sublime-syntax statement-and-expression: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + - match: lol + scope: lol + # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax constant: - include: Packages/Naomi/syntaxes/fjsx15/constant.sublime-syntax diff --git a/syntaxes/fjsx15/literal/object/property.sublime-syntax b/syntaxes/fjsx15/literal/object/property.sublime-syntax index 3a50d346..d055b001 100644 --- a/syntaxes/fjsx15/literal/object/property.sublime-syntax +++ b/syntaxes/fjsx15/literal/object/property.sublime-syntax @@ -28,16 +28,30 @@ variables: contexts: main: - - include: constant + # # Computed property name. + # - match: \s*(\[) + # captures: + # 1: punctuation.definition.object.computed-property.begin.js.fjsx15 + # push: [ + # associated-value, + # computed-property + # ] + # # Other property formats. + # - include: string + # - include: constant - include: variable - # String property name. - - match: (?=\s*(?>'|"|`)) - set: string - # Computed property name. - - match: \s*(\[) + + computed-property: + - match: \s*(\]) captures: - 1: punctuation.definition.object.computed-property.begin.js.fjsx15 - set: computed-property + 1: punctuation.definition.object.computed-property.end.js.fjsx15 + pop: true + - include: expression + + string: + - include: Packages/Naomi/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/literal/string/template.sublime-syntax constant: # Single character. @@ -48,7 +62,7 @@ contexts: 1: >- object.property.js.fjsx15 entity.name.constant.js.fjsx15 - pop: true + push: associated-value # Two or more characters. - match: | (?x)\s* @@ -62,20 +76,20 @@ contexts: 1: >- object.property.js.fjsx15 entity.name.constant.js.fjsx15 - pop: true + push: associated-value variable: # Single character. - - match: | - (?xi)\s* - ((?> \$\B - | [_[:alpha:]]\b - )) - captures: - 1: >- - object.property.js.fjsx15 - entity.name.variable.js.fjsx15 - pop: true + # - match: | + # (?xi)\s* + # ((?> \$\B + # | [_[:alpha:]]\b + # )) + # captures: + # 1: >- + # object.property.js.fjsx15 + # entity.name.variable.js.fjsx15 + # push: associated-value # Two or more characters. - match: | (?xi)\s* @@ -89,23 +103,14 @@ contexts: 1: >- object.property.js.fjsx15 entity.name.variable.js.fjsx15 - pop: true + push: associated-value - string: - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/template.sublime-syntax - - computed-property: - - match: \s*(\]) - captures: - 1: punctuation.definition.object.computed-property.end.js.fjsx15 - pop: true - - match: "" - push: - - match: (?=\s*]) - pop: true - - include: statement-and-expression + expression: + - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax - statement-and-expression: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + associated-value: + - match: \s*(:) + scope: >- + object.js.fjsx15 + keyword.operator.other.association.js.fjsx15 + set: expression From e81a6827bc18122d7500c167dbd32b48ad4b1ae4 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 4 Dec 2017 08:52:31 -0200 Subject: [PATCH 039/407] [FJSX15] Link operators to expression --- syntaxes/fjsx15/operator/arithmetic.sublime-syntax | 5 ++++- syntaxes/fjsx15/operator/bitwise.sublime-syntax | 5 ++++- syntaxes/fjsx15/operator/comparison.sublime-syntax | 5 ++++- syntaxes/fjsx15/operator/logical.sublime-syntax | 5 ++++- syntaxes/fjsx15/operator/pipe.sublime-syntax | 2 +- syntaxes/fjsx15/operator/relational.sublime-syntax | 5 ++++- syntaxes/fjsx15/operator/spread.sublime-syntax | 6 +++--- syntaxes/fjsx15/operator/word.no-pop.sublime-syntax | 7 +++++-- 8 files changed, 29 insertions(+), 11 deletions(-) diff --git a/syntaxes/fjsx15/operator/arithmetic.sublime-syntax b/syntaxes/fjsx15/operator/arithmetic.sublime-syntax index 5fed0924..9891c0c1 100644 --- a/syntaxes/fjsx15/operator/arithmetic.sublime-syntax +++ b/syntaxes/fjsx15/operator/arithmetic.sublime-syntax @@ -47,4 +47,7 @@ contexts: ) captures: 1: keyword.operator.arithmetic.js.fjsx15 - pop: true + set: expression + + expression: + - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax diff --git a/syntaxes/fjsx15/operator/bitwise.sublime-syntax b/syntaxes/fjsx15/operator/bitwise.sublime-syntax index d664f0d5..36dfba36 100644 --- a/syntaxes/fjsx15/operator/bitwise.sublime-syntax +++ b/syntaxes/fjsx15/operator/bitwise.sublime-syntax @@ -49,4 +49,7 @@ contexts: ) captures: 1: keyword.operator.bitwise.js.fjsx15 - pop: true + set: expression + + expression: + - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax diff --git a/syntaxes/fjsx15/operator/comparison.sublime-syntax b/syntaxes/fjsx15/operator/comparison.sublime-syntax index 9fbd58ed..a5291935 100644 --- a/syntaxes/fjsx15/operator/comparison.sublime-syntax +++ b/syntaxes/fjsx15/operator/comparison.sublime-syntax @@ -42,4 +42,7 @@ contexts: ) captures: 1: keyword.operator.comparison.js.fjsx15 - pop: true + set: expression + + expression: + - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax diff --git a/syntaxes/fjsx15/operator/logical.sublime-syntax b/syntaxes/fjsx15/operator/logical.sublime-syntax index c60a87b4..c60cd6ca 100644 --- a/syntaxes/fjsx15/operator/logical.sublime-syntax +++ b/syntaxes/fjsx15/operator/logical.sublime-syntax @@ -34,4 +34,7 @@ contexts: ) captures: 1: keyword.operator.logical.js.fjsx15 - pop: true + set: expression + + expression: + - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax diff --git a/syntaxes/fjsx15/operator/pipe.sublime-syntax b/syntaxes/fjsx15/operator/pipe.sublime-syntax index d8b2a7fe..1724d9ea 100644 --- a/syntaxes/fjsx15/operator/pipe.sublime-syntax +++ b/syntaxes/fjsx15/operator/pipe.sublime-syntax @@ -46,5 +46,5 @@ contexts: 1: entity.name.function.js.fjsx15 pop: true # Other expressions. - # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax diff --git a/syntaxes/fjsx15/operator/relational.sublime-syntax b/syntaxes/fjsx15/operator/relational.sublime-syntax index 99983fe8..d22a6f5e 100644 --- a/syntaxes/fjsx15/operator/relational.sublime-syntax +++ b/syntaxes/fjsx15/operator/relational.sublime-syntax @@ -30,7 +30,10 @@ contexts: 1: >- word.js.fjsx15 keyword.operator.relational.js.fjsx15 - pop: true + set: expression + + expression: + - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax type: - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type.sublime-syntax diff --git a/syntaxes/fjsx15/operator/spread.sublime-syntax b/syntaxes/fjsx15/operator/spread.sublime-syntax index 71d474ab..90f51b6c 100644 --- a/syntaxes/fjsx15/operator/spread.sublime-syntax +++ b/syntaxes/fjsx15/operator/spread.sublime-syntax @@ -22,7 +22,7 @@ contexts: - match: \s*(\.{3}) captures: 1: keyword.operator.other.spread.js.fjsx15 - # set: statement-and-expression + set: expression - # statement-and-expression: - # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + expression: + - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax diff --git a/syntaxes/fjsx15/operator/word.no-pop.sublime-syntax b/syntaxes/fjsx15/operator/word.no-pop.sublime-syntax index 48444682..c7b049f2 100644 --- a/syntaxes/fjsx15/operator/word.no-pop.sublime-syntax +++ b/syntaxes/fjsx15/operator/word.no-pop.sublime-syntax @@ -24,10 +24,13 @@ contexts: 1: >- word.js.fjsx15 keyword.operator.other.js.fjsx15 - pop: true + set: expression - match: \s*(void)\b captures: 1: >- word.js.fjsx15 keyword.operator.other.void.js.fjsx15 - pop: true + set: expression + + expression: + - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax From 8c497efcb8510d441e668f6d0da3a9dee580ef20 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 4 Dec 2017 08:52:41 -0200 Subject: [PATCH 040/407] [FJSX15] Simplify --- syntaxes/fjsx15/property-access.sublime-syntax | 3 --- 1 file changed, 3 deletions(-) diff --git a/syntaxes/fjsx15/property-access.sublime-syntax b/syntaxes/fjsx15/property-access.sublime-syntax index 50490818..1b6fa8f3 100644 --- a/syntaxes/fjsx15/property-access.sublime-syntax +++ b/syntaxes/fjsx15/property-access.sublime-syntax @@ -29,7 +29,4 @@ contexts: captures: 1: punctuation.definition.property.access.end.js.fjsx15a pop: true - - include: expression - - expression: - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax From a1d39e702f490a734a75d8d862a243bd7fa3d49a Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 4 Dec 2017 08:53:43 -0200 Subject: [PATCH 041/407] [FJSX15] Move assignment operator --- syntaxes/fjsx15/expression.sublime-syntax | 2 +- syntaxes/fjsx15/operator.sublime-syntax | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/expression.sublime-syntax b/syntaxes/fjsx15/expression.sublime-syntax index 890e2831..967aab9a 100644 --- a/syntaxes/fjsx15/expression.sublime-syntax +++ b/syntaxes/fjsx15/expression.sublime-syntax @@ -28,7 +28,7 @@ contexts: main: - include: comment-no-pop - include: comma-no-pop - - include: Packages/Naomi/syntaxes/fjsx15/operator/assignment.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/operator.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/terminator.sublime-syntax - match: "{{expressionGroupBegin}}" captures: diff --git a/syntaxes/fjsx15/operator.sublime-syntax b/syntaxes/fjsx15/operator.sublime-syntax index bfe40297..cd966f9f 100644 --- a/syntaxes/fjsx15/operator.sublime-syntax +++ b/syntaxes/fjsx15/operator.sublime-syntax @@ -20,6 +20,7 @@ scope: ... contexts: main: - include: Packages/Naomi/syntaxes/fjsx15/operator/arithmetic.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/operator/assignment.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/bitwise.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/comparison.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/logical.sublime-syntax From 01fcc36056343b713a3edef160f89a9c13336d42 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 4 Dec 2017 19:04:53 -0200 Subject: [PATCH 042/407] [FJSX15] Make statements end expressions --- syntaxes/fjsx15/expression.sublime-syntax | 32 +++++++++++++++---- .../fjsx15/operator/arithmetic.sublime-syntax | 5 +-- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/syntaxes/fjsx15/expression.sublime-syntax b/syntaxes/fjsx15/expression.sublime-syntax index 967aab9a..97549651 100644 --- a/syntaxes/fjsx15/expression.sublime-syntax +++ b/syntaxes/fjsx15/expression.sublime-syntax @@ -28,7 +28,7 @@ contexts: main: - include: comment-no-pop - include: comma-no-pop - - include: Packages/Naomi/syntaxes/fjsx15/operator.sublime-syntax + # - include: Packages/Naomi/syntaxes/fjsx15/statement.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/terminator.sublime-syntax - match: "{{expressionGroupBegin}}" captures: @@ -96,22 +96,40 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/function-call.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/constant.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/variable.sublime-syntax - # Prefix operators. - - match: (?=\s*\S) + # Terminator and expression delimiters. + - match: (?=\s*[;)\]}]) + pop: true + # Binary operators. + - match: (?=\S) push: - - include: comment-no-pop - include: Packages/Naomi/syntaxes/fjsx15/operator.sublime-syntax expression-tail: - include: comment-no-pop - - include: Packages/Naomi/syntaxes/fjsx15/operator.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax # Suffix operator. - match: (?=\s*[\[(]) push: - - include: comment-no-pop - include: Packages/Naomi/syntaxes/fjsx15/property-access.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function-call/arguments.sublime-syntax - # Expression ended. + # Binary operators. + - include: Packages/Naomi/syntaxes/fjsx15/operator.sublime-syntax + # Statements that end the expression. + - match: | + (?x) + (?= + (?> class + | const + | function + | let + | var + | ; + ) + ) + set: entry-point + # Anything else that is not expected. - match: (?=\s*\S) pop: true + + entry-point: + - include: Packages/Naomi/syntaxes/naomi.fjsx15.sublime-syntax diff --git a/syntaxes/fjsx15/operator/arithmetic.sublime-syntax b/syntaxes/fjsx15/operator/arithmetic.sublime-syntax index 9891c0c1..5fed0924 100644 --- a/syntaxes/fjsx15/operator/arithmetic.sublime-syntax +++ b/syntaxes/fjsx15/operator/arithmetic.sublime-syntax @@ -47,7 +47,4 @@ contexts: ) captures: 1: keyword.operator.arithmetic.js.fjsx15 - set: expression - - expression: - - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax + pop: true From 34b975b96a582f1fb00b588d653ce61d08e8eb71 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Tue, 5 Dec 2017 13:24:19 -0200 Subject: [PATCH 043/407] [FJSX15] Update loop to support optional expression/tail --- syntaxes/fjsx15/expression.sublime-syntax | 76 ++++++------------- .../fjsx15/operator/arithmetic.sublime-syntax | 5 +- .../fjsx15/operator/assignment.sublime-syntax | 6 +- .../fjsx15/operator/bitwise.sublime-syntax | 6 +- .../fjsx15/operator/comparison.sublime-syntax | 6 +- .../fjsx15/operator/logical.sublime-syntax | 6 +- .../fjsx15/operator/relational.sublime-syntax | 6 +- syntaxes/fjsx15/operator/rest.sublime-syntax | 5 +- .../fjsx15/operator/spread.sublime-syntax | 6 +- .../fjsx15/optional-expression.sublime-syntax | 32 ++++++++ syntaxes/naomi.fjsx15.sublime-syntax | 6 ++ 11 files changed, 87 insertions(+), 73 deletions(-) create mode 100644 syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/expression.sublime-syntax b/syntaxes/fjsx15/expression.sublime-syntax index 97549651..d9b84df5 100644 --- a/syntaxes/fjsx15/expression.sublime-syntax +++ b/syntaxes/fjsx15/expression.sublime-syntax @@ -27,29 +27,20 @@ variables: contexts: main: - include: comment-no-pop - - include: comma-no-pop - # - include: Packages/Naomi/syntaxes/fjsx15/statement.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/terminator.sublime-syntax + # Open new expression group. - match: "{{expressionGroupBegin}}" captures: 1: punctuation.definition.expression.group.a.begin.js.fjsx15 push: open-b-close-a # Start of the expression. - match: "{{expressionBegin}}" - push: [ - expression-tail, - expression-head - ] + set: [ optional-tail, head ] comment-no-pop: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - comma-no-pop: - - include: Packages/Naomi/syntaxes/fjsx15/operator/comma.no-pop.sublime-syntax - open-a-close-b: - include: comment-no-pop - - include: comma-no-pop # Open new expression group. - match: "{{expressionGroupBegin}}" captures: @@ -59,17 +50,13 @@ contexts: - match: \s*(\)) captures: 1: punctuation.definition.expression.group.b.end.js.fjsx15 - pop: true + set: optional-tail # Start of the expression. - match: "{{expressionBegin}}" - push: [ - expression-tail, - expression-head - ] + set: [ optional-tail, head ] open-b-close-a: - include: comment-no-pop - - include: comma-no-pop # Open new expression group. - match: "{{expressionGroupBegin}}" captures: @@ -79,57 +66,40 @@ contexts: - match: \s*(\)) captures: 1: punctuation.definition.expression.group.a.end.js.fjsx15 - pop: true + set: optional-tail # Start of the expression. - match: "{{expressionBegin}}" - push: [ - expression-tail, - expression-head - ] + set: [ optional-tail, head ] - expression-head: + head: - include: comment-no-pop - include: Packages/Naomi/syntaxes/fjsx15/literal.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/operator/word.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/class.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function-call.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/constant.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/variable.sublime-syntax - # Terminator and expression delimiters. - - match: (?=\s*[;)\]}]) - pop: true - # Binary operators. - - match: (?=\S) - push: - - include: Packages/Naomi/syntaxes/fjsx15/operator.sublime-syntax - expression-tail: + optional-tail: - include: comment-no-pop - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax - # Suffix operator. - - match: (?=\s*[\[(]) - push: - - include: Packages/Naomi/syntaxes/fjsx15/property-access.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/function-call/arguments.sublime-syntax - # Binary operators. + # Property access, function call and type conversion. + - match: (?=\s*[\[(:]) + set: [ optional-tail, tail ] + # Other operators. At this point, operators will have a higher priority than + # regex literals. - include: Packages/Naomi/syntaxes/fjsx15/operator.sublime-syntax - # Statements that end the expression. - - match: | - (?x) - (?= - (?> class - | const - | function - | let - | var - | ; - ) - ) - set: entry-point - # Anything else that is not expected. + # Anything else not expected. - match: (?=\s*\S) pop: true + # set: entry-point entry-point: + - match: \s*lol + scope: keyword - include: Packages/Naomi/syntaxes/naomi.fjsx15.sublime-syntax + + tail: + - include: comment-no-pop + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/property-access.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/function-call/arguments.sublime-syntax diff --git a/syntaxes/fjsx15/operator/arithmetic.sublime-syntax b/syntaxes/fjsx15/operator/arithmetic.sublime-syntax index 5fed0924..759589fc 100644 --- a/syntaxes/fjsx15/operator/arithmetic.sublime-syntax +++ b/syntaxes/fjsx15/operator/arithmetic.sublime-syntax @@ -47,4 +47,7 @@ contexts: ) captures: 1: keyword.operator.arithmetic.js.fjsx15 - pop: true + set: optional-expression + + optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/operator/assignment.sublime-syntax b/syntaxes/fjsx15/operator/assignment.sublime-syntax index 8839431f..0b6e8232 100644 --- a/syntaxes/fjsx15/operator/assignment.sublime-syntax +++ b/syntaxes/fjsx15/operator/assignment.sublime-syntax @@ -22,7 +22,7 @@ contexts: - match: \s*(=) captures: 1: keyword.operator.other.assignment.js.fjsx15 - set: expression + set: optional-expression - expression: - - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax + optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/operator/bitwise.sublime-syntax b/syntaxes/fjsx15/operator/bitwise.sublime-syntax index 36dfba36..5f4baf04 100644 --- a/syntaxes/fjsx15/operator/bitwise.sublime-syntax +++ b/syntaxes/fjsx15/operator/bitwise.sublime-syntax @@ -49,7 +49,7 @@ contexts: ) captures: 1: keyword.operator.bitwise.js.fjsx15 - set: expression + set: optional-expression - expression: - - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax + optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/operator/comparison.sublime-syntax b/syntaxes/fjsx15/operator/comparison.sublime-syntax index a5291935..737708b4 100644 --- a/syntaxes/fjsx15/operator/comparison.sublime-syntax +++ b/syntaxes/fjsx15/operator/comparison.sublime-syntax @@ -42,7 +42,7 @@ contexts: ) captures: 1: keyword.operator.comparison.js.fjsx15 - set: expression + set: optional-expression - expression: - - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax + optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/operator/logical.sublime-syntax b/syntaxes/fjsx15/operator/logical.sublime-syntax index c60cd6ca..744cffd0 100644 --- a/syntaxes/fjsx15/operator/logical.sublime-syntax +++ b/syntaxes/fjsx15/operator/logical.sublime-syntax @@ -34,7 +34,7 @@ contexts: ) captures: 1: keyword.operator.logical.js.fjsx15 - set: expression + set: optional-expression - expression: - - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax + optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/operator/relational.sublime-syntax b/syntaxes/fjsx15/operator/relational.sublime-syntax index d22a6f5e..370f65f7 100644 --- a/syntaxes/fjsx15/operator/relational.sublime-syntax +++ b/syntaxes/fjsx15/operator/relational.sublime-syntax @@ -30,10 +30,10 @@ contexts: 1: >- word.js.fjsx15 keyword.operator.relational.js.fjsx15 - set: expression + set: optional-expression - expression: - - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax + optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax type: - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type.sublime-syntax diff --git a/syntaxes/fjsx15/operator/rest.sublime-syntax b/syntaxes/fjsx15/operator/rest.sublime-syntax index e6bfce85..65636c3a 100644 --- a/syntaxes/fjsx15/operator/rest.sublime-syntax +++ b/syntaxes/fjsx15/operator/rest.sublime-syntax @@ -22,4 +22,7 @@ contexts: - match: \s*(\.{3}) captures: 1: keyword.operator.other.rest.js.fjsx15 - pop: true + set: optional-expression + + optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/operator/spread.sublime-syntax b/syntaxes/fjsx15/operator/spread.sublime-syntax index 90f51b6c..6e6f1c32 100644 --- a/syntaxes/fjsx15/operator/spread.sublime-syntax +++ b/syntaxes/fjsx15/operator/spread.sublime-syntax @@ -22,7 +22,7 @@ contexts: - match: \s*(\.{3}) captures: 1: keyword.operator.other.spread.js.fjsx15 - set: expression + set: optional-expression - expression: - - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax + optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/optional-expression.sublime-syntax b/syntaxes/fjsx15/optional-expression.sublime-syntax new file mode 100644 index 00000000..50bfd0d4 --- /dev/null +++ b/syntaxes/fjsx15/optional-expression.sublime-syntax @@ -0,0 +1,32 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +contexts: + main: + # - match: (?=\s*[;\)\]}]) + # set: entry-point + - match: (?=\s*[;\)\]}]) + pop: true + - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/literal/string/regex.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/operator.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax + + entry-point: + - include: Packages/Naomi/syntaxes/naomi.fjsx15.sublime-syntax diff --git a/syntaxes/naomi.fjsx15.sublime-syntax b/syntaxes/naomi.fjsx15.sublime-syntax index 299281b2..d80337fe 100644 --- a/syntaxes/naomi.fjsx15.sublime-syntax +++ b/syntaxes/naomi.fjsx15.sublime-syntax @@ -27,5 +27,11 @@ scope: source.js.fjsx15 contexts: main: - include: Packages/Naomi/syntaxes/fjsx15/comment.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/terminator.sublime-syntax + # We need to detect operators as soon as possible but it can’t have a higher + # priority than regex literals at this stage. + - include: Packages/Naomi/syntaxes/fjsx15/literal/string/regex.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/operator.sublime-syntax + # Main statement and expression detection. - include: Packages/Naomi/syntaxes/fjsx15/statement.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax From 08167c7892e6836ad03221e1a3ba912a51a3b5f6 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Tue, 5 Dec 2017 13:24:40 -0200 Subject: [PATCH 044/407] [FJSX15] Add word operators back --- syntaxes/fjsx15/operator.sublime-syntax | 1 + .../{word.no-pop.sublime-syntax => word.sublime-syntax} | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) rename syntaxes/fjsx15/operator/{word.no-pop.sublime-syntax => word.sublime-syntax} (83%) diff --git a/syntaxes/fjsx15/operator.sublime-syntax b/syntaxes/fjsx15/operator.sublime-syntax index cd966f9f..78c5e090 100644 --- a/syntaxes/fjsx15/operator.sublime-syntax +++ b/syntaxes/fjsx15/operator.sublime-syntax @@ -29,3 +29,4 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/operator/relational.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/shebang.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/spread.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/operator/word.sublime-syntax diff --git a/syntaxes/fjsx15/operator/word.no-pop.sublime-syntax b/syntaxes/fjsx15/operator/word.sublime-syntax similarity index 83% rename from syntaxes/fjsx15/operator/word.no-pop.sublime-syntax rename to syntaxes/fjsx15/operator/word.sublime-syntax index c7b049f2..6ed0e5f5 100644 --- a/syntaxes/fjsx15/operator/word.no-pop.sublime-syntax +++ b/syntaxes/fjsx15/operator/word.sublime-syntax @@ -24,13 +24,13 @@ contexts: 1: >- word.js.fjsx15 keyword.operator.other.js.fjsx15 - set: expression + set: optional-expression - match: \s*(void)\b captures: 1: >- word.js.fjsx15 keyword.operator.other.void.js.fjsx15 - set: expression + set: optional-expression - expression: - - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax + optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax From 8b044b4bdec38e7a3c4385b8189702e53b734402 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Tue, 5 Dec 2017 13:25:26 -0200 Subject: [PATCH 045/407] [FJSX15] Simplify arithmetic operators --- syntaxes/fjsx15/operator/arithmetic.sublime-syntax | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/syntaxes/fjsx15/operator/arithmetic.sublime-syntax b/syntaxes/fjsx15/operator/arithmetic.sublime-syntax index 759589fc..e892b0eb 100644 --- a/syntaxes/fjsx15/operator/arithmetic.sublime-syntax +++ b/syntaxes/fjsx15/operator/arithmetic.sublime-syntax @@ -35,12 +35,9 @@ contexts: - match: | (?x)\s* ( - (?> -- - | -=? - | \+\+ - | \+=? - | \*\* - | \*=? + (?> [-][-=]? + | [+][+=]? + | [*][*=]? | /=? | %=? ) From 2de77697dedd64687f0d0ab49b8f4abca0521962 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Tue, 5 Dec 2017 13:26:06 -0200 Subject: [PATCH 046/407] [FJSX15] Remove dead code --- syntaxes/fjsx15/expression.sublime-syntax | 6 ------ 1 file changed, 6 deletions(-) diff --git a/syntaxes/fjsx15/expression.sublime-syntax b/syntaxes/fjsx15/expression.sublime-syntax index d9b84df5..dd22a950 100644 --- a/syntaxes/fjsx15/expression.sublime-syntax +++ b/syntaxes/fjsx15/expression.sublime-syntax @@ -91,12 +91,6 @@ contexts: # Anything else not expected. - match: (?=\s*\S) pop: true - # set: entry-point - - entry-point: - - match: \s*lol - scope: keyword - - include: Packages/Naomi/syntaxes/naomi.fjsx15.sublime-syntax tail: - include: comment-no-pop From 0d922e40ca1c8159223c0678c24652f9656c8970 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Tue, 5 Dec 2017 14:45:36 -0200 Subject: [PATCH 047/407] [FJSX15] Move terminator --- syntaxes/fjsx15/{ => operator}/terminator.sublime-syntax | 0 syntaxes/naomi.fjsx15.sublime-syntax | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename syntaxes/fjsx15/{ => operator}/terminator.sublime-syntax (100%) diff --git a/syntaxes/fjsx15/terminator.sublime-syntax b/syntaxes/fjsx15/operator/terminator.sublime-syntax similarity index 100% rename from syntaxes/fjsx15/terminator.sublime-syntax rename to syntaxes/fjsx15/operator/terminator.sublime-syntax diff --git a/syntaxes/naomi.fjsx15.sublime-syntax b/syntaxes/naomi.fjsx15.sublime-syntax index d80337fe..450402ac 100644 --- a/syntaxes/naomi.fjsx15.sublime-syntax +++ b/syntaxes/naomi.fjsx15.sublime-syntax @@ -27,7 +27,7 @@ scope: source.js.fjsx15 contexts: main: - include: Packages/Naomi/syntaxes/fjsx15/comment.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/terminator.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/operator/terminator.sublime-syntax # We need to detect operators as soon as possible but it can’t have a higher # priority than regex literals at this stage. - include: Packages/Naomi/syntaxes/fjsx15/literal/string/regex.sublime-syntax From 4440c2b4c3e4d9b01f938da2a1ba2a1bba993ddd Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Tue, 5 Dec 2017 14:50:10 -0200 Subject: [PATCH 048/407] [FJSX15] Remove dead code --- syntaxes/fjsx15/optional-expression.sublime-syntax | 5 ----- 1 file changed, 5 deletions(-) diff --git a/syntaxes/fjsx15/optional-expression.sublime-syntax b/syntaxes/fjsx15/optional-expression.sublime-syntax index 50bfd0d4..1473eb4e 100644 --- a/syntaxes/fjsx15/optional-expression.sublime-syntax +++ b/syntaxes/fjsx15/optional-expression.sublime-syntax @@ -19,14 +19,9 @@ scope: ... contexts: main: - # - match: (?=\s*[;\)\]}]) - # set: entry-point - match: (?=\s*[;\)\]}]) pop: true - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/literal/string/regex.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax - - entry-point: - - include: Packages/Naomi/syntaxes/naomi.fjsx15.sublime-syntax From 2c8dc2a3905862852473876438a313e8daa80e3b Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Tue, 5 Dec 2017 14:50:46 -0200 Subject: [PATCH 049/407] [FJXS15] Restore comma --- .../{comma.no-pop.sublime-syntax => comma.sublime-syntax} | 4 ++++ syntaxes/naomi.fjsx15.sublime-syntax | 1 + 2 files changed, 5 insertions(+) rename syntaxes/fjsx15/operator/{comma.no-pop.sublime-syntax => comma.sublime-syntax} (83%) diff --git a/syntaxes/fjsx15/operator/comma.no-pop.sublime-syntax b/syntaxes/fjsx15/operator/comma.sublime-syntax similarity index 83% rename from syntaxes/fjsx15/operator/comma.no-pop.sublime-syntax rename to syntaxes/fjsx15/operator/comma.sublime-syntax index 3e279237..3d16ea7d 100644 --- a/syntaxes/fjsx15/operator/comma.no-pop.sublime-syntax +++ b/syntaxes/fjsx15/operator/comma.sublime-syntax @@ -22,3 +22,7 @@ contexts: - match: \s*(,) captures: 1: keyword.operator.other.comma.js.fjsx15 + set: optional-expression + + optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/naomi.fjsx15.sublime-syntax b/syntaxes/naomi.fjsx15.sublime-syntax index 450402ac..b22aa629 100644 --- a/syntaxes/naomi.fjsx15.sublime-syntax +++ b/syntaxes/naomi.fjsx15.sublime-syntax @@ -27,6 +27,7 @@ scope: source.js.fjsx15 contexts: main: - include: Packages/Naomi/syntaxes/fjsx15/comment.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/operator/comma.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/terminator.sublime-syntax # We need to detect operators as soon as possible but it can’t have a higher # priority than regex literals at this stage. From a4afbb39a7f6b3fc8d5898fef3be3ce4ac4cb753 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Tue, 5 Dec 2017 14:50:57 -0200 Subject: [PATCH 050/407] [FJSX15] Simplify expression groups --- syntaxes/fjsx15/expression.sublime-syntax | 33 +++++++---------------- 1 file changed, 9 insertions(+), 24 deletions(-) diff --git a/syntaxes/fjsx15/expression.sublime-syntax b/syntaxes/fjsx15/expression.sublime-syntax index dd22a950..986e3531 100644 --- a/syntaxes/fjsx15/expression.sublime-syntax +++ b/syntaxes/fjsx15/expression.sublime-syntax @@ -30,46 +30,31 @@ contexts: # Open new expression group. - match: "{{expressionGroupBegin}}" captures: - 1: punctuation.definition.expression.group.a.begin.js.fjsx15 - push: open-b-close-a + 1: punctuation.definition.expression.group.begin.js.fjsx15 + push: open-group # Start of the expression. - match: "{{expressionBegin}}" - set: [ optional-tail, head ] + push: [ optional-tail, head ] comment-no-pop: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - open-a-close-b: + open-group: - include: comment-no-pop + - include: Packages/Naomi/syntaxes/fjsx15/operator/comma.sublime-syntax # Open new expression group. - match: "{{expressionGroupBegin}}" captures: - 1: punctuation.definition.expression.group.a.begin.js.fjsx15 - push: open-b-close-a + 1: punctuation.definition.expression.group.begin.js.fjsx15 + push: open-group # Close the previous expression group. - match: \s*(\)) captures: - 1: punctuation.definition.expression.group.b.end.js.fjsx15 + 1: punctuation.definition.expression.group.end.js.fjsx15 set: optional-tail # Start of the expression. - match: "{{expressionBegin}}" - set: [ optional-tail, head ] - - open-b-close-a: - - include: comment-no-pop - # Open new expression group. - - match: "{{expressionGroupBegin}}" - captures: - 1: punctuation.definition.expression.group.b.begin.js.fjsx15 - push: open-a-close-b - # Close the previous expression group. - - match: \s*(\)) - captures: - 1: punctuation.definition.expression.group.a.end.js.fjsx15 - set: optional-tail - # Start of the expression. - - match: "{{expressionBegin}}" - set: [ optional-tail, head ] + push: [ optional-tail, head ] head: - include: comment-no-pop From d27b0350098321c6a3ec327ad1aab6069cfe629a Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Tue, 5 Dec 2017 15:01:45 -0200 Subject: [PATCH 051/407] [FJSX15] Enhance comma prediction --- syntaxes/fjsx15/expression.sublime-syntax | 2 +- .../{comma.sublime-syntax => comma.no-pop.sublime-syntax} | 4 ---- syntaxes/fjsx15/optional-expression.sublime-syntax | 1 + syntaxes/naomi.fjsx15.sublime-syntax | 2 +- 4 files changed, 3 insertions(+), 6 deletions(-) rename syntaxes/fjsx15/operator/{comma.sublime-syntax => comma.no-pop.sublime-syntax} (83%) diff --git a/syntaxes/fjsx15/expression.sublime-syntax b/syntaxes/fjsx15/expression.sublime-syntax index 986e3531..cb4ae2e9 100644 --- a/syntaxes/fjsx15/expression.sublime-syntax +++ b/syntaxes/fjsx15/expression.sublime-syntax @@ -41,7 +41,7 @@ contexts: open-group: - include: comment-no-pop - - include: Packages/Naomi/syntaxes/fjsx15/operator/comma.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/operator/comma.no-pop.sublime-syntax # Open new expression group. - match: "{{expressionGroupBegin}}" captures: diff --git a/syntaxes/fjsx15/operator/comma.sublime-syntax b/syntaxes/fjsx15/operator/comma.no-pop.sublime-syntax similarity index 83% rename from syntaxes/fjsx15/operator/comma.sublime-syntax rename to syntaxes/fjsx15/operator/comma.no-pop.sublime-syntax index 3d16ea7d..3e279237 100644 --- a/syntaxes/fjsx15/operator/comma.sublime-syntax +++ b/syntaxes/fjsx15/operator/comma.no-pop.sublime-syntax @@ -22,7 +22,3 @@ contexts: - match: \s*(,) captures: 1: keyword.operator.other.comma.js.fjsx15 - set: optional-expression - - optional-expression: - - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/optional-expression.sublime-syntax b/syntaxes/fjsx15/optional-expression.sublime-syntax index 1473eb4e..a75ff9ec 100644 --- a/syntaxes/fjsx15/optional-expression.sublime-syntax +++ b/syntaxes/fjsx15/optional-expression.sublime-syntax @@ -23,5 +23,6 @@ contexts: pop: true - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/literal/string/regex.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/operator/comma.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax diff --git a/syntaxes/naomi.fjsx15.sublime-syntax b/syntaxes/naomi.fjsx15.sublime-syntax index b22aa629..3154aee2 100644 --- a/syntaxes/naomi.fjsx15.sublime-syntax +++ b/syntaxes/naomi.fjsx15.sublime-syntax @@ -27,7 +27,7 @@ scope: source.js.fjsx15 contexts: main: - include: Packages/Naomi/syntaxes/fjsx15/comment.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/operator/comma.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/operator/comma.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/terminator.sublime-syntax # We need to detect operators as soon as possible but it can’t have a higher # priority than regex literals at this stage. From 432b02b643cb07685fe177e029f42f5bd4c5b1c4 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Tue, 5 Dec 2017 15:09:09 -0200 Subject: [PATCH 052/407] [FJSX15] Make expressions pop --- syntaxes/fjsx15/expression.sublime-syntax | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/expression.sublime-syntax b/syntaxes/fjsx15/expression.sublime-syntax index cb4ae2e9..ba1bf7a2 100644 --- a/syntaxes/fjsx15/expression.sublime-syntax +++ b/syntaxes/fjsx15/expression.sublime-syntax @@ -34,7 +34,7 @@ contexts: push: open-group # Start of the expression. - match: "{{expressionBegin}}" - push: [ optional-tail, head ] + set: [ optional-tail, head ] comment-no-pop: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax From 72b64b31ffb8ca1ef76c25b8e5c20a1ba3690e49 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Tue, 5 Dec 2017 15:11:27 -0200 Subject: [PATCH 053/407] [FJXS15] Fix function call and property access arguments --- syntaxes/fjsx15/function-call/arguments.sublime-syntax | 6 +++++- syntaxes/fjsx15/property-access.sublime-syntax | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/syntaxes/fjsx15/function-call/arguments.sublime-syntax b/syntaxes/fjsx15/function-call/arguments.sublime-syntax index 9bc6f0c4..02cd60e5 100644 --- a/syntaxes/fjsx15/function-call/arguments.sublime-syntax +++ b/syntaxes/fjsx15/function-call/arguments.sublime-syntax @@ -32,4 +32,8 @@ contexts: - match: \s*(,) captures: 1: punctuation.definition.function.arguments.js.fjsx15 - - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax + - match: "" + push: + - match: (?=\s*[,)]) + pop: true + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/property-access.sublime-syntax b/syntaxes/fjsx15/property-access.sublime-syntax index 1b6fa8f3..32989f86 100644 --- a/syntaxes/fjsx15/property-access.sublime-syntax +++ b/syntaxes/fjsx15/property-access.sublime-syntax @@ -29,4 +29,8 @@ contexts: captures: 1: punctuation.definition.property.access.end.js.fjsx15a pop: true - - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax + - match: "" + push: + - match: (?=\s*]) + pop: true + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax From b007cb709b9d4ea82b4129aa986e4330243c714b Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Tue, 5 Dec 2017 16:10:45 -0200 Subject: [PATCH 054/407] [FJSX15] Disable dead code --- syntaxes/fjsx15/class/body.sublime-syntax | 2 +- .../function/parameters/destructuring/array.sublime-syntax | 6 +++--- .../function/parameters/destructuring/object.sublime-syntax | 6 +++--- .../parameters/destructuring/object/property.sublime-syntax | 6 +++--- syntaxes/fjsx15/variable-declaration.sublime-syntax | 6 +++--- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/syntaxes/fjsx15/class/body.sublime-syntax b/syntaxes/fjsx15/class/body.sublime-syntax index 5cbc620b..caf28a55 100644 --- a/syntaxes/fjsx15/class/body.sublime-syntax +++ b/syntaxes/fjsx15/class/body.sublime-syntax @@ -50,7 +50,7 @@ contexts: entity.name.variable.js.fjsx15 pop: true - include: Packages/Naomi/syntaxes/fjsx15/comment.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/operator/comma.sublime-syntax + # - include: Packages/Naomi/syntaxes/fjsx15/operator/comma.sublime-syntax # React’s variables (state, contextTypes, etc...). - include: Packages/Naomi/syntaxes/fjsx15/react-js.sublime-syntax # Any methods (including supporting libraries’ methods). diff --git a/syntaxes/fjsx15/function/parameters/destructuring/array.sublime-syntax b/syntaxes/fjsx15/function/parameters/destructuring/array.sublime-syntax index 7fae6c7c..8a163ac8 100644 --- a/syntaxes/fjsx15/function/parameters/destructuring/array.sublime-syntax +++ b/syntaxes/fjsx15/function/parameters/destructuring/array.sublime-syntax @@ -74,12 +74,12 @@ contexts: pop: true - match: "" push: - - include: statement-and-expression + # - include: statement-and-expression - match: "" pop: true comment: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - statement-and-expression: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + # statement-and-expression: + # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax diff --git a/syntaxes/fjsx15/function/parameters/destructuring/object.sublime-syntax b/syntaxes/fjsx15/function/parameters/destructuring/object.sublime-syntax index c5764d27..5bbd118f 100644 --- a/syntaxes/fjsx15/function/parameters/destructuring/object.sublime-syntax +++ b/syntaxes/fjsx15/function/parameters/destructuring/object.sublime-syntax @@ -85,12 +85,12 @@ contexts: pop: true - match: "" push: - - include: statement-and-expression + # - include: statement-and-expression - match: "" pop: true comment: - include: Packages/Naomi/syntaxes/fjsx15/comment.sublime-syntax - statement-and-expression: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + # statement-and-expression: + # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax diff --git a/syntaxes/fjsx15/function/parameters/destructuring/object/property.sublime-syntax b/syntaxes/fjsx15/function/parameters/destructuring/object/property.sublime-syntax index e2f1f00e..1946b664 100644 --- a/syntaxes/fjsx15/function/parameters/destructuring/object/property.sublime-syntax +++ b/syntaxes/fjsx15/function/parameters/destructuring/object/property.sublime-syntax @@ -114,7 +114,7 @@ contexts: push: - match: (?=\s*]) pop: true - - include: statement-and-expression + # - include: statement-and-expression - statement-and-expression: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + # statement-and-expression: + # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax diff --git a/syntaxes/fjsx15/variable-declaration.sublime-syntax b/syntaxes/fjsx15/variable-declaration.sublime-syntax index ea226c9b..e2776b6c 100644 --- a/syntaxes/fjsx15/variable-declaration.sublime-syntax +++ b/syntaxes/fjsx15/variable-declaration.sublime-syntax @@ -52,7 +52,7 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/destructuring/array.sublime-syntax keyword: - - include: comment-no-pop + # - include: comment-no-pop - match: | (?x)\s* ((?>const|let|var)) @@ -63,12 +63,12 @@ contexts: pop: true variable-or-constant: - - include: comment + # - include: comment - include: Packages/Naomi/syntaxes/fjsx15/constant.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/variable.sublime-syntax optional-type: - - include: comment-no-pop + # - include: comment-no-pop - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax - match: (?=\s*\S) pop: true From 0a480eebbc1aa42ace8d8bd035ae3b6748844bd5 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Tue, 5 Dec 2017 16:11:18 -0200 Subject: [PATCH 055/407] [FJSX15] Fix terminator references --- syntaxes/fjsx15/class/property.sublime-syntax | 2 +- syntaxes/fjsx15/comment/flowtype.sublime-syntax | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/syntaxes/fjsx15/class/property.sublime-syntax b/syntaxes/fjsx15/class/property.sublime-syntax index c8eb690a..f4f27882 100644 --- a/syntaxes/fjsx15/class/property.sublime-syntax +++ b/syntaxes/fjsx15/class/property.sublime-syntax @@ -127,7 +127,7 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax terminator: - - include: Packages/Naomi/syntaxes/fjsx15/terminator.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/operator/terminator.sublime-syntax # statement-and-expression: # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax diff --git a/syntaxes/fjsx15/comment/flowtype.sublime-syntax b/syntaxes/fjsx15/comment/flowtype.sublime-syntax index 4df1f18a..23efef9c 100644 --- a/syntaxes/fjsx15/comment/flowtype.sublime-syntax +++ b/syntaxes/fjsx15/comment/flowtype.sublime-syntax @@ -85,7 +85,7 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type-aliasing.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/import.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/export.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/terminator.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/operator/terminator.sublime-syntax link: - include: Packages/Naomi/syntaxes/shared/link.sublime-syntax From 55135476a4866355a75055371f82a0d36496e3a1 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Wed, 6 Dec 2017 10:31:52 -0200 Subject: [PATCH 056/407] [FJXS15] Move comma to operators --- syntaxes/fjsx15/expression.sublime-syntax | 1 - syntaxes/fjsx15/operator.sublime-syntax | 1 + .../{comma.no-pop.sublime-syntax => comma.sublime-syntax} | 4 ++++ syntaxes/fjsx15/optional-expression.sublime-syntax | 1 - 4 files changed, 5 insertions(+), 2 deletions(-) rename syntaxes/fjsx15/operator/{comma.no-pop.sublime-syntax => comma.sublime-syntax} (83%) diff --git a/syntaxes/fjsx15/expression.sublime-syntax b/syntaxes/fjsx15/expression.sublime-syntax index ba1bf7a2..6d1629cd 100644 --- a/syntaxes/fjsx15/expression.sublime-syntax +++ b/syntaxes/fjsx15/expression.sublime-syntax @@ -41,7 +41,6 @@ contexts: open-group: - include: comment-no-pop - - include: Packages/Naomi/syntaxes/fjsx15/operator/comma.no-pop.sublime-syntax # Open new expression group. - match: "{{expressionGroupBegin}}" captures: diff --git a/syntaxes/fjsx15/operator.sublime-syntax b/syntaxes/fjsx15/operator.sublime-syntax index 78c5e090..13556cc8 100644 --- a/syntaxes/fjsx15/operator.sublime-syntax +++ b/syntaxes/fjsx15/operator.sublime-syntax @@ -22,6 +22,7 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/operator/arithmetic.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/assignment.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/bitwise.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/operator/comma.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/comparison.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/logical.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/other.sublime-syntax diff --git a/syntaxes/fjsx15/operator/comma.no-pop.sublime-syntax b/syntaxes/fjsx15/operator/comma.sublime-syntax similarity index 83% rename from syntaxes/fjsx15/operator/comma.no-pop.sublime-syntax rename to syntaxes/fjsx15/operator/comma.sublime-syntax index 3e279237..3d16ea7d 100644 --- a/syntaxes/fjsx15/operator/comma.no-pop.sublime-syntax +++ b/syntaxes/fjsx15/operator/comma.sublime-syntax @@ -22,3 +22,7 @@ contexts: - match: \s*(,) captures: 1: keyword.operator.other.comma.js.fjsx15 + set: optional-expression + + optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/optional-expression.sublime-syntax b/syntaxes/fjsx15/optional-expression.sublime-syntax index a75ff9ec..1473eb4e 100644 --- a/syntaxes/fjsx15/optional-expression.sublime-syntax +++ b/syntaxes/fjsx15/optional-expression.sublime-syntax @@ -23,6 +23,5 @@ contexts: pop: true - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/literal/string/regex.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/operator/comma.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax From 020b52eb41c59c3041b13e4fb3faf6ef15db91e8 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Wed, 6 Dec 2017 10:32:37 -0200 Subject: [PATCH 057/407] [FJSX15] Enhance expressions --- syntaxes/fjsx15/expression.sublime-syntax | 31 +++++++++++++++++------ 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/syntaxes/fjsx15/expression.sublime-syntax b/syntaxes/fjsx15/expression.sublime-syntax index 6d1629cd..29d8fe8f 100644 --- a/syntaxes/fjsx15/expression.sublime-syntax +++ b/syntaxes/fjsx15/expression.sublime-syntax @@ -27,11 +27,15 @@ variables: contexts: main: - include: comment-no-pop + # We need to detect operators as soon as possible but it can’t have a higher + # priority than regex literals at this stage. + - include: Packages/Naomi/syntaxes/fjsx15/literal/string/regex.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/operator.sublime-syntax # Open new expression group. - match: "{{expressionGroupBegin}}" captures: 1: punctuation.definition.expression.group.begin.js.fjsx15 - push: open-group + set: open-group # Start of the expression. - match: "{{expressionBegin}}" set: [ optional-tail, head ] @@ -39,21 +43,33 @@ contexts: comment-no-pop: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax + optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax + + type-cast: + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/cast.sublime-syntax + open-group: - include: comment-no-pop + # Type cast. + - match: (?=\s*:) + set: [ close-group, type-cast ] # Open new expression group. - match: "{{expressionGroupBegin}}" captures: 1: punctuation.definition.expression.group.begin.js.fjsx15 push: open-group - # Close the previous expression group. + # Close the current expression group. + - include: close-group + # Start of the expression. + - match: "{{expressionBegin}}" + push: optional-expression + + close-group: - match: \s*(\)) captures: 1: punctuation.definition.expression.group.end.js.fjsx15 set: optional-tail - # Start of the expression. - - match: "{{expressionBegin}}" - push: [ optional-tail, head ] head: - include: comment-no-pop @@ -66,8 +82,8 @@ contexts: optional-tail: - include: comment-no-pop - # Property access, function call and type conversion. - - match: (?=\s*[\[(:]) + # Property access and function call. + - match: (?=\s*[\[(]) set: [ optional-tail, tail ] # Other operators. At this point, operators will have a higher priority than # regex literals. @@ -78,6 +94,5 @@ contexts: tail: - include: comment-no-pop - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/property-access.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function-call/arguments.sublime-syntax From 6f016f2d1755180db9c58822bc33369e1ef0a1f0 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Wed, 6 Dec 2017 10:33:06 -0200 Subject: [PATCH 058/407] [FJSX15] Simplify optional expressions --- syntaxes/fjsx15/optional-expression.sublime-syntax | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/syntaxes/fjsx15/optional-expression.sublime-syntax b/syntaxes/fjsx15/optional-expression.sublime-syntax index 1473eb4e..fea5661f 100644 --- a/syntaxes/fjsx15/optional-expression.sublime-syntax +++ b/syntaxes/fjsx15/optional-expression.sublime-syntax @@ -19,9 +19,6 @@ scope: ... contexts: main: - - match: (?=\s*[;\)\]}]) + - match: (?=\s*[:;\)\]}]) pop: true - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/regex.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/operator.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax From 41048ccdbc9c1f2f6d1c5e426e17acdafc242ef6 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Wed, 6 Dec 2017 10:33:30 -0200 Subject: [PATCH 059/407] [FJSX15] Add terminator to operators --- syntaxes/fjsx15/operator.sublime-syntax | 1 + 1 file changed, 1 insertion(+) diff --git a/syntaxes/fjsx15/operator.sublime-syntax b/syntaxes/fjsx15/operator.sublime-syntax index 13556cc8..c660a6ac 100644 --- a/syntaxes/fjsx15/operator.sublime-syntax +++ b/syntaxes/fjsx15/operator.sublime-syntax @@ -30,4 +30,5 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/operator/relational.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/shebang.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/spread.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/operator/terminator.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/word.sublime-syntax From 6bccd5391de1768821f5fb02e9e1ebe040269c91 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Wed, 6 Dec 2017 10:33:40 -0200 Subject: [PATCH 060/407] [FJSX15] Simplify entry point --- syntaxes/naomi.fjsx15.sublime-syntax | 7 ------- 1 file changed, 7 deletions(-) diff --git a/syntaxes/naomi.fjsx15.sublime-syntax b/syntaxes/naomi.fjsx15.sublime-syntax index 3154aee2..299281b2 100644 --- a/syntaxes/naomi.fjsx15.sublime-syntax +++ b/syntaxes/naomi.fjsx15.sublime-syntax @@ -27,12 +27,5 @@ scope: source.js.fjsx15 contexts: main: - include: Packages/Naomi/syntaxes/fjsx15/comment.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/operator/comma.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/operator/terminator.sublime-syntax - # We need to detect operators as soon as possible but it can’t have a higher - # priority than regex literals at this stage. - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/regex.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/operator.sublime-syntax - # Main statement and expression detection. - include: Packages/Naomi/syntaxes/fjsx15/statement.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax From 1a83e10090bbafd4da46d6f996684736a996d6a2 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Wed, 6 Dec 2017 11:25:53 -0200 Subject: [PATCH 061/407] [FJSX15] Tone down comma This is necessary to highlight parameter delimiters. --- syntaxes/fjsx15/expression.sublime-syntax | 6 ++++++ syntaxes/fjsx15/operator.sublime-syntax | 1 - syntaxes/fjsx15/optional-expression.sublime-syntax | 2 +- syntaxes/naomi.fjsx15.sublime-syntax | 1 + 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/syntaxes/fjsx15/expression.sublime-syntax b/syntaxes/fjsx15/expression.sublime-syntax index 29d8fe8f..2ba8d66e 100644 --- a/syntaxes/fjsx15/expression.sublime-syntax +++ b/syntaxes/fjsx15/expression.sublime-syntax @@ -40,6 +40,9 @@ contexts: - match: "{{expressionBegin}}" set: [ optional-tail, head ] + comma: + - include: Packages/Naomi/syntaxes/fjsx15/operator/comma.sublime-syntax + comment-no-pop: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax @@ -51,6 +54,9 @@ contexts: open-group: - include: comment-no-pop + # Comma operator. + - match: (?=\s*,) + push: comma # Type cast. - match: (?=\s*:) set: [ close-group, type-cast ] diff --git a/syntaxes/fjsx15/operator.sublime-syntax b/syntaxes/fjsx15/operator.sublime-syntax index c660a6ac..1834e2e5 100644 --- a/syntaxes/fjsx15/operator.sublime-syntax +++ b/syntaxes/fjsx15/operator.sublime-syntax @@ -22,7 +22,6 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/operator/arithmetic.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/assignment.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/bitwise.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/operator/comma.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/comparison.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/logical.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/other.sublime-syntax diff --git a/syntaxes/fjsx15/optional-expression.sublime-syntax b/syntaxes/fjsx15/optional-expression.sublime-syntax index fea5661f..56d50df5 100644 --- a/syntaxes/fjsx15/optional-expression.sublime-syntax +++ b/syntaxes/fjsx15/optional-expression.sublime-syntax @@ -19,6 +19,6 @@ scope: ... contexts: main: - - match: (?=\s*[:;\)\]}]) + - match: (?=\s*[,;:\)\]}]) pop: true - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax diff --git a/syntaxes/naomi.fjsx15.sublime-syntax b/syntaxes/naomi.fjsx15.sublime-syntax index 299281b2..03f05232 100644 --- a/syntaxes/naomi.fjsx15.sublime-syntax +++ b/syntaxes/naomi.fjsx15.sublime-syntax @@ -27,5 +27,6 @@ scope: source.js.fjsx15 contexts: main: - include: Packages/Naomi/syntaxes/fjsx15/comment.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/operator/comma.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/statement.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax From 013b27c5f9c1996bcebfee1761cbb972af99a908 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Wed, 6 Dec 2017 11:42:54 -0200 Subject: [PATCH 062/407] [FJSX15] Move comma from entry point --- syntaxes/fjsx15/expression.sublime-syntax | 1 + syntaxes/naomi.fjsx15.sublime-syntax | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/expression.sublime-syntax b/syntaxes/fjsx15/expression.sublime-syntax index 2ba8d66e..8e01cb66 100644 --- a/syntaxes/fjsx15/expression.sublime-syntax +++ b/syntaxes/fjsx15/expression.sublime-syntax @@ -27,6 +27,7 @@ variables: contexts: main: - include: comment-no-pop + - include: comma # We need to detect operators as soon as possible but it can’t have a higher # priority than regex literals at this stage. - include: Packages/Naomi/syntaxes/fjsx15/literal/string/regex.sublime-syntax diff --git a/syntaxes/naomi.fjsx15.sublime-syntax b/syntaxes/naomi.fjsx15.sublime-syntax index 03f05232..299281b2 100644 --- a/syntaxes/naomi.fjsx15.sublime-syntax +++ b/syntaxes/naomi.fjsx15.sublime-syntax @@ -27,6 +27,5 @@ scope: source.js.fjsx15 contexts: main: - include: Packages/Naomi/syntaxes/fjsx15/comment.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/operator/comma.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/statement.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax From e657f8a586acacd70e59bdb9c73d1ef3e37295f1 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Wed, 6 Dec 2017 21:58:37 -0200 Subject: [PATCH 063/407] [FJSX15] Add core constants --- syntaxes/fjsx15/expression.sublime-syntax | 1 + 1 file changed, 1 insertion(+) diff --git a/syntaxes/fjsx15/expression.sublime-syntax b/syntaxes/fjsx15/expression.sublime-syntax index 8e01cb66..aaa559f1 100644 --- a/syntaxes/fjsx15/expression.sublime-syntax +++ b/syntaxes/fjsx15/expression.sublime-syntax @@ -84,6 +84,7 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/class.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function-call.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/core.sublime-syntax#constants - include: Packages/Naomi/syntaxes/fjsx15/constant.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/variable.sublime-syntax From 45cea636f6a7deae66d539b6effcaca22fd52caa Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Wed, 6 Dec 2017 21:58:51 -0200 Subject: [PATCH 064/407] [FJSX15] Fix function call arguments --- .../fjsx15/function-call/arguments.sublime-syntax | 13 ++++++------- .../function-call/support/arguments.sublime-syntax | 8 +++++--- .../support/jest-arguments.sublime-syntax | 14 +++++++------- .../support/react-js-arguments.sublime-syntax | 13 ++++++------- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/syntaxes/fjsx15/function-call/arguments.sublime-syntax b/syntaxes/fjsx15/function-call/arguments.sublime-syntax index 02cd60e5..52241c20 100644 --- a/syntaxes/fjsx15/function-call/arguments.sublime-syntax +++ b/syntaxes/fjsx15/function-call/arguments.sublime-syntax @@ -22,9 +22,9 @@ contexts: - match: \s*(\() captures: 1: punctuation.definition.function.arguments.begin.js.fjsx15 - set: arguments + set: [ delimiter, optional-expression ] - arguments: + delimiter: - match: \s*(\)) captures: 1: punctuation.definition.function.arguments.end.js.fjsx15 @@ -32,8 +32,7 @@ contexts: - match: \s*(,) captures: 1: punctuation.definition.function.arguments.js.fjsx15 - - match: "" - push: - - match: (?=\s*[,)]) - pop: true - - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax + set: [ delimiter, optional-expression ] + + optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/function-call/support/arguments.sublime-syntax b/syntaxes/fjsx15/function-call/support/arguments.sublime-syntax index 962f14fc..443f3bb2 100644 --- a/syntaxes/fjsx15/function-call/support/arguments.sublime-syntax +++ b/syntaxes/fjsx15/function-call/support/arguments.sublime-syntax @@ -24,9 +24,9 @@ contexts: 1: >- support.core.js.fjsx15 punctuation.definition.function.arguments.begin.js.fjsx15 - set: arguments + set: [ delimiter, optional-expression ] - arguments: + delimiter: - match: \s*(\)) captures: 1: >- @@ -38,5 +38,7 @@ contexts: 1: >- support.core.js.fjsx15 punctuation.definition.function.arguments.js.fjsx15 - - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax + set: [ delimiter, optional-expression ] + optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/function-call/support/jest-arguments.sublime-syntax b/syntaxes/fjsx15/function-call/support/jest-arguments.sublime-syntax index 53b1a15b..84adb8e7 100644 --- a/syntaxes/fjsx15/function-call/support/jest-arguments.sublime-syntax +++ b/syntaxes/fjsx15/function-call/support/jest-arguments.sublime-syntax @@ -24,9 +24,9 @@ contexts: 1: >- support.lib.jest.fjsx15 punctuation.definition.function.arguments.begin.js.fjsx15 - set: arguments + set: [ delimiter, optional-expression ] - arguments: + delimiter: - match: \s*(\)) captures: 1: >- @@ -38,8 +38,8 @@ contexts: 1: >- support.lib.jest.fjsx15 punctuation.definition.function.arguments.js.fjsx15 - - match: "" - push: - # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax - - match: "" - pop: true + + set: [ delimiter, optional-expression ] + + optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/function-call/support/react-js-arguments.sublime-syntax b/syntaxes/fjsx15/function-call/support/react-js-arguments.sublime-syntax index 53b1a15b..7ac4b9dd 100644 --- a/syntaxes/fjsx15/function-call/support/react-js-arguments.sublime-syntax +++ b/syntaxes/fjsx15/function-call/support/react-js-arguments.sublime-syntax @@ -24,9 +24,9 @@ contexts: 1: >- support.lib.jest.fjsx15 punctuation.definition.function.arguments.begin.js.fjsx15 - set: arguments + set: [ delimiter, optional-expression ] - arguments: + delimiter: - match: \s*(\)) captures: 1: >- @@ -38,8 +38,7 @@ contexts: 1: >- support.lib.jest.fjsx15 punctuation.definition.function.arguments.js.fjsx15 - - match: "" - push: - # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax - - match: "" - pop: true + set: [ delimiter, optional-expression ] + + optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax From 5ce4d3a0bbe1296b024ec6447396cebe8b823020 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Wed, 6 Dec 2017 22:00:00 -0200 Subject: [PATCH 065/407] [FJSX15] Fix other operators --- syntaxes/fjsx15/operator/other.sublime-syntax | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/syntaxes/fjsx15/operator/other.sublime-syntax b/syntaxes/fjsx15/operator/other.sublime-syntax index 40b02627..82b616c0 100644 --- a/syntaxes/fjsx15/operator/other.sublime-syntax +++ b/syntaxes/fjsx15/operator/other.sublime-syntax @@ -30,15 +30,15 @@ contexts: - match: \s*(\:{2}) captures: 1: keyword.operator.other.bind.js.fjsx15 - pop: true + set: optional-expression - match: \s*(\?\?) captures: 1: keyword.operator.other.nullish-coalescing.js.fjsx15 - pop: true + set: optional-expression - match: \s*(\?\.) captures: 1: keyword.operator.other.optional-chain.js.fjsx15 - pop: true + set: optional-expression - match: \s*(\.) captures: 1: keyword.operator.other.member-access.js.fjsx15 @@ -47,6 +47,10 @@ contexts: # captures: # 1: keyword.operator.other.ternary.js.fjsx15 # set: ternary-condition + optional-expression: + # - match: \s*123 + # scope: keyword + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax # comment: # - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax From 5bee62fd1dc16708f511a236039bf0de157f1f41 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Wed, 6 Dec 2017 22:00:09 -0200 Subject: [PATCH 066/407] [FJSX15] Implement ternary --- syntaxes/fjsx15/operator/other.sublime-syntax | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/syntaxes/fjsx15/operator/other.sublime-syntax b/syntaxes/fjsx15/operator/other.sublime-syntax index 82b616c0..0142c7c6 100644 --- a/syntaxes/fjsx15/operator/other.sublime-syntax +++ b/syntaxes/fjsx15/operator/other.sublime-syntax @@ -42,11 +42,15 @@ contexts: - match: \s*(\.) captures: 1: keyword.operator.other.member-access.js.fjsx15 - pop: true - # - match: \s*(\?) - # captures: - # 1: keyword.operator.other.ternary.js.fjsx15 - # set: ternary-condition + set: optional-expression + - match: \s*(\?) + captures: + 1: keyword.operator.other.ternary.js.fjsx15 + set: [ + ternary-else, + optional-expression + ] + optional-expression: # - match: \s*123 # scope: keyword @@ -55,16 +59,11 @@ contexts: # comment: # - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - # ternary-condition: - # - match: \s*(:) - # captures: - # 1: keyword.operator.other.ternary.js.fjsx15 - # pop: true - # - match: "" - # push: - # - match: (?=\s*:) - # pop: true - # # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + ternary-else: + - match: \s*(:) + captures: + 1: keyword.operator.other.ternary.js.fjsx15 + set: optional-expression # member-access: # - include: comment From 3502363c37b479d2f415367b9088e932ea540d9c Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Wed, 6 Dec 2017 22:00:24 -0200 Subject: [PATCH 067/407] [FJSX15] Disable function parameters --- syntaxes/fjsx15/function/parameters.sublime-syntax | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/syntaxes/fjsx15/function/parameters.sublime-syntax b/syntaxes/fjsx15/function/parameters.sublime-syntax index 9762b2e8..73135d41 100644 --- a/syntaxes/fjsx15/function/parameters.sublime-syntax +++ b/syntaxes/fjsx15/function/parameters.sublime-syntax @@ -32,13 +32,13 @@ contexts: captures: 1: punctuation.definition.function.parameters.end.js.fjsx15 set: return-type - - match: "" - push: - - match: | - (?x) - (?=\s*(?>,|\))) - pop: true - - include: Packages/Naomi/syntaxes/fjsx15/function/parameters/content.sublime-syntax + # - match: "" + # push: + # - match: | + # (?x) + # (?=\s*(?>,|\))) + # pop: true + # - include: Packages/Naomi/syntaxes/fjsx15/function/parameters/content.sublime-syntax associated-type: - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax From 204903965b065863b8324d1f074954c3eb1493ea Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Thu, 7 Dec 2017 15:29:28 -0200 Subject: [PATCH 068/407] [FJSX15] Simplify function calls --- syntaxes/fjsx15/function-call/arguments.sublime-syntax | 2 +- syntaxes/fjsx15/function-call/support/arguments.sublime-syntax | 2 +- .../fjsx15/function-call/support/jest-arguments.sublime-syntax | 3 +-- .../function-call/support/react-js-arguments.sublime-syntax | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/syntaxes/fjsx15/function-call/arguments.sublime-syntax b/syntaxes/fjsx15/function-call/arguments.sublime-syntax index 52241c20..313ac711 100644 --- a/syntaxes/fjsx15/function-call/arguments.sublime-syntax +++ b/syntaxes/fjsx15/function-call/arguments.sublime-syntax @@ -32,7 +32,7 @@ contexts: - match: \s*(,) captures: 1: punctuation.definition.function.arguments.js.fjsx15 - set: [ delimiter, optional-expression ] + push: optional-expression optional-expression: - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/function-call/support/arguments.sublime-syntax b/syntaxes/fjsx15/function-call/support/arguments.sublime-syntax index 443f3bb2..15537908 100644 --- a/syntaxes/fjsx15/function-call/support/arguments.sublime-syntax +++ b/syntaxes/fjsx15/function-call/support/arguments.sublime-syntax @@ -38,7 +38,7 @@ contexts: 1: >- support.core.js.fjsx15 punctuation.definition.function.arguments.js.fjsx15 - set: [ delimiter, optional-expression ] + push: optional-expression optional-expression: - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/function-call/support/jest-arguments.sublime-syntax b/syntaxes/fjsx15/function-call/support/jest-arguments.sublime-syntax index 84adb8e7..d355145c 100644 --- a/syntaxes/fjsx15/function-call/support/jest-arguments.sublime-syntax +++ b/syntaxes/fjsx15/function-call/support/jest-arguments.sublime-syntax @@ -38,8 +38,7 @@ contexts: 1: >- support.lib.jest.fjsx15 punctuation.definition.function.arguments.js.fjsx15 - - set: [ delimiter, optional-expression ] + push: optional-expression optional-expression: - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/function-call/support/react-js-arguments.sublime-syntax b/syntaxes/fjsx15/function-call/support/react-js-arguments.sublime-syntax index 7ac4b9dd..d355145c 100644 --- a/syntaxes/fjsx15/function-call/support/react-js-arguments.sublime-syntax +++ b/syntaxes/fjsx15/function-call/support/react-js-arguments.sublime-syntax @@ -38,7 +38,7 @@ contexts: 1: >- support.lib.jest.fjsx15 punctuation.definition.function.arguments.js.fjsx15 - set: [ delimiter, optional-expression ] + push: optional-expression optional-expression: - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax From 75057c61a7012e510101ce38369c01f001f9a002 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Thu, 7 Dec 2017 15:30:12 -0200 Subject: [PATCH 069/407] [FJSX15] Fix expressions after regex literals --- syntaxes/fjsx15/expression.sublime-syntax | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/syntaxes/fjsx15/expression.sublime-syntax b/syntaxes/fjsx15/expression.sublime-syntax index aaa559f1..ef5e488b 100644 --- a/syntaxes/fjsx15/expression.sublime-syntax +++ b/syntaxes/fjsx15/expression.sublime-syntax @@ -28,9 +28,10 @@ contexts: main: - include: comment-no-pop - include: comma - # We need to detect operators as soon as possible but it can’t have a higher - # priority than regex literals at this stage. - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/regex.sublime-syntax + # At this stage, regex literals will have a higher priority than operators. + - match: (?=\s*/.*?(? Date: Thu, 7 Dec 2017 15:30:35 -0200 Subject: [PATCH 070/407] [FJSX15] Make terminators route to entry point --- syntaxes/fjsx15/operator/terminator.sublime-syntax | 6 ++++++ syntaxes/fjsx15/optional-expression.sublime-syntax | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/operator/terminator.sublime-syntax b/syntaxes/fjsx15/operator/terminator.sublime-syntax index 187e0ecc..d732148c 100644 --- a/syntaxes/fjsx15/operator/terminator.sublime-syntax +++ b/syntaxes/fjsx15/operator/terminator.sublime-syntax @@ -22,4 +22,10 @@ contexts: - match: \s*(;) captures: 1: keyword.operator.other.terminator.js.fjsx15 + set: entry-point + + entry-point: + - include: main + - match: (?=\s*[,:)\]}]) pop: true + - include: Packages/Naomi/syntaxes/naomi.fjsx15.sublime-syntax diff --git a/syntaxes/fjsx15/optional-expression.sublime-syntax b/syntaxes/fjsx15/optional-expression.sublime-syntax index 56d50df5..946f0ccb 100644 --- a/syntaxes/fjsx15/optional-expression.sublime-syntax +++ b/syntaxes/fjsx15/optional-expression.sublime-syntax @@ -19,6 +19,7 @@ scope: ... contexts: main: - - match: (?=\s*[,;:\)\]}]) + - include: Packages/Naomi/syntaxes/fjsx15/operator/terminator.sublime-syntax + - match: (?=\s*[,:)\]}]) pop: true - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax From 82c64935bff0b43ef70abbaa978e7b0c9cfe99c1 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Thu, 7 Dec 2017 15:31:54 -0200 Subject: [PATCH 071/407] [FJSX15] Simplify property access expression --- syntaxes/fjsx15/property-access.sublime-syntax | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/syntaxes/fjsx15/property-access.sublime-syntax b/syntaxes/fjsx15/property-access.sublime-syntax index 32989f86..76586eb7 100644 --- a/syntaxes/fjsx15/property-access.sublime-syntax +++ b/syntaxes/fjsx15/property-access.sublime-syntax @@ -30,7 +30,7 @@ contexts: 1: punctuation.definition.property.access.end.js.fjsx15a pop: true - match: "" - push: - - match: (?=\s*]) - pop: true - - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax + push: optional-expression + + optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax From dd4229dd2c3feeeb19e943c3acdb22809f3567e4 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Fri, 8 Dec 2017 09:51:08 -0200 Subject: [PATCH 072/407] [FJSX15] Fix optional expressions in arrays --- syntaxes/fjsx15/literal/array.sublime-syntax | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/syntaxes/fjsx15/literal/array.sublime-syntax b/syntaxes/fjsx15/literal/array.sublime-syntax index 9b86252b..212ce717 100644 --- a/syntaxes/fjsx15/literal/array.sublime-syntax +++ b/syntaxes/fjsx15/literal/array.sublime-syntax @@ -22,14 +22,17 @@ contexts: - match: \s*(\[) captures: 1: punctuation.definition.array.begin.js.fjsx15 - set: items + set: [ delimiters, optional-expression ] - items: - - match: \s*(,) - captures: - 1: punctuation.definition.array.js.fjsx15 + delimiters: - match: \s*(]) captures: 1: punctuation.definition.array.end.js.fjsx15 pop: true - - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax + - match: \s*(,) + captures: + 1: punctuation.definition.array.js.fjsx15 + push: optional-expression + + optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax From 1e33f60793259bf34bd74a4bf24cd71fb3d932a0 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Fri, 8 Dec 2017 09:54:22 -0200 Subject: [PATCH 073/407] [FJSX15] Remove unnecessary comment --- syntaxes/fjsx15/core.sublime-syntax | 1 - 1 file changed, 1 deletion(-) diff --git a/syntaxes/fjsx15/core.sublime-syntax b/syntaxes/fjsx15/core.sublime-syntax index 1dffb860..13af3dc5 100644 --- a/syntaxes/fjsx15/core.sublime-syntax +++ b/syntaxes/fjsx15/core.sublime-syntax @@ -20,7 +20,6 @@ scope: ... contexts: main: - include: symbol-properties - # Functions. - include: array-functions - include: object-functions - include: math-constants From 2fc346f7f8198acac5dd504b42dc7c4438e80cc0 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Fri, 8 Dec 2017 11:45:40 -0200 Subject: [PATCH 074/407] [FJSX15] Delete old parameter logic --- .../parameters/content.sublime-syntax | 70 ---------- .../destructuring/array.sublime-syntax | 85 ------------- .../array/variable.sublime-syntax | 53 -------- .../destructuring/object.sublime-syntax | 96 -------------- .../object/property.sublime-syntax | 120 ------------------ .../function/parameters/simple.sublime-syntax | 37 ------ 6 files changed, 461 deletions(-) delete mode 100644 syntaxes/fjsx15/function/parameters/content.sublime-syntax delete mode 100644 syntaxes/fjsx15/function/parameters/destructuring/array.sublime-syntax delete mode 100644 syntaxes/fjsx15/function/parameters/destructuring/array/variable.sublime-syntax delete mode 100644 syntaxes/fjsx15/function/parameters/destructuring/object.sublime-syntax delete mode 100644 syntaxes/fjsx15/function/parameters/destructuring/object/property.sublime-syntax delete mode 100644 syntaxes/fjsx15/function/parameters/simple.sublime-syntax diff --git a/syntaxes/fjsx15/function/parameters/content.sublime-syntax b/syntaxes/fjsx15/function/parameters/content.sublime-syntax deleted file mode 100644 index 0b216822..00000000 --- a/syntaxes/fjsx15/function/parameters/content.sublime-syntax +++ /dev/null @@ -1,70 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - -contexts: - main: - - include: comment - - include: Packages/Naomi/syntaxes/fjsx15/operator/rest.sublime-syntax - # Parameter type. - - match: (?=\s*:) - set: associated-type - # Default value. - - match: (?=\s*=) - set: default-value - # Object destructuring. - - match: (?=\s*\{) - set: destructuring-object - # Array destructuring. - - match: (?=\s*\[) - set: destructuring-array - # Reserved word. - - match: \s*(arguments)(?=\W) - captures: - 1: keyword.other.js.fjsx15 - pop: true - # Parameter. - - include: Packages/Naomi/syntaxes/fjsx15/function/parameters/simple.sublime-syntax - - comment: - - include: Packages/Naomi/syntaxes/fjsx15/comment.sublime-syntax - - associated-type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax - - destructuring-object: - - include: Packages/Naomi/syntaxes/fjsx15/function/parameters/destructuring/object.sublime-syntax - - destructuring-array: - - include: Packages/Naomi/syntaxes/fjsx15/function/parameters/destructuring/array.sublime-syntax - - default-value: - - match: | - (?x) - (?=\s*(?>,|\))) - pop: true - - match: "" - push: - # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax - - match: "" - pop: true diff --git a/syntaxes/fjsx15/function/parameters/destructuring/array.sublime-syntax b/syntaxes/fjsx15/function/parameters/destructuring/array.sublime-syntax deleted file mode 100644 index 8a163ac8..00000000 --- a/syntaxes/fjsx15/function/parameters/destructuring/array.sublime-syntax +++ /dev/null @@ -1,85 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -contexts: - main: - - match: \s*(\[) - captures: - 1: >- - destructuring.array.js.fjsx15 - punctuation.definition.array.begin.js.fjsx15 - set: items - - items: - - match: \s*(,) - captures: - 1: >- - destructuring.array.js.fjsx15 - punctuation.definition.array.js.fjsx15 - - match: \s*(]) - captures: - 1: >- - destructuring.array.js.fjsx15 - punctuation.definition.array.end.js.fjsx15 - pop: true - - match: "" - push: - - match: | - (?x) - (?=\s* - (?> , - | ] - | \) - ) - ) - pop: true - - include: rest-operator - - include: comment - # Nested destructuring. - - include: Packages/Naomi/syntaxes/fjsx15/function/parameters/destructuring/array.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/function/parameters/destructuring/object.sublime-syntax - # Default value. - - match: (?=\s*=) - set: default-value - # Normal variables. - - include: Packages/Naomi/syntaxes/fjsx15/function/parameters/destructuring/array/variable.sublime-syntax - - rest-operator: - - include: Packages/Naomi/syntaxes/fjsx15/operator/rest.sublime-syntax - - default-value: - - match: | - (?x) - (?=\s* - (?> , - | ] - ) - ) - pop: true - - match: "" - push: - # - include: statement-and-expression - - match: "" - pop: true - - comment: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - - # statement-and-expression: - # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax diff --git a/syntaxes/fjsx15/function/parameters/destructuring/array/variable.sublime-syntax b/syntaxes/fjsx15/function/parameters/destructuring/array/variable.sublime-syntax deleted file mode 100644 index 35da5307..00000000 --- a/syntaxes/fjsx15/function/parameters/destructuring/array/variable.sublime-syntax +++ /dev/null @@ -1,53 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - -contexts: - main: - # Single character. - - match: | - (?xi)\s* - ((?> \$\B - | [_[:alpha:]]\b - )) - captures: - 1: >- - function.parameter.js.fjsx15 - destructuring.array.js.fjsx15 - entity.name.variable.js.fjsx15 - pop: true - # Two or more characters. - - match: | - (?xi)\s* - ( - {{commonIdentifier}} - (?> \$\B - | [_[:alnum:]]\b - ) - ) - captures: - 1: >- - function.parameter.js.fjsx15 - destructuring.array.js.fjsx15 - entity.name.variable.js.fjsx15 - pop: true diff --git a/syntaxes/fjsx15/function/parameters/destructuring/object.sublime-syntax b/syntaxes/fjsx15/function/parameters/destructuring/object.sublime-syntax deleted file mode 100644 index 5bbd118f..00000000 --- a/syntaxes/fjsx15/function/parameters/destructuring/object.sublime-syntax +++ /dev/null @@ -1,96 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - -contexts: - main: - - match: \s*(\{) - captures: - 1: >- - destructuring.object.js.fjsx15 - punctuation.definition.object.begin.js.fjsx15 - set: items - - items: - - match: \s*(,) - captures: - 1: >- - destructuring.object.js.fjsx15 - punctuation.definition.object.js.fjsx15 - - match: \s*(}) - captures: - 1: >- - destructuring.object.js.fjsx15 - punctuation.definition.object.end.js.fjsx15 - pop: true - - match: "" - push: - - match: | - (?x) - (?=\s* - (?> , - | } - ) - ) - pop: true - - include: rest-operator - - include: comment - # Default value. - - match: (?=\s*=) - set: default-value - # Property. - - include: Packages/Naomi/syntaxes/fjsx15/function/parameters/destructuring/object/property.sublime-syntax - # We can assume that the “:” is for a nested destructuring because otherwise - # the previous rule for properties would have consumed it. - - match: \s*(:) - captures: - 1: >- - destructuring.object.js.fjsx15 - keyword.operator.other.association.js.fjsx15 - # Nested destructuring. - - include: Packages/Naomi/syntaxes/fjsx15/function/parameters/destructuring/array.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/function/parameters/destructuring/object.sublime-syntax - - rest-operator: - - include: Packages/Naomi/syntaxes/fjsx15/operator/rest.sublime-syntax - - default-value: - - match: | - (?x) - (?=\s* - (?> , - | } - ) - ) - pop: true - - match: "" - push: - # - include: statement-and-expression - - match: "" - pop: true - - comment: - - include: Packages/Naomi/syntaxes/fjsx15/comment.sublime-syntax - - # statement-and-expression: - # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax diff --git a/syntaxes/fjsx15/function/parameters/destructuring/object/property.sublime-syntax b/syntaxes/fjsx15/function/parameters/destructuring/object/property.sublime-syntax deleted file mode 100644 index 1946b664..00000000 --- a/syntaxes/fjsx15/function/parameters/destructuring/object/property.sublime-syntax +++ /dev/null @@ -1,120 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - -contexts: - main: - # String property name. - - match: (?=\s*(?>'|"|`)) - set: [ - optional-alias, - string - ] - # Computed property name. - - match: \s*(\[) - captures: - 1: >- - destructuring.object.js.fjsx15 - punctuation.definition.object.computed-property.begin.js.fjsx15 - set: [ - optional-alias, - computed-property - ] - # Normal property with an alias. - - match: | - (?xi) - \s*({{commonIdentifier}}) - \s*(:) - \s*({{commonIdentifier}}) - captures: - 1: >- - destructuring.object.js.fjsx15 - object.property.js.fjsx15 - entity.name.variable.js.fjsx15 - 2: >- - destructuring.object.js.fjsx15 - keyword.operator.other.association.js.fjsx15 - 3: >- - function.parameter.js.fjsx15 - entity.name.variable.js.fjsx15 - pop: true - # Nested destructuring. - - match: | - (?xi)\s* - ({{commonIdentifier}}) - (?=\s*:) - captures: - 1: >- - destructuring.object.js.fjsx15 - object.property.js.fjsx15 - entity.name.variable.js.fjsx15 - pop: true - # Normal property. - - match: | - (?xi)\s* - ({{commonIdentifier}}) - (?!\s*:) - captures: - 1: >- - function.parameter.js.fjsx15 - entity.name.variable.js.fjsx15 - pop: true - - optional-alias: - - match: | - (?x) - \s*(:) - (?: - \s*({{commonIdentifier}}) - )? - captures: - 1: >- - destructuring.object.js.fjsx15 - keyword.operator.other.association.js.fjsx15 - 2: >- - function.parameter.js.fjsx15 - entity.name.variable.js.fjsx15 - pop: true - - match: (?=\s*\W) - pop: true - - string: - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/template.sublime-syntax - - computed-property: - - match: \s*(]) - captures: - 1: >- - destructuring.object.js.fjsx15 - punctuation.definition.object.computed-property.end.js.fjsx15 - pop: true - - match: "" - push: - - match: (?=\s*]) - pop: true - # - include: statement-and-expression - - # statement-and-expression: - # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax diff --git a/syntaxes/fjsx15/function/parameters/simple.sublime-syntax b/syntaxes/fjsx15/function/parameters/simple.sublime-syntax deleted file mode 100644 index 2acfcb52..00000000 --- a/syntaxes/fjsx15/function/parameters/simple.sublime-syntax +++ /dev/null @@ -1,37 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - -contexts: - main: - - match: | - (?xi)\s* - ({{commonIdentifier}})(\?)? - captures: - 1: >- - function.parameter.js.fjsx15 - entity.name.variable.js.fjsx15 - 2: >- - flowtype - keyword.operator.other.optional.flowtype - pop: true From 4f7bde231c044b57451158ed47eafc933d973938 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Fri, 8 Dec 2017 11:59:16 -0200 Subject: [PATCH 075/407] [FJSX15] Restore globals --- syntaxes/fjsx15/expression.sublime-syntax | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/expression.sublime-syntax b/syntaxes/fjsx15/expression.sublime-syntax index ef5e488b..e6ffde94 100644 --- a/syntaxes/fjsx15/expression.sublime-syntax +++ b/syntaxes/fjsx15/expression.sublime-syntax @@ -84,16 +84,26 @@ contexts: head: - include: comment-no-pop + # Library constants and function calls. + - include: Packages/Naomi/syntaxes/fjsx15/core.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/node-js.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/react-js.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/jest.sublime-syntax + # Normal expressions. - include: Packages/Naomi/syntaxes/fjsx15/literal.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/class.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function-call.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/core.sublime-syntax#constants - include: Packages/Naomi/syntaxes/fjsx15/constant.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/variable.sublime-syntax optional-tail: - include: comment-no-pop + # Library constants and function calls. + - include: Packages/Naomi/syntaxes/fjsx15/core.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/node-js.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/react-js.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/jest.sublime-syntax # Property access and function call. - match: (?=\s*[\[(]) set: [ optional-tail, tail ] From 17b7647f2f4aacc4b76422a4527df00f411de8b1 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Fri, 8 Dec 2017 12:01:26 -0200 Subject: [PATCH 076/407] [FJSX15] Move function.set to core --- syntaxes/fjsx15/core.sublime-syntax | 15 +++++++++++++++ syntaxes/fjsx15/function.sublime-syntax | 13 ------------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/syntaxes/fjsx15/core.sublime-syntax b/syntaxes/fjsx15/core.sublime-syntax index 13af3dc5..636ff715 100644 --- a/syntaxes/fjsx15/core.sublime-syntax +++ b/syntaxes/fjsx15/core.sublime-syntax @@ -28,6 +28,7 @@ contexts: # https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects - include: constants - include: functions + - include: function-properties - include: fundamental-objects - include: numbers-and-dates - include: text-processing @@ -241,6 +242,20 @@ contexts: entity.name.function.js.fjsx15 set: function-arguments + function-properties: + - match: | + (?x)\s* + (function)(.)(sent) + captures: + 1: >- + support.core.js.fjsx15 + entity.name.variable.js.fjsx15 + 2: keyword.operator.other.member-access.js.fjsx15 + 3: >- + support.core.js.fjsx15 + entity.name.variable.js.fjsx15 + pop: true + fundamental-objects: - match: | (?x)\s* diff --git a/syntaxes/fjsx15/function.sublime-syntax b/syntaxes/fjsx15/function.sublime-syntax index f388b74a..cc4370a6 100644 --- a/syntaxes/fjsx15/function.sublime-syntax +++ b/syntaxes/fjsx15/function.sublime-syntax @@ -24,19 +24,6 @@ variables: contexts: main: - # Function property. - - match: | - (?x)\s* - (function)(.)(sent) - captures: - 1: >- - support.core.js.fjsx15 - entity.name.variable.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 - 3: >- - support.core.js.fjsx15 - entity.name.variable.js.fjsx15 - pop: true # Function declaration. - match: | (?x)\s* From d4e2b4c1b869017bf4c976b856e2dfb6383f8312 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Fri, 8 Dec 2017 14:21:57 -0200 Subject: [PATCH 077/407] [FJSX15] Simplify globals --- syntaxes/fjsx15/expression.sublime-syntax | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/syntaxes/fjsx15/expression.sublime-syntax b/syntaxes/fjsx15/expression.sublime-syntax index e6ffde94..2691cf99 100644 --- a/syntaxes/fjsx15/expression.sublime-syntax +++ b/syntaxes/fjsx15/expression.sublime-syntax @@ -82,14 +82,15 @@ contexts: 1: punctuation.definition.expression.group.end.js.fjsx15 set: optional-tail - head: - - include: comment-no-pop - # Library constants and function calls. + globals: - include: Packages/Naomi/syntaxes/fjsx15/core.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/node-js.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/react-js.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/jest.sublime-syntax - # Normal expressions. + + head: + - include: comment-no-pop + - include: globals - include: Packages/Naomi/syntaxes/fjsx15/literal.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/class.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function.sublime-syntax @@ -99,11 +100,7 @@ contexts: optional-tail: - include: comment-no-pop - # Library constants and function calls. - - include: Packages/Naomi/syntaxes/fjsx15/core.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/node-js.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/react-js.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/jest.sublime-syntax + - include: globals # Property access and function call. - match: (?=\s*[\[(]) set: [ optional-tail, tail ] From b8ac3155785223d047fe0926e19fbda2a779bbf3 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Fri, 8 Dec 2017 14:24:04 -0200 Subject: [PATCH 078/407] [FJSX15] Restore function parameters --- .../optional-associated-type.sublime-syntax | 28 ++++++ .../destructuring/array.sublime-syntax | 57 ++++++++++++ .../destructuring/object.sublime-syntax | 64 +++++++++++++ .../object/property.sublime-syntax | 91 +++++++++++++++++++ .../function/parameter/simple.sublime-syntax | 50 ++++++++++ .../fjsx15/function/parameters.sublime-syntax | 37 ++++---- 6 files changed, 309 insertions(+), 18 deletions(-) create mode 100644 syntaxes/fjsx15/flowtype/optional-associated-type.sublime-syntax create mode 100644 syntaxes/fjsx15/function/parameter/destructuring/array.sublime-syntax create mode 100644 syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax create mode 100644 syntaxes/fjsx15/function/parameter/destructuring/object/property.sublime-syntax create mode 100644 syntaxes/fjsx15/function/parameter/simple.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/optional-associated-type.sublime-syntax b/syntaxes/fjsx15/flowtype/optional-associated-type.sublime-syntax new file mode 100644 index 00000000..3ba281c5 --- /dev/null +++ b/syntaxes/fjsx15/flowtype/optional-associated-type.sublime-syntax @@ -0,0 +1,28 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +contexts: + main: + - match: (?=\s*:) + set: associated-type + - match: (?=\s*\S) + pop: true + + associated-type: + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax diff --git a/syntaxes/fjsx15/function/parameter/destructuring/array.sublime-syntax b/syntaxes/fjsx15/function/parameter/destructuring/array.sublime-syntax new file mode 100644 index 00000000..2156f06a --- /dev/null +++ b/syntaxes/fjsx15/function/parameter/destructuring/array.sublime-syntax @@ -0,0 +1,57 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +contexts: + main: + - match: \s*(\[) + captures: + 1: >- + destructuring.array.js.fjsx15 + punctuation.definition.array.begin.js.fjsx15 + set: [ delimiters, optional-parameter ] + + delimiters: + - match: \s*(,) + captures: + 1: >- + destructuring.array.js.fjsx15 + punctuation.definition.array.js.fjsx15 + push: optional-parameter + - match: \s*(]) + captures: + 1: >- + destructuring.array.js.fjsx15 + punctuation.definition.array.end.js.fjsx15 + set: optional-default-value + + optional-parameter: + - include: comment-no-pop + - match: (?=\s*[)\]}]) + pop: true + - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/destructuring/array.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/simple.sublime-syntax + + optional-default-value: + - match: (?=\s*,) + pop: true + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax + + comment-no-pop: + - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax diff --git a/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax b/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax new file mode 100644 index 00000000..02cb3b3a --- /dev/null +++ b/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax @@ -0,0 +1,64 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + +contexts: + main: + - match: \s*(\{) + captures: + 1: >- + destructuring.object.js.fjsx15 + punctuation.definition.object.begin.js.fjsx15 + set: [ delimiters, optional-parameter ] + + delimiters: + - match: \s*(,) + captures: + 1: >- + destructuring.object.js.fjsx15 + punctuation.definition.object.js.fjsx15 + push: optional-parameter + - match: \s*(}) + captures: + 1: >- + destructuring.object.js.fjsx15 + punctuation.definition.object.end.js.fjsx15 + pop: true + + optional-parameter: + - include: comment-no-pop + - match: (?=\s*[)\]}]) + pop: true + - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/destructuring/object/property.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/destructuring/array.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/simple.sublime-syntax + + optional-default-value: + - match: (?=\s*,) + pop: true + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax + + comment-no-pop: + - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax + diff --git a/syntaxes/fjsx15/function/parameter/destructuring/object/property.sublime-syntax b/syntaxes/fjsx15/function/parameter/destructuring/object/property.sublime-syntax new file mode 100644 index 00000000..08aa51ba --- /dev/null +++ b/syntaxes/fjsx15/function/parameter/destructuring/object/property.sublime-syntax @@ -0,0 +1,91 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + +contexts: + main: + # String property name. + - match: (?=\s*(?>'|"|`)) + set: [ + optional-alias, + string + ] + # Computed property name. + - match: \s*(\[) + captures: + 1: >- + destructuring.object.js.fjsx15 + punctuation.definition.object.computed-property.begin.js.fjsx15 + set: [ + optional-alias, + computed-property-end, + optional-expression + ] + # Normal property with an alias. + - match: | + (?xi) + \s*({{commonIdentifier}}) + (?=\s*:) + captures: + 1: >- + destructuring.object.js.fjsx15 + object.property.js.fjsx15 + entity.name.variable.js.fjsx15 + set: optional-alias + + string: + - include: Packages/Naomi/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/literal/string/template.sublime-syntax + + optional-alias: + - match: \s*(:) + captures: + 1: >- + destructuring.object.js.fjsx15 + keyword.operator.other.association.js.fjsx15 + set: optional-parameter + - match: (?=\s*\S) + pop: true + + optional-parameter: + - include: comment-no-pop + - match: (?=\s*\)) + pop: true + - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/destructuring/array.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/simple.sublime-syntax + + comment-no-pop: + - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax + + optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax + + computed-property-end: + - match: \s*(]) + captures: + 1: >- + destructuring.object.js.fjsx15 + punctuation.definition.object.computed-property.end.js.fjsx15 + pop: true diff --git a/syntaxes/fjsx15/function/parameter/simple.sublime-syntax b/syntaxes/fjsx15/function/parameter/simple.sublime-syntax new file mode 100644 index 00000000..ecff36e8 --- /dev/null +++ b/syntaxes/fjsx15/function/parameter/simple.sublime-syntax @@ -0,0 +1,50 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + +contexts: + main: + - match: | + (?xi)\s* + (\.{3})? + ({{commonIdentifier}})(\?)? + captures: + 1: keyword.operator.other.rest.js.fjsx15 + 2: >- + function.parameter.js.fjsx15 + entity.name.variable.js.fjsx15 + 3: >- + flowtype + keyword.operator.other.optional.flowtype + set: [ + optional-default-value, + optional-type + ] + + optional-type: + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-associated-type.sublime-syntax + + optional-default-value: + - match: (?=\s*,) + pop: true + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/function/parameters.sublime-syntax b/syntaxes/fjsx15/function/parameters.sublime-syntax index 73135d41..17ccde11 100644 --- a/syntaxes/fjsx15/function/parameters.sublime-syntax +++ b/syntaxes/fjsx15/function/parameters.sublime-syntax @@ -22,29 +22,30 @@ contexts: - match: \s*(\() captures: 1: punctuation.definition.function.parameters.begin.js.fjsx15 - set: parameters + set: [ delimiters, optional-parameter ] - parameters: + delimiters: + - include: comment-no-pop - match: \s*(\,) captures: 1: punctuation.definition.function.parameters.js.fjsx15 + push: optional-parameter - match: \s*(\)) captures: 1: punctuation.definition.function.parameters.end.js.fjsx15 - set: return-type - # - match: "" - # push: - # - match: | - # (?x) - # (?=\s*(?>,|\))) - # pop: true - # - include: Packages/Naomi/syntaxes/fjsx15/function/parameters/content.sublime-syntax - - associated-type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax - - return-type: - - match: (?=\s*:) - set: associated-type - - match: "" + set: optional-return-type + + optional-parameter: + - include: comment-no-pop + - match: (?=\s*[,)]) pop: true + - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/destructuring/array.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/simple.sublime-syntax + + comment-no-pop: + - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax + + optional-return-type: + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-associated-type.sublime-syntax + From 3eae79ab9867484a44438396c75b2d1fc970d416 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Fri, 8 Dec 2017 15:31:20 -0200 Subject: [PATCH 079/407] [FJSX15] Simplify array destructuring --- .../fjsx15/destructuring/array.sublime-syntax | 68 ++++++------------- 1 file changed, 22 insertions(+), 46 deletions(-) diff --git a/syntaxes/fjsx15/destructuring/array.sublime-syntax b/syntaxes/fjsx15/destructuring/array.sublime-syntax index c2bd9526..7bfcd0b1 100644 --- a/syntaxes/fjsx15/destructuring/array.sublime-syntax +++ b/syntaxes/fjsx15/destructuring/array.sublime-syntax @@ -24,63 +24,39 @@ contexts: 1: >- destructuring.array.js.fjsx15 punctuation.definition.array.begin.js.fjsx15 - set: items - - items: + set: [ + delimiters, + optional-expression, + optional-type, + optional-variable + ] + + delimiters: - match: \s*(,) captures: 1: >- destructuring.array.js.fjsx15 punctuation.definition.array.js.fjsx15 + push: [ + optional-expression, + optional-type, + optional-variable + ] - match: \s*(]) captures: 1: >- destructuring.array.js.fjsx15 punctuation.definition.array.end.js.fjsx15 pop: true - - match: "" - push: - - match: | - (?x) - (?=\s* - (?> , - | ] - | \) - ) - ) - pop: true - - include: rest-operator - - include: comment - # Nested destructuring. - - include: Packages/Naomi/syntaxes/fjsx15/destructuring/array.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/destructuring/object.sublime-syntax - # Default value. - - match: (?=\s*=) - set: default-value - # Normal variables and constants. - - include: Packages/Naomi/syntaxes/fjsx15/constant.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/variable.sublime-syntax - - rest-operator: - - include: Packages/Naomi/syntaxes/fjsx15/operator/rest.sublime-syntax - default-value: - - match: | - (?x) - (?=\s* - (?> , - | ] - ) - ) - pop: true - - match: "" - push: - # - include: statement-and-expression - - match: "" - pop: true + optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax - comment: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax + optional-type: + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-associated-type.sublime-syntax - # statement-and-expression: - # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + optional-variable: + - match: (?=\s*[,)\]}]) + pop: true + - include: Packages/Naomi/syntaxes/fjsx15/constant.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/variable.sublime-syntax From add2f50c13f9d2f7bf7d02e7465e200158a5992b Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Fri, 8 Dec 2017 16:01:11 -0200 Subject: [PATCH 080/407] [FJSX15] Simplify variable declaration --- .../variable-declaration.sublime-syntax | 40 +++++-------------- 1 file changed, 10 insertions(+), 30 deletions(-) diff --git a/syntaxes/fjsx15/variable-declaration.sublime-syntax b/syntaxes/fjsx15/variable-declaration.sublime-syntax index e2776b6c..ffdfc3f1 100644 --- a/syntaxes/fjsx15/variable-declaration.sublime-syntax +++ b/syntaxes/fjsx15/variable-declaration.sublime-syntax @@ -19,40 +19,20 @@ scope: ... contexts: main: - # Destructuring object. - - match: | - (?x) - (?=\s*(?>const|let|var)\s+\{) - set: [ - destructuring-object, - keyword - ] - # Destructuring array. - - match: | - (?x) - (?=\s*(?>const|let|var)\s+\[) - set: [ - destructuring-array, - keyword - ] - # Simple variable. - match: | (?x) (?=\s*(?>const|let|var)\s+) set: [ optional-type, - variable-or-constant, + optional-variables, keyword ] - destructuring-object: - - include: Packages/Naomi/syntaxes/fjsx15/destructuring/object.sublime-syntax - - destructuring-array: - - include: Packages/Naomi/syntaxes/fjsx15/destructuring/array.sublime-syntax + comment-no-pop: + - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax keyword: - # - include: comment-no-pop + - include: comment-no-pop - match: | (?x)\s* ((?>const|let|var)) @@ -62,13 +42,13 @@ contexts: keyword.declaration.variable.js.fjsx15 pop: true - variable-or-constant: - # - include: comment + optional-variables: + - include: comment-no-pop + - include: Packages/Naomi/syntaxes/fjsx15/destructuring/array.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/destructuring/object.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/constant.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/variable.sublime-syntax optional-type: - # - include: comment-no-pop - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax - - match: (?=\s*\S) - pop: true + - include: comment-no-pop + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-associated-type.sublime-syntax From 52030a2e5e0f68881d347d060e20902e98b8af76 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Fri, 8 Dec 2017 16:03:11 -0200 Subject: [PATCH 081/407] [FJSX15] Make parameter destructuring loose --- .../function/parameter/destructuring/array.sublime-syntax | 2 +- .../function/parameter/destructuring/object.sublime-syntax | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/syntaxes/fjsx15/function/parameter/destructuring/array.sublime-syntax b/syntaxes/fjsx15/function/parameter/destructuring/array.sublime-syntax index 2156f06a..7984ee9d 100644 --- a/syntaxes/fjsx15/function/parameter/destructuring/array.sublime-syntax +++ b/syntaxes/fjsx15/function/parameter/destructuring/array.sublime-syntax @@ -42,7 +42,7 @@ contexts: optional-parameter: - include: comment-no-pop - - match: (?=\s*[)\]}]) + - match: (?=\s*[,)\]}]) pop: true - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/destructuring/array.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax diff --git a/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax b/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax index 02cb3b3a..0f7263f4 100644 --- a/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax +++ b/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax @@ -47,7 +47,7 @@ contexts: optional-parameter: - include: comment-no-pop - - match: (?=\s*[)\]}]) + - match: (?=\s*[,)\]}]) pop: true - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/destructuring/object/property.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/destructuring/array.sublime-syntax From 0750f6e1956725d63e8a75ba0943071b12e9c423 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Fri, 8 Dec 2017 16:03:25 -0200 Subject: [PATCH 082/407] [FJSX15] Remove dead code --- .../fjsx15/function/parameters.sublime-syntax | 1 - syntaxes/fjsx15/operator/rest.sublime-syntax | 28 ------------------- 2 files changed, 29 deletions(-) delete mode 100644 syntaxes/fjsx15/operator/rest.sublime-syntax diff --git a/syntaxes/fjsx15/function/parameters.sublime-syntax b/syntaxes/fjsx15/function/parameters.sublime-syntax index 17ccde11..75b0e9fa 100644 --- a/syntaxes/fjsx15/function/parameters.sublime-syntax +++ b/syntaxes/fjsx15/function/parameters.sublime-syntax @@ -48,4 +48,3 @@ contexts: optional-return-type: - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-associated-type.sublime-syntax - diff --git a/syntaxes/fjsx15/operator/rest.sublime-syntax b/syntaxes/fjsx15/operator/rest.sublime-syntax deleted file mode 100644 index 65636c3a..00000000 --- a/syntaxes/fjsx15/operator/rest.sublime-syntax +++ /dev/null @@ -1,28 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -contexts: - main: - - match: \s*(\.{3}) - captures: - 1: keyword.operator.other.rest.js.fjsx15 - set: optional-expression - - optional-expression: - - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax From 0946ed7b0792ff4c7b67b05709d379b9748db613 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Fri, 8 Dec 2017 16:06:17 -0200 Subject: [PATCH 083/407] [FJSX15] Fix keyword detection --- syntaxes/fjsx15/variable-declaration.sublime-syntax | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/variable-declaration.sublime-syntax b/syntaxes/fjsx15/variable-declaration.sublime-syntax index ffdfc3f1..202a2e1e 100644 --- a/syntaxes/fjsx15/variable-declaration.sublime-syntax +++ b/syntaxes/fjsx15/variable-declaration.sublime-syntax @@ -21,7 +21,7 @@ contexts: main: - match: | (?x) - (?=\s*(?>const|let|var)\s+) + (?=\s*(?>const|let|var)\b) set: [ optional-type, optional-variables, From d392ffbdff5d98a8dd955224d4eb9b823bad12af Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Fri, 8 Dec 2017 16:10:50 -0200 Subject: [PATCH 084/407] [FJSX15] Fix destructuring logic --- .../fjsx15/destructuring/array.sublime-syntax | 2 + .../destructuring/object.sublime-syntax | 66 +++++------------ .../object/property.sublime-syntax | 74 +++++++------------ 3 files changed, 44 insertions(+), 98 deletions(-) diff --git a/syntaxes/fjsx15/destructuring/array.sublime-syntax b/syntaxes/fjsx15/destructuring/array.sublime-syntax index 7bfcd0b1..91666cf2 100644 --- a/syntaxes/fjsx15/destructuring/array.sublime-syntax +++ b/syntaxes/fjsx15/destructuring/array.sublime-syntax @@ -58,5 +58,7 @@ contexts: optional-variable: - match: (?=\s*[,)\]}]) pop: true + - include: Packages/Naomi/syntaxes/fjsx15/destructuring/array.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/destructuring/object.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/constant.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/variable.sublime-syntax diff --git a/syntaxes/fjsx15/destructuring/object.sublime-syntax b/syntaxes/fjsx15/destructuring/object.sublime-syntax index 1c95685c..3431df7e 100644 --- a/syntaxes/fjsx15/destructuring/object.sublime-syntax +++ b/syntaxes/fjsx15/destructuring/object.sublime-syntax @@ -29,68 +29,36 @@ contexts: 1: >- destructuring.object.js.fjsx15 punctuation.definition.object.begin.js.fjsx15 - set: items + set: [ delimiters, optional-variable ] - items: + delimiters: - match: \s*(,) captures: 1: >- destructuring.object.js.fjsx15 punctuation.definition.object.js.fjsx15 + push: optional-variable - match: \s*(}) captures: 1: >- destructuring.object.js.fjsx15 punctuation.definition.object.end.js.fjsx15 pop: true - - match: "" - push: - - match: | - (?x) - (?=\s* - (?> , - | } - ) - ) - pop: true - - include: rest-operator - - include: comment - # Default value. - - match: (?=\s*=) - set: default-value - # Property. - - include: Packages/Naomi/syntaxes/fjsx15/destructuring/object/property.sublime-syntax - # We can assume that the “:” is for a nested destructuring because otherwise - # the previous rule for properties would have consumed it. - - match: \s*(:) - captures: - 1: >- - destructuring.object.js.fjsx15 - keyword.operator.other.association.js.fjsx15 - # Nested destructuring. - - include: Packages/Naomi/syntaxes/fjsx15/destructuring/array.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/destructuring/object.sublime-syntax - rest-operator: - - include: Packages/Naomi/syntaxes/fjsx15/operator/rest.sublime-syntax - - default-value: - - match: | - (?x) - (?=\s* - (?> , - | } - ) - ) + optional-variable: + - include: comment-no-pop + - match: (?=\s*[,)\]}]) pop: true - - match: "" - push: - # - include: statement-and-expression - - match: "" - pop: true + - include: Packages/Naomi/syntaxes/fjsx15/destructuring/object/property.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/destructuring/array.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/destructuring/object.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/constant.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/variable.sublime-syntax - comment: - - include: Packages/Naomi/syntaxes/fjsx15/comment.sublime-syntax + optional-default-value: + - match: (?=\s*,) + pop: true + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax - # statement-and-expression: - # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + comment-no-pop: + - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax diff --git a/syntaxes/fjsx15/destructuring/object/property.sublime-syntax b/syntaxes/fjsx15/destructuring/object/property.sublime-syntax index a5ab22fe..08aa51ba 100644 --- a/syntaxes/fjsx15/destructuring/object/property.sublime-syntax +++ b/syntaxes/fjsx15/destructuring/object/property.sublime-syntax @@ -38,78 +38,54 @@ contexts: punctuation.definition.object.computed-property.begin.js.fjsx15 set: [ optional-alias, - computed-property + computed-property-end, + optional-expression ] - # Accessing sub-property. + # Normal property with an alias. - match: | (?xi) \s*({{commonIdentifier}}) - \s*(:) - (?=\s*\{) + (?=\s*:) captures: 1: >- destructuring.object.js.fjsx15 object.property.js.fjsx15 entity.name.variable.js.fjsx15 - 2: >- - destructuring.object.js.fjsx15 - keyword.operator.other.association.js.fjsx15 - pop: true - # Aliasing. - - match: | - (?xi) - \s*({{commonIdentifier}}) - \s*(:) - (?=\s*({{commonIdentifier}})) - captures: - 1: >- - destructuring.object.js.fjsx15 - object.property.js.fjsx15 - entity.name.variable.js.fjsx15 - 2: >- - destructuring.object.js.fjsx15 - keyword.operator.other.association.js.fjsx15 - push: constant-or-variable - # Normal property. - - include: constant-or-variable + set: optional-alias - constant-or-variable: - - include: Packages/Naomi/syntaxes/fjsx15/constant.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/variable.sublime-syntax + string: + - include: Packages/Naomi/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/literal/string/template.sublime-syntax optional-alias: - - match: | - (?x) - \s*(:) - (?: - \s*({{commonIdentifier}}) - )? + - match: \s*(:) captures: 1: >- destructuring.object.js.fjsx15 keyword.operator.other.association.js.fjsx15 - 2: entity.name.variable.js.fjsx15 + set: optional-parameter + - match: (?=\s*\S) pop: true - - match: (?=\s*\W) + + optional-parameter: + - include: comment-no-pop + - match: (?=\s*\)) pop: true + - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/destructuring/array.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/simple.sublime-syntax - string: - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/template.sublime-syntax + comment-no-pop: + - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax + + optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax - computed-property: + computed-property-end: - match: \s*(]) captures: 1: >- destructuring.object.js.fjsx15 punctuation.definition.object.computed-property.end.js.fjsx15 pop: true - - match: "" - push: - - match: (?=\s*]) - pop: true - # - include: statement-and-expression - - # statement-and-expression: - # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax From 7243e50cc9602508180f093df638a45a1dc881f3 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Fri, 8 Dec 2017 21:48:43 -0200 Subject: [PATCH 085/407] [FJSX15] Fix react arguments scope --- .../function-call/support/react-js-arguments.sublime-syntax | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/syntaxes/fjsx15/function-call/support/react-js-arguments.sublime-syntax b/syntaxes/fjsx15/function-call/support/react-js-arguments.sublime-syntax index d355145c..57762a66 100644 --- a/syntaxes/fjsx15/function-call/support/react-js-arguments.sublime-syntax +++ b/syntaxes/fjsx15/function-call/support/react-js-arguments.sublime-syntax @@ -22,7 +22,7 @@ contexts: - match: \s*(\() captures: 1: >- - support.lib.jest.fjsx15 + support.lib.react-js.fjsx15 punctuation.definition.function.arguments.begin.js.fjsx15 set: [ delimiter, optional-expression ] @@ -30,13 +30,13 @@ contexts: - match: \s*(\)) captures: 1: >- - support.lib.jest.fjsx15 + support.lib.react-js.fjsx15 punctuation.definition.function.arguments.end.js.fjsx15 pop: true - match: \s*(,) captures: 1: >- - support.lib.jest.fjsx15 + support.lib.react-js.fjsx15 punctuation.definition.function.arguments.js.fjsx15 push: optional-expression From 26bcd2695d60f3f4b2c5f6cdf2ede06f0963fbc8 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Fri, 8 Dec 2017 21:50:17 -0200 Subject: [PATCH 086/407] [FJSX15] Simplify support parameters --- .../support/parameters.sublime-syntax | 33 ++++++++----------- .../react-js-parameters.sublime-syntax | 32 ++++++++---------- 2 files changed, 27 insertions(+), 38 deletions(-) diff --git a/syntaxes/fjsx15/function/support/parameters.sublime-syntax b/syntaxes/fjsx15/function/support/parameters.sublime-syntax index 7217a4b7..8245cf5e 100644 --- a/syntaxes/fjsx15/function/support/parameters.sublime-syntax +++ b/syntaxes/fjsx15/function/support/parameters.sublime-syntax @@ -24,33 +24,28 @@ contexts: 1: >- support.core.js.fjsx15 punctuation.definition.function.parameters.begin.js.fjsx15 - set: parameters + set: [ delimiters, optional-parameter ] - parameters: + delimiters: + - include: comment-no-pop - match: \s*(\,) captures: 1: >- support.core.js.fjsx15 punctuation.definition.function.parameters.js.fjsx15 + push: optional-parameter - match: \s*(\)) captures: 1: >- support.core.js.fjsx15 punctuation.definition.function.parameters.end.js.fjsx15 - set: return-type - - match: "" - push: - - match: | - (?x) - (?=\s*(?>,|\))) - pop: true - - include: Packages/Naomi/syntaxes/fjsx15/function/parameters/content.sublime-syntax - - associated-type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax - - return-type: - - match: (?=\s*:) - set: associated-type - - match: "" - pop: true + set: optional-return-type + + optional-parameter: + - include: Packages/Naomi/syntaxes/fjsx15/function/parameters.sublime-syntax#optional-parameter + + comment-no-pop: + - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax + + optional-return-type: + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-associated-type.sublime-syntax diff --git a/syntaxes/fjsx15/function/support/react-js-parameters.sublime-syntax b/syntaxes/fjsx15/function/support/react-js-parameters.sublime-syntax index 0f6e37cb..bf1ae185 100644 --- a/syntaxes/fjsx15/function/support/react-js-parameters.sublime-syntax +++ b/syntaxes/fjsx15/function/support/react-js-parameters.sublime-syntax @@ -24,33 +24,27 @@ contexts: 1: >- support.lib.react-js.js.fjsx15 punctuation.definition.function.parameters.begin.js.fjsx15 - set: parameters + set: [ delimiters, optional-parameter ] - parameters: + delimiters: - match: \s*(\,) captures: 1: >- support.lib.react-js.js.fjsx15 punctuation.definition.function.parameters.js.fjsx15 + push: optional-parameter - match: \s*(\)) captures: 1: >- support.lib.react-js.js.fjsx15 punctuation.definition.function.parameters.end.js.fjsx15 - set: return-type - - match: "" - push: - - match: | - (?x) - (?=\s*(?>,|\))) - pop: true - - include: Packages/Naomi/syntaxes/fjsx15/function/parameters/content.sublime-syntax - - associated-type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax - - return-type: - - match: (?=\s*:) - set: associated-type - - match: "" - pop: true + set: optional-return-type + + optional-parameter: + - include: Packages/Naomi/syntaxes/fjsx15/function/parameters.sublime-syntax#optional-parameter + + comment-no-pop: + - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax + + optional-return-type: + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-associated-type.sublime-syntax From c4eb31d40c6cac1b2f20f9990fa0e3d2a770cc6f Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Fri, 8 Dec 2017 22:05:01 -0200 Subject: [PATCH 087/407] [FJSX15] Remove flow type This is a temporary action to simplify the syntax. --- .../fjsx15/flowtype/callable.sublime-syntax | 42 ----- syntaxes/fjsx15/flowtype/cast.sublime-syntax | 32 ---- .../co-contravariant.no-pop.sublime-syntax | 31 ---- .../fjsx15/flowtype/declare.sublime-syntax | 52 ------ syntaxes/fjsx15/flowtype/field.sublime-syntax | 49 ----- .../flowtype/function.no-pop.sublime-syntax | 50 ----- .../fjsx15/flowtype/function.sublime-syntax | 50 ----- .../function/declaration.sublime-syntax | 47 ----- .../function/parameters.sublime-syntax | 60 ------ .../function/parameters/simple.sublime-syntax | 39 ---- .../fjsx15/flowtype/indexer.sublime-syntax | 97 ---------- .../fjsx15/flowtype/interface.sublime-syntax | 122 ------------- .../fjsx15/flowtype/module.sublime-syntax | 77 -------- .../namespace-path.no-pop.sublime-syntax | 88 --------- .../fjsx15/flowtype/object.sublime-syntax | 171 ------------------ .../optional-associated-type.sublime-syntax | 28 --- .../fjsx15/flowtype/prolog.sublime-syntax | 31 ---- .../fjsx15/flowtype/simple.sublime-syntax | 94 ---------- .../template/arguments.no-pop.sublime-syntax | 27 --- .../template/arguments.sublime-syntax | 45 ----- .../template/parameters.sublime-syntax | 45 ----- syntaxes/fjsx15/flowtype/tuple.sublime-syntax | 45 ----- .../flowtype/type-aliasing.sublime-syntax | 78 -------- .../flowtype/typeof.no-pop.sublime-syntax | 29 --- 24 files changed, 1429 deletions(-) delete mode 100644 syntaxes/fjsx15/flowtype/callable.sublime-syntax delete mode 100644 syntaxes/fjsx15/flowtype/cast.sublime-syntax delete mode 100644 syntaxes/fjsx15/flowtype/co-contravariant.no-pop.sublime-syntax delete mode 100644 syntaxes/fjsx15/flowtype/declare.sublime-syntax delete mode 100644 syntaxes/fjsx15/flowtype/field.sublime-syntax delete mode 100644 syntaxes/fjsx15/flowtype/function.no-pop.sublime-syntax delete mode 100644 syntaxes/fjsx15/flowtype/function.sublime-syntax delete mode 100644 syntaxes/fjsx15/flowtype/function/declaration.sublime-syntax delete mode 100644 syntaxes/fjsx15/flowtype/function/parameters.sublime-syntax delete mode 100644 syntaxes/fjsx15/flowtype/function/parameters/simple.sublime-syntax delete mode 100644 syntaxes/fjsx15/flowtype/indexer.sublime-syntax delete mode 100644 syntaxes/fjsx15/flowtype/interface.sublime-syntax delete mode 100644 syntaxes/fjsx15/flowtype/module.sublime-syntax delete mode 100644 syntaxes/fjsx15/flowtype/namespace-path.no-pop.sublime-syntax delete mode 100644 syntaxes/fjsx15/flowtype/object.sublime-syntax delete mode 100644 syntaxes/fjsx15/flowtype/optional-associated-type.sublime-syntax delete mode 100644 syntaxes/fjsx15/flowtype/prolog.sublime-syntax delete mode 100644 syntaxes/fjsx15/flowtype/simple.sublime-syntax delete mode 100644 syntaxes/fjsx15/flowtype/template/arguments.no-pop.sublime-syntax delete mode 100644 syntaxes/fjsx15/flowtype/template/arguments.sublime-syntax delete mode 100644 syntaxes/fjsx15/flowtype/template/parameters.sublime-syntax delete mode 100644 syntaxes/fjsx15/flowtype/tuple.sublime-syntax delete mode 100644 syntaxes/fjsx15/flowtype/type-aliasing.sublime-syntax delete mode 100644 syntaxes/fjsx15/flowtype/typeof.no-pop.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/callable.sublime-syntax b/syntaxes/fjsx15/flowtype/callable.sublime-syntax deleted file mode 100644 index 98ab3bef..00000000 --- a/syntaxes/fjsx15/flowtype/callable.sublime-syntax +++ /dev/null @@ -1,42 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -variables: - parameters: | - (\( - [^()]* - \g<-1>? - [^()]* - \)) - -contexts: - main: - - match: | - (?x) - (?={{parameters}}\s*:) - set: [ - return-type, - parameters - ] - - return-type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax - - parameters: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/function/parameters.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/cast.sublime-syntax b/syntaxes/fjsx15/flowtype/cast.sublime-syntax deleted file mode 100644 index 042a7ae3..00000000 --- a/syntaxes/fjsx15/flowtype/cast.sublime-syntax +++ /dev/null @@ -1,32 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -contexts: - main: - - match: | - (?x) - \s*(:) - captures: - 1: >- - flowtype - keyword.operator.other.cast.flowtype - set: type - - type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/co-contravariant.no-pop.sublime-syntax b/syntaxes/fjsx15/flowtype/co-contravariant.no-pop.sublime-syntax deleted file mode 100644 index 755ead14..00000000 --- a/syntaxes/fjsx15/flowtype/co-contravariant.no-pop.sublime-syntax +++ /dev/null @@ -1,31 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -contexts: - main: - - match: \s*(\+)(?!(?>\+|=)) - captures: - 1: >- - flowtype - keyword.operator.other.covariant.flowtype - - match: \s*(-)(?!(?>-|=)) - captures: - 1: >- - flowtype - keyword.operator.other.contravariant.flowtype diff --git a/syntaxes/fjsx15/flowtype/declare.sublime-syntax b/syntaxes/fjsx15/flowtype/declare.sublime-syntax deleted file mode 100644 index 4e439fd4..00000000 --- a/syntaxes/fjsx15/flowtype/declare.sublime-syntax +++ /dev/null @@ -1,52 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -contexts: - main: - - match: \s*(declare)\b - captures: - 1: >- - flowtype - keyword.declaration.js.fjsx15 - set: declarations - - declarations: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type-aliasing.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/module.sublime-syntax - # Export object literal. - - match: | - (?x) - \s*(export) - \s*(default) - (?=\s*{) - captures: - 1: keyword.control.export.js.fjsx15 - 2: >- - storage.modifier.js.fjsx15 - keyword.control.export.default.js.fjsx15 - set: flow-object - # Norma export. - - include: Packages/Naomi/syntaxes/fjsx15/export.sublime-syntax - # Other statements and expected expressions. - - include: Packages/Naomi/syntaxes/fjsx15/class.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/function.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/variable-declaration.sublime-syntax - - flow-object: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/object.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/field.sublime-syntax b/syntaxes/fjsx15/flowtype/field.sublime-syntax deleted file mode 100644 index 863ff336..00000000 --- a/syntaxes/fjsx15/flowtype/field.sublime-syntax +++ /dev/null @@ -1,49 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - -contexts: - main: - - match: | - (?xi) - (?:\s* - (?>(\+)|(-)) - )? - \s*({{commonIdentifier}}) - \s*(\?)? - (?=\s*:) - captures: - 1: >- - flowtype - keyword.operator.other.covariant.flowtype - 2: >- - flowtype - keyword.operator.other.contravariant.flowtype - 3: entity.name.variable.js.fjsx15 - 4: >- - flowtype - keyword.operator.other.optional.flowtype - set: type - - type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/function.no-pop.sublime-syntax b/syntaxes/fjsx15/flowtype/function.no-pop.sublime-syntax deleted file mode 100644 index 5de1cf89..00000000 --- a/syntaxes/fjsx15/flowtype/function.no-pop.sublime-syntax +++ /dev/null @@ -1,50 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -variables: - templateArguments: | - (< - [^<>]* - \g<-1>? - [^<>]* - >) - - parameters: | - (\( - [^()]* - \g<-1>? - [^()]* - \)) - - flowFunction: | - {{parameters}} - \s*=>\s* - -contexts: - main: - - match: | - (?xi) - (?=\s* - {{templateArguments}}? - {{flowFunction}} - ) - push: declaration - - declaration: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/function/declaration.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/function.sublime-syntax b/syntaxes/fjsx15/flowtype/function.sublime-syntax deleted file mode 100644 index 8a2da9a0..00000000 --- a/syntaxes/fjsx15/flowtype/function.sublime-syntax +++ /dev/null @@ -1,50 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -variables: - templateArguments: | - (< - [^<>]* - \g<-1>? - [^<>]* - >) - - parameters: | - (\( - [^()]* - \g<-1>? - [^()]* - \)) - - flowFunction: | - {{parameters}} - \s*=>\s* - -contexts: - main: - - match: | - (?xi) - (?=\s* - {{templateArguments}}? - {{flowFunction}} - ) - set: declaration - - declaration: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/function/declaration.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/function/declaration.sublime-syntax b/syntaxes/fjsx15/flowtype/function/declaration.sublime-syntax deleted file mode 100644 index 86b6d00b..00000000 --- a/syntaxes/fjsx15/flowtype/function/declaration.sublime-syntax +++ /dev/null @@ -1,47 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -contexts: - main: - # Template parameters. - - match: (?=\s*<) - push: template-arguments - # Parameters. - - match: (?=\s*\() - set: [ - return, - parameters - ] - - template-arguments: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/arguments.sublime-syntax - - parameters: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/function/parameters.sublime-syntax - - return: - - match: \s*(=>) - captures: - 1: >- - flowtype - punctuation.definition.function.result.flowtype - set: return-type - - return-type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/function/parameters.sublime-syntax b/syntaxes/fjsx15/flowtype/function/parameters.sublime-syntax deleted file mode 100644 index 6bd8f072..00000000 --- a/syntaxes/fjsx15/flowtype/function/parameters.sublime-syntax +++ /dev/null @@ -1,60 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -contexts: - main: - - match: \s*(\() - captures: - 1: >- - flowtype - punctuation.definition.function.parameters.begin.flowtype - set: parameters - - parameters: - - match: \s*(,) - captures: - 1: >- - flowtype - punctuation.definition.function.parameters.flowtype - - match: \s*(\)) - captures: - 1: >- - flowtype - punctuation.definition.function.parameters.end.flowtype - pop: true - - match: "" - push: - - include: comment - # Rest. - - match: \s*(\.{3}) - captures: - 1: >- - flowtype - keyword.operator.other.rest.flowtype - # Parameter. - - include: Packages/Naomi/syntaxes/fjsx15/function/parameters/simple.sublime-syntax - # Type after parameter. - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax - # Type highlighted without the parameter. - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type.sublime-syntax - - match: "" - pop: true - - comment: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/function/parameters/simple.sublime-syntax b/syntaxes/fjsx15/flowtype/function/parameters/simple.sublime-syntax deleted file mode 100644 index 68e71023..00000000 --- a/syntaxes/fjsx15/flowtype/function/parameters/simple.sublime-syntax +++ /dev/null @@ -1,39 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - -contexts: - main: - - match: | - (?xi)\s* - ({{commonIdentifier}})(\?)? - (?=\s*:) - captures: - 1: >- - flowtype - function.parameter.js.fjsx15 - entity.name.variable.js.fjsx15 - 2: >- - flowtype - keyword.operator.other.optional.flowtype - pop: true diff --git a/syntaxes/fjsx15/flowtype/indexer.sublime-syntax b/syntaxes/fjsx15/flowtype/indexer.sublime-syntax deleted file mode 100644 index f8a0145c..00000000 --- a/syntaxes/fjsx15/flowtype/indexer.sublime-syntax +++ /dev/null @@ -1,97 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - - constantIdentifier: | - [$_[:upper:]] - [$_[:upper:][:digit:]]* - -contexts: - main: - - match: | - (?x)^ - (?:\s* - (?>(\+)|(-)) - )? - \s*(\[) - captures: - 1: >- - flowtype - keyword.operator.other.covariant.flowtype - 2: >- - flowtype - keyword.operator.other.contravariant.flowtype - 3: >- - flowtype - punctuation.definition.object.indexer.flowtype - set: [ - associated-type, - indexer-end, - named-or-anonymous - ] - - indexer-end: - - match: \s*(]) - captures: - 1: >- - flowtype - punctuation.definition.object.indexer.flowtype - pop: true - - named-or-anonymous: - - include: comment - # Named indexers are similar to function’s parameters. - - match: | - (?xi)\s* - ({{commonIdentifier}})(\?)? - (?=\s*:) - captures: - 1: >- - function.parameter.js.fjsx15 - entity.name.variable.js.fjsx15 - 2: >- - flowtype - keyword.operator.other.optional.flowtype - set: associated-type - # Strings. - - match: (?=\s*(?>'|"|`)) - set: [ - associated-type, - string - ] - # Simple type. - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type.sublime-syntax - - string: - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/template.sublime-syntax - - associated-type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax - - type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type.sublime-syntax - - comment: - - include: Packages/Naomi/syntaxes/fjsx15/comment.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/interface.sublime-syntax b/syntaxes/fjsx15/flowtype/interface.sublime-syntax deleted file mode 100644 index 03836ff4..00000000 --- a/syntaxes/fjsx15/flowtype/interface.sublime-syntax +++ /dev/null @@ -1,122 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - -contexts: - main: - - match: \s*(interface)\b - captures: - 1: >- - flowtype - storage.type.flowtype - keyword.declaration.interface.flowtype - set: identifier - - identifier: - - include: comment - - match: (?=\s*extends\b) - set: [ - body, - extension - ] - - match: (?=\s*\{) - set: body - # Actual identifier. - - match: (?xi)\s*({{commonIdentifier}}) - captures: - 1: >- - flowtype - entity.name.interface.flowtype - set: optional-template-parameters - - extension: - - include: comment - - match: \s*(extends)\b - captures: - 1: >- - flowtype - storage.modifier.flowtype - keyword.extension.flowtype - set: type - - type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type.sublime-syntax - - template-parameters: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/parameters.sublime-syntax - - optional-template-parameters: - - include: comment - - match: (?=\s*<) - set: [ - optional-extension, - template-parameters - ] - - match: (?=\s*extends\b) - set: [ - body, - extension - ] - - match: (?=\s*\{) - set: body - - optional-extension: - - include: comment - - match: (?=\s*extends\b) - set: [ - body, - extension - ] - - match: (?=\s*\{) - set: body - - body: - - include: comment - - match: \s*(\{) - captures: - 1: >- - flowtype - punctuation.definition.interface.body.begin.flowtype - set: body-content - - body-content: - - include: comment - - match: \s*(}) - captures: - 1: >- - flowtype - punctuation.definition.interface.body.end.flowtype - pop: true - - match: "" - push: - - match: (?=\s*}) - pop: true - - include: Packages/Naomi/syntaxes/fjsx15/comment.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/field.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/indexer.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/class/method.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/class/property.sublime-syntax - # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax - - comment: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/module.sublime-syntax b/syntaxes/fjsx15/flowtype/module.sublime-syntax deleted file mode 100644 index ae143b51..00000000 --- a/syntaxes/fjsx15/flowtype/module.sublime-syntax +++ /dev/null @@ -1,77 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - -contexts: - main: - - match: | - (?xi)\s* - (module) - captures: - 1: >- - flowtype - storage.type.flowtype - keyword.declaration.type-aliasing.flowtype - set: [ - body, - identifier - ] - - identifier: - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/template.sublime-syntax - - match: | - (?xi)\a* - ({{commonIdentifier}}) - captures: - 1: >- - flowtype - entity.name.module.flowtype - pop: true - - body: - - include: comment - - match: \s*(\{) - captures: - 1: >- - flowtype - punctuation.definition.module.body.begin.flowtype - set: body-content - - body-content: - - include: comment - - match: \s*(}) - captures: - 1: >- - flowtype - punctuation.definition.module.body.end.flowtype - pop: true - - match: "" - push: - # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax - - match: "" - pop: true - - comment: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/namespace-path.no-pop.sublime-syntax b/syntaxes/fjsx15/flowtype/namespace-path.no-pop.sublime-syntax deleted file mode 100644 index 6529c008..00000000 --- a/syntaxes/fjsx15/flowtype/namespace-path.no-pop.sublime-syntax +++ /dev/null @@ -1,88 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - -contexts: - # Javascript/flow don’t have namespaces, this is just a visual cue to highlight - # only the last element when a type is expected. - main: - # Namespace delimited by dots. - - match: | - (?xi)\s* - (?> - (?:\b - ({{commonIdentifier}})(\??\.) - ({{commonIdentifier}})(\??\.) - ) - | - (?:\b({{commonIdentifier}})(\??\.)) - ) - captures: - 1: >- - flowtype - entity.name.namespace.a.flowtype - 2: >- - flowtype - punctuation.definition.namespace.a.flowtype - 3: >- - flowtype - entity.name.namespace.b.flowtype - 4: >- - flowtype - punctuation.definition.namespace.b.flowtype - 5: >- - flowtype - entity.name.namespace.a.flowtype - 6: >- - flowtype - punctuation.definition.namespace.a.flowtype - # Namespace delimited by dollar signs. - - match: | - (?xi)\s* - (?> - (?:\b - ({{commonIdentifier}})(\$) - ({{commonIdentifier}})(\$) - ) - | - (?:\b({{commonIdentifier}})(\$)) - ) - captures: - 1: >- - flowtype - entity.name.namespace.a.flowtype - 2: >- - flowtype - punctuation.definition.namespace.a.flowtype - 3: >- - flowtype - entity.name.namespace.b.flowtype - 4: >- - flowtype - punctuation.definition.namespace.b.flowtype - 5: >- - flowtype - entity.name.namespace.a.flowtype - 6: >- - flowtype - punctuation.definition.namespace.a.flowtype diff --git a/syntaxes/fjsx15/flowtype/object.sublime-syntax b/syntaxes/fjsx15/flowtype/object.sublime-syntax deleted file mode 100644 index 699284a4..00000000 --- a/syntaxes/fjsx15/flowtype/object.sublime-syntax +++ /dev/null @@ -1,171 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - - constantIdentifier: | - [$_[:upper:]] - [$_[:upper:][:digit:]]* - -contexts: - main: - # Exact. - - match: \s*({)\s*(\|) - captures: - 1: >- - flowtype - punctuation.definition.object.begin.flowtype - 2: >- - flowtype - punctuation.definition.object.begin.flowtype - set: declaration - # Normal. - - match: \s*({) - captures: - 1: >- - flowtype - punctuation.definition.object.begin.flowtype - set: declaration - - declaration: - - match: \s*(,|;) - captures: - 1: >- - flowtype - punctuation.definition.object.flowtype - # Exact. - - match: \s*(\|)\s*(}) - captures: - 1: >- - flowtype - punctuation.definition.object.end.flowtype - 2: >- - flowtype - punctuation.definition.object.end.flowtype - pop: true - # Normal. - - match: \s*(}) - captures: - 1: >- - flowtype - punctuation.definition.object.end.flowtype - pop: true - - match: "" - push: - - include: comment - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/co-contravariant.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/indexer.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/callable.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/class/method.sublime-syntax - - include: property - - match: "" - pop: true - - property: - - include: constant - - include: variable - # String property name. - - match: (?=\s*(?>'|"|`)) - set: [ - type, - string - ] - - constant: - # Single character. - - match: | - (?x)\s* - ([_[:upper:]])\b - (?:\s*(\?\B))? - captures: - 1: >- - object.property.js.fjsx15 - entity.name.constant.js.fjsx15 - 2: >- - flowtype - keyword.operator.other.optional.flowtype - set: type - # Two or more characters. - - match: | - (?x)\s* - ( - {{constantIdentifier}} - (?> \$\B - | [_[:upper:]]\b - ) - ) - (?:\s*(\?\B))? - captures: - 1: >- - object.property.js.fjsx15 - entity.name.constant.js.fjsx15 - 2: >- - flowtype - keyword.operator.other.optional.flowtype - set: type - - variable: - # Single character. - - match: | - (?xi)\s* - ((?> \$\B - | [_[:alpha:]]\b - )) - (?:\s*(\?))? - captures: - 1: >- - object.property.js.fjsx15 - entity.name.variable.js.fjsx15 - 2: >- - flowtype - keyword.operator.other.optional.flowtype - set: type - # Two or more characters. - - match: | - (?xi)\s* - ( - {{commonIdentifier}} - (?> \$\B - | [_[:alnum:]]\b - ) - ) - (?:\s*(\?))? - captures: - 1: >- - object.property.js.fjsx15 - entity.name.variable.js.fjsx15 - 2: >- - flowtype - keyword.operator.other.optional.flowtype - set: type - - string: - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/template.sublime-syntax - - type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax - - comment: - - include: Packages/Naomi/syntaxes/fjsx15/comment.sublime-syntax - diff --git a/syntaxes/fjsx15/flowtype/optional-associated-type.sublime-syntax b/syntaxes/fjsx15/flowtype/optional-associated-type.sublime-syntax deleted file mode 100644 index 3ba281c5..00000000 --- a/syntaxes/fjsx15/flowtype/optional-associated-type.sublime-syntax +++ /dev/null @@ -1,28 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -contexts: - main: - - match: (?=\s*:) - set: associated-type - - match: (?=\s*\S) - pop: true - - associated-type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/prolog.sublime-syntax b/syntaxes/fjsx15/flowtype/prolog.sublime-syntax deleted file mode 100644 index 0f46fe80..00000000 --- a/syntaxes/fjsx15/flowtype/prolog.sublime-syntax +++ /dev/null @@ -1,31 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -contexts: - main: - - match: | - (?x)\s* - ((?> \/\/\s*@flow - | \/\*\s*@flow\s\*\/ - )) - captures: - 1: >- - flowtype - keyword.other.prolog.flowtype - pop: true diff --git a/syntaxes/fjsx15/flowtype/simple.sublime-syntax b/syntaxes/fjsx15/flowtype/simple.sublime-syntax deleted file mode 100644 index a7d831bd..00000000 --- a/syntaxes/fjsx15/flowtype/simple.sublime-syntax +++ /dev/null @@ -1,94 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - -contexts: - main: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/namespace-path.no-pop.sublime-syntax - # Predefined types. - - match: | - (?x)\s*\b - ((?> any - | Array - | [Bb]oolean - | false - | Function - | Generator - | mixed - | [Nn]umber - | null - | Object - | [Ss]tring - | true - | undefined - | void - ))\b - captures: - 1: >- - flowtype - support.flowtype - entity.name.type.flowtype - set: optional-template-or-array-shorthand - # Other types. - - match: | - (?xi)\s* - ({{commonIdentifier}}) - captures: - 1: >- - flowtype - entity.name.type.flowtype - set: optional-template-or-array-shorthand - - optional-template-or-array-shorthand: - - include: array-shorthand - - include: template - - match: "" - pop: true - - array-shorthand: - - match: | - (?x)\s* - (\[)\s*(]) - captures: - 1: >- - flowtype - punctuation.definition.array.begin.flowtype - 2: >- - flowtype - punctuation.definition.array.end.flowtype - pop: true - - template: - - match: (?=<) - set: [ - optional-array-shorthand, - template-arguments - ] - - optional-array-shorthand: - - include: array-shorthand - - match: (?=\S) - pop: true - - template-arguments: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/arguments.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/template/arguments.no-pop.sublime-syntax b/syntaxes/fjsx15/flowtype/template/arguments.no-pop.sublime-syntax deleted file mode 100644 index b5d117dd..00000000 --- a/syntaxes/fjsx15/flowtype/template/arguments.no-pop.sublime-syntax +++ /dev/null @@ -1,27 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -contexts: - main: - - match: (?=\s*<) - captures: - push: template-arguments - - template-arguments: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/arguments.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/template/arguments.sublime-syntax b/syntaxes/fjsx15/flowtype/template/arguments.sublime-syntax deleted file mode 100644 index 27a627f2..00000000 --- a/syntaxes/fjsx15/flowtype/template/arguments.sublime-syntax +++ /dev/null @@ -1,45 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -contexts: - main: - - match: \s*(<) - captures: - 1: >- - flowtype - punctuation.definition.template.arguments.begin.flowtype - set: arguments - - arguments: - - match: \s*(,) - captures: - 1: >- - flowtype - punctuation.definition.template.arguments.flowtype - - match: \s*(>) - captures: - 1: >- - flowtype - punctuation.definition.template.arguments.end.flowtype - pop: true - - match: "" - push: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type.sublime-syntax - - match: "" - pop: true diff --git a/syntaxes/fjsx15/flowtype/template/parameters.sublime-syntax b/syntaxes/fjsx15/flowtype/template/parameters.sublime-syntax deleted file mode 100644 index d8e6b8b7..00000000 --- a/syntaxes/fjsx15/flowtype/template/parameters.sublime-syntax +++ /dev/null @@ -1,45 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -contexts: - main: - - match: \s*(<) - captures: - 1: >- - flowtype - punctuation.definition.template.parameters.begin.flowtype - set: parameters - - parameters: - - match: \s*(,) - captures: - 1: >- - flowtype - punctuation.definition.template.parameters.flowtype - - match: \s*(>) - captures: - 1: >- - flowtype - punctuation.definition.template.parameters.end.flowtype - pop: true - - match: "" - push: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type.sublime-syntax - - match: "" - pop: true diff --git a/syntaxes/fjsx15/flowtype/tuple.sublime-syntax b/syntaxes/fjsx15/flowtype/tuple.sublime-syntax deleted file mode 100644 index 348c802a..00000000 --- a/syntaxes/fjsx15/flowtype/tuple.sublime-syntax +++ /dev/null @@ -1,45 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -contexts: - main: - - match: \s*(\[) - captures: - 1: >- - flowtype - punctuation.definition.array.begin.flowtype - set: items - - items: - - match: \s*(,) - captures: - 1: >- - flowtype - punctuation.definition.array.flowtype - - match: \s*(]) - captures: - 1: >- - flowtype - punctuation.definition.array.end.flowtype - pop: true - - match: "" - push: - - match: (?=\,|]) - pop: true - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/type-aliasing.sublime-syntax b/syntaxes/fjsx15/flowtype/type-aliasing.sublime-syntax deleted file mode 100644 index 56eecae1..00000000 --- a/syntaxes/fjsx15/flowtype/type-aliasing.sublime-syntax +++ /dev/null @@ -1,78 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - - templateArguments: | - (< - [^<>]* - \g<-1>? - [^<>]* - >) - -contexts: - main: - - match: | - (?xi)\s* - (?:(opaque)\s+)? - (type)\b - (?=\s+ - {{commonIdentifier}} - {{templateArguments}}? - ) - captures: - 1: >- - flowtype - storage.type.flowtype - keyword.other.access.flowtype - 2: >- - flowtype - storage.type.flowtype - keyword.declaration.type-aliasing.flowtype - set: [ - punctuation, - optional-constraint, - identifier - ] - - identifier: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/simple.sublime-syntax - - optional-constraint: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax - - match: (?=\s*\S) - pop: true - - punctuation: - - match: \s*(=) - captures: - 1: >- - flowtype - keyword.operator.other.assignment.flowtype - set: type - # Anything other than the assignment symbol here will terminate the type - # declaration. - - match: (?=\s*\S) - pop: true - - type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/typeof.no-pop.sublime-syntax b/syntaxes/fjsx15/flowtype/typeof.no-pop.sublime-syntax deleted file mode 100644 index 3bb61126..00000000 --- a/syntaxes/fjsx15/flowtype/typeof.no-pop.sublime-syntax +++ /dev/null @@ -1,29 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -contexts: - main: - - match: | - (?x)\s* - (typeof) - captures: - 1: >- - flowtype - word.flowtype - keyword.operator.other.flowtype From 08aa431a6b6816c073acdd44605ba96567b16458 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 9 Dec 2017 00:04:29 -0200 Subject: [PATCH 088/407] [FJSX15] Restore namespace paths --- .../namespace-path.no-pop.sublime-syntax | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 syntaxes/fjsx15/flowtype/namespace-path.no-pop.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/namespace-path.no-pop.sublime-syntax b/syntaxes/fjsx15/flowtype/namespace-path.no-pop.sublime-syntax new file mode 100644 index 00000000..6529c008 --- /dev/null +++ b/syntaxes/fjsx15/flowtype/namespace-path.no-pop.sublime-syntax @@ -0,0 +1,88 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + +contexts: + # Javascript/flow don’t have namespaces, this is just a visual cue to highlight + # only the last element when a type is expected. + main: + # Namespace delimited by dots. + - match: | + (?xi)\s* + (?> + (?:\b + ({{commonIdentifier}})(\??\.) + ({{commonIdentifier}})(\??\.) + ) + | + (?:\b({{commonIdentifier}})(\??\.)) + ) + captures: + 1: >- + flowtype + entity.name.namespace.a.flowtype + 2: >- + flowtype + punctuation.definition.namespace.a.flowtype + 3: >- + flowtype + entity.name.namespace.b.flowtype + 4: >- + flowtype + punctuation.definition.namespace.b.flowtype + 5: >- + flowtype + entity.name.namespace.a.flowtype + 6: >- + flowtype + punctuation.definition.namespace.a.flowtype + # Namespace delimited by dollar signs. + - match: | + (?xi)\s* + (?> + (?:\b + ({{commonIdentifier}})(\$) + ({{commonIdentifier}})(\$) + ) + | + (?:\b({{commonIdentifier}})(\$)) + ) + captures: + 1: >- + flowtype + entity.name.namespace.a.flowtype + 2: >- + flowtype + punctuation.definition.namespace.a.flowtype + 3: >- + flowtype + entity.name.namespace.b.flowtype + 4: >- + flowtype + punctuation.definition.namespace.b.flowtype + 5: >- + flowtype + entity.name.namespace.a.flowtype + 6: >- + flowtype + punctuation.definition.namespace.a.flowtype From e70d3563f9e136b0bad214c3e1abe2292582cde5 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 9 Dec 2017 00:04:54 -0200 Subject: [PATCH 089/407] [FJSX15] Add flow operators --- .../fjsx15/flowtype/operator.sublime-syntax | 24 +++++++++++++++ .../operator/array-shorthand.sublime-syntax | 30 +++++++++++++++++++ .../operator/intersection.sublime-syntax | 30 +++++++++++++++++++ .../flowtype/operator/nullable.sublime-syntax | 30 +++++++++++++++++++ .../flowtype/operator/union.sublime-syntax | 30 +++++++++++++++++++ 5 files changed, 144 insertions(+) create mode 100644 syntaxes/fjsx15/flowtype/operator.sublime-syntax create mode 100644 syntaxes/fjsx15/flowtype/operator/array-shorthand.sublime-syntax create mode 100644 syntaxes/fjsx15/flowtype/operator/intersection.sublime-syntax create mode 100644 syntaxes/fjsx15/flowtype/operator/nullable.sublime-syntax create mode 100644 syntaxes/fjsx15/flowtype/operator/union.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/operator.sublime-syntax b/syntaxes/fjsx15/flowtype/operator.sublime-syntax new file mode 100644 index 00000000..546921d7 --- /dev/null +++ b/syntaxes/fjsx15/flowtype/operator.sublime-syntax @@ -0,0 +1,24 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +contexts: + main: + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/operator/intersection.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/operator/nullable.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/operator/union.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/operator/array-shorthand.sublime-syntax b/syntaxes/fjsx15/flowtype/operator/array-shorthand.sublime-syntax new file mode 100644 index 00000000..663923bc --- /dev/null +++ b/syntaxes/fjsx15/flowtype/operator/array-shorthand.sublime-syntax @@ -0,0 +1,30 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +contexts: + main: + - match: \s*(\[)\s*(]) + captures: + 1: >- + flowtype + punctuation.definition.array.begin.flowtype + 2: >- + flowtype + punctuation.definition.array.end.flowtype + pop: true diff --git a/syntaxes/fjsx15/flowtype/operator/intersection.sublime-syntax b/syntaxes/fjsx15/flowtype/operator/intersection.sublime-syntax new file mode 100644 index 00000000..d2e45cb0 --- /dev/null +++ b/syntaxes/fjsx15/flowtype/operator/intersection.sublime-syntax @@ -0,0 +1,30 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +contexts: + main: + - match: \s*(&) + captures: + 1: >- + flowtype + keyword.operator.other.intersection.flowtype + set: optional-type-expression + + optional-type-expression: + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-type-expression.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/operator/nullable.sublime-syntax b/syntaxes/fjsx15/flowtype/operator/nullable.sublime-syntax new file mode 100644 index 00000000..c7932de8 --- /dev/null +++ b/syntaxes/fjsx15/flowtype/operator/nullable.sublime-syntax @@ -0,0 +1,30 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +contexts: + main: + - match: \s*(\?) + captures: + 1: >- + flowtype + keyword.operator.other.nullable.flowtype + set: optional-type-expression + + optional-type-expression: + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-type-expression.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/operator/union.sublime-syntax b/syntaxes/fjsx15/flowtype/operator/union.sublime-syntax new file mode 100644 index 00000000..202daf68 --- /dev/null +++ b/syntaxes/fjsx15/flowtype/operator/union.sublime-syntax @@ -0,0 +1,30 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +contexts: + main: + - match: \s*(\|) + captures: + 1: >- + flowtype + keyword.operator.other.union.flowtype + set: optional-type-expression + + optional-type-expression: + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-type-expression.sublime-syntax From d0101325b3bfb3cdaa5320b45cfdfb0497b9471e Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 9 Dec 2017 00:05:15 -0200 Subject: [PATCH 090/407] [FJSX15] Restore flow cast --- syntaxes/fjsx15/flowtype/cast.sublime-syntax | 32 ++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 syntaxes/fjsx15/flowtype/cast.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/cast.sublime-syntax b/syntaxes/fjsx15/flowtype/cast.sublime-syntax new file mode 100644 index 00000000..d52b5d3d --- /dev/null +++ b/syntaxes/fjsx15/flowtype/cast.sublime-syntax @@ -0,0 +1,32 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +contexts: + main: + - match: | + (?x) + \s*(:) + captures: + 1: >- + flowtype + keyword.operator.other.cast.flowtype + set: optional-type-expression + + optional-type-expression: + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-type-expression.sublime-syntax From 4e5978ab91562a486ca1cb7996afb987d520c414 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 9 Dec 2017 00:05:41 -0200 Subject: [PATCH 091/407] [FJSX15] Add type expressions --- .../optional-type-expression.sublime-syntax | 24 ++ .../flowtype/type-expression.sublime-syntax | 303 ++++++++++++++++++ 2 files changed, 327 insertions(+) create mode 100644 syntaxes/fjsx15/flowtype/optional-type-expression.sublime-syntax create mode 100644 syntaxes/fjsx15/flowtype/type-expression.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/optional-type-expression.sublime-syntax b/syntaxes/fjsx15/flowtype/optional-type-expression.sublime-syntax new file mode 100644 index 00000000..55b7f6fe --- /dev/null +++ b/syntaxes/fjsx15/flowtype/optional-type-expression.sublime-syntax @@ -0,0 +1,24 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +contexts: + main: + - match: (?=\s*[>,;:)\]}]) + pop: true + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type-expression.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/type-expression.sublime-syntax b/syntaxes/fjsx15/flowtype/type-expression.sublime-syntax new file mode 100644 index 00000000..ce5f676c --- /dev/null +++ b/syntaxes/fjsx15/flowtype/type-expression.sublime-syntax @@ -0,0 +1,303 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +variables: + # commonIdentifier: | + # [$_[:alpha:]] + # [$_[:alnum:]]* + + # templateArguments: | + # (< + # [^<>]* + # \g<-1>? + # [^<>]* + # >) + + # parameters: | + # (\( + # [^()]* + # \g<-1>? + # [^()]* + # \)) + + # flowFunction: | + # {{parameters}} + # \s*=>\s* + expressionGroupBegin: \s*(\() + expressionBegin: (?=\s*\S) + +contexts: + main: + - include: comment-no-pop + # Detect operators as soon as possible. + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/operator.sublime-syntax + # Open new type expression group. + - match: "{{expressionGroupBegin}}" + captures: + 1: >- + flowtype + punctuation.definition.expression.group.begin.js.fjsx15 + set: open-group + # Start of the type expression. + - match: "{{expressionBegin}}" + set: [ optional-tail, head ] + + comment-no-pop: + - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax + + optional-type-expression: + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-type-expression.sublime-syntax + + open-group: + - include: comment-no-pop + # Open new type expression group. + - match: "{{expressionGroupBegin}}" + captures: + 1: punctuation.definition.expression.group.begin.js.fjsx15 + push: open-group + # Close the current type expression group. + - include: close-group + # Start of the type expression. + - match: "{{expressionBegin}}" + push: optional-type-expression + + close-group: + - match: \s*(\)) + captures: + 1: >- + flowtype + punctuation.definition.expression.group.end.js.fjsx15 + set: optional-tail + + head: + - include: comment-no-pop + - include: Packages/Naomi/syntaxes/fjsx15/literal/number.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/literal/string/template.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/simple.sublime-syntax + + optional-tail: + - include: comment-no-pop + # Array shorthand or template arguments. + - match: (?=\s*[\[<]) + set: [ optional-tail, tail ] + # Other operators. + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/operator.sublime-syntax + # Anything else not expected. + - match: (?=\s*\S) + pop: true + + tail: + - include: comment-no-pop + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/operator/array-shorthand.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/arguments.sublime-syntax + + # - include: operators + # # Function. + # - match: | + # (?xi) + # (?=\s* + # {{templateArguments}}? + # {{flowFunction}} + # ) + # set: [ + # optional-operator, + # function-declaration + # ] + # # Open new expression group. + # - match: | + # (?xi)\s* + # {{expressionGroupBegin}} + # captures: + # 1: punctuation.definition.expression.group.a.begin.js.fjsx15 + # set: open-b-close-a + # # Expression contents. + # - match: (?=\s*\S) + # set: [ + # optional-operator, + # type-definitions + # ] + + + # open-a-close-b: + # - include: function-no-pop + # # Open new expression group. + # - match: | + # (?xi)\s* + # {{expressionGroupBegin}} + # captures: + # 1: punctuation.definition.expression.group.a.begin.js.fjsx15 + # push: open-b-close-a + # # Close current expression group. + # - match: \s*(\)) + # captures: + # 1: punctuation.definition.expression.group.b.end.js.fjsx15 + # set: optional-operator + # # Expression contents. + # - match: (?=\s*\S) + # push: [ + # optional-operator, + # type-definitions + # ] + + # open-b-close-a: + # - include: function-no-pop + # # Open new expression group. + # - match: | + # (?xi)\s* + # {{expressionGroupBegin}} + # captures: + # 1: punctuation.definition.expression.group.b.begin.js.fjsx15 + # push: open-a-close-b + # # Close current expression group. + # - match: \s*(\)) + # captures: + # 1: punctuation.definition.expression.group.a.end.js.fjsx15 + # set: optional-operator + # # Expression contents. + # - match: (?=\s*\S) + # push: [ + # optional-operator, + # type-definitions + # ] + + # function-no-pop: + # - include: Packages/Naomi/syntaxes/fjsx15/flowtype/function.no-pop.sublime-syntax + + # function-declaration: + # - include: Packages/Naomi/syntaxes/fjsx15/flowtype/function/declaration.sublime-syntax + + # type-definitions: + # - include: comment + # - include: Packages/Naomi/syntaxes/fjsx15/flowtype/typeof.no-pop.sublime-syntax + # # Enveloped nullable. + # - match: | + # (?x) + # \s*(\?) + # \s*(\() + # captures: + # 1: >- + # flowtype + # keyword.operator.other.nullable.flowtype + # 2: >- + # flowtype + # punctuation.definition.nullable.begin.flowtype + # set: [ + # enveloped-nullable-end, + # main + # ] + # # Nullable. + # - match: \s*(\?) + # captures: + # 1: >- + # flowtype + # keyword.operator.other.nullable.flowtype + # # Utility operators. + # - match: | + # (?x)\s* + # (Class)\b + # captures: + # 1: >- + # flowtype + # keyword.operator.other.utility.flowtype + # set: template + # # Utility operators preceded by $. + # - match: | + # (?x)\s* + # (\$ + # (?> Abstract + # | Diff + # | Exact + # | Keys + # | ObjMap + # | PropertyType + # | ReadOnly(?:Array)? + # | Shape + # | Supertype + # | Subtype + # )\b + # ) + # captures: + # 1: >- + # flowtype + # keyword.operator.other.utility.flowtype + # set: template + # # Existential. + # - match: \s*(\*) + # captures: + # 1: >- + # flowtype + # keyword.operator.other.existential.flowtype + # pop: true + # # Normal type. + # - include: Packages/Naomi/syntaxes/fjsx15/flowtype/function.sublime-syntax + # - include: Packages/Naomi/syntaxes/fjsx15/literal/number.sublime-syntax + # - include: Packages/Naomi/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax + # - include: Packages/Naomi/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax + # - include: Packages/Naomi/syntaxes/fjsx15/literal/string/template.sublime-syntax + # - include: Packages/Naomi/syntaxes/fjsx15/flowtype/object.sublime-syntax + # - include: Packages/Naomi/syntaxes/fjsx15/flowtype/tuple.sublime-syntax + # - include: Packages/Naomi/syntaxes/fjsx15/flowtype/simple.sublime-syntax + + # optional-operator: + # - include: operators + # - match: (?=\s*\S) + # pop: true + + # operators: + # - include: comment + # - include: co-contravariant + # # Intersection. + # - match: | + # (?x) + # \s*(&) + # (?!(?>&|=)) + # captures: + # 1: >- + # flowtype + # keyword.operator.other.intersection.flowtype + # set: main + # # Union. + # - match: | + # (?x) + # \s*(\|) + # (?!(?>\||=|\s*})) + # captures: + # 1: >- + # flowtype + # keyword.operator.other.union.flowtype + # set: main + + # enveloped-nullable-end: + # - match: \s*(\)) + # captures: + # 1: >- + # flowtype + # punctuation.definition.nullable.end.flowtype + # pop: true + + # comment: + # - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax + + # co-contravariant: + # - include: Packages/Naomi/syntaxes/fjsx15/flowtype/co-contravariant.no-pop.sublime-syntax + + # template: + # - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/parameters.sublime-syntax From 6cdedc634f3110f5fe0d388ff82d17e28afd5f62 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 9 Dec 2017 00:05:49 -0200 Subject: [PATCH 092/407] [FJSX15] Restore flow prolog --- .../fjsx15/flowtype/prolog.sublime-syntax | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 syntaxes/fjsx15/flowtype/prolog.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/prolog.sublime-syntax b/syntaxes/fjsx15/flowtype/prolog.sublime-syntax new file mode 100644 index 00000000..0f46fe80 --- /dev/null +++ b/syntaxes/fjsx15/flowtype/prolog.sublime-syntax @@ -0,0 +1,31 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +contexts: + main: + - match: | + (?x)\s* + ((?> \/\/\s*@flow + | \/\*\s*@flow\s\*\/ + )) + captures: + 1: >- + flowtype + keyword.other.prolog.flowtype + pop: true From 6f49f9931b7199d063182fb1201494a5f09215cf Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 9 Dec 2017 00:06:06 -0200 Subject: [PATCH 093/407] [FJSX15] Restore template args and parameters --- .../template/arguments.sublime-syntax | 44 +++++++++++++++++++ .../template/parameters.sublime-syntax | 44 +++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 syntaxes/fjsx15/flowtype/template/arguments.sublime-syntax create mode 100644 syntaxes/fjsx15/flowtype/template/parameters.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/template/arguments.sublime-syntax b/syntaxes/fjsx15/flowtype/template/arguments.sublime-syntax new file mode 100644 index 00000000..878d2942 --- /dev/null +++ b/syntaxes/fjsx15/flowtype/template/arguments.sublime-syntax @@ -0,0 +1,44 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +contexts: + main: + - match: \s*(<) + captures: + 1: >- + flowtype + punctuation.definition.template.arguments.begin.flowtype + set: [ delimiters, optional-type-expression ] + + delimiters: + - match: \s*(,) + captures: + 1: >- + flowtype + punctuation.definition.template.arguments.flowtype + push: optional-type-expression + - match: \s*(>) + captures: + 1: >- + flowtype + punctuation.definition.template.arguments.end.flowtype + pop: true + + optional-type-expression: + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-type-expression.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/template/parameters.sublime-syntax b/syntaxes/fjsx15/flowtype/template/parameters.sublime-syntax new file mode 100644 index 00000000..47d09a75 --- /dev/null +++ b/syntaxes/fjsx15/flowtype/template/parameters.sublime-syntax @@ -0,0 +1,44 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +contexts: + main: + - match: \s*(<) + captures: + 1: >- + flowtype + punctuation.definition.template.parameters.begin.flowtype + set: [ delimiters, optional-type-expression ] + + delimiters: + - match: \s*(,) + captures: + 1: >- + flowtype + punctuation.definition.template.parameters.flowtype + push: optional-type-expression + - match: \s*(>) + captures: + 1: >- + flowtype + punctuation.definition.template.parameters.end.flowtype + pop: true + + optional-type-expression: + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-type-expression.sublime-syntax From 8aa78a161c3cde69363e4a6fc16cb3b7b5a2f95b Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 9 Dec 2017 00:06:33 -0200 Subject: [PATCH 094/407] [FJSX15] Restore simple types --- .../fjsx15/flowtype/simple.sublime-syntax | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 syntaxes/fjsx15/flowtype/simple.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/simple.sublime-syntax b/syntaxes/fjsx15/flowtype/simple.sublime-syntax new file mode 100644 index 00000000..9b181678 --- /dev/null +++ b/syntaxes/fjsx15/flowtype/simple.sublime-syntax @@ -0,0 +1,60 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + +contexts: + main: + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/namespace-path.no-pop.sublime-syntax + # Predefined types. + - match: | + (?x)\s*\b + ((?> any + | Array + | [Bb]oolean + | false + | Function + | Generator + | mixed + | [Nn]umber + | null + | Object + | [Ss]tring + | true + | undefined + | void + ))\b + captures: + 1: >- + flowtype + support.flowtype + entity.name.type.flowtype + pop: true + # Other types. + - match: | + (?xi)\s* + ({{commonIdentifier}}) + captures: + 1: >- + flowtype + entity.name.type.flowtype + pop: true From 17f7c852d873bbd3521564fe10abcd8dc5e47757 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 9 Dec 2017 00:06:53 -0200 Subject: [PATCH 095/407] [FJSX15] Remove dead code --- syntaxes/fjsx15/flowtype/type.sublime-syntax | 238 ------------------- 1 file changed, 238 deletions(-) delete mode 100644 syntaxes/fjsx15/flowtype/type.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/type.sublime-syntax b/syntaxes/fjsx15/flowtype/type.sublime-syntax deleted file mode 100644 index a92bae9b..00000000 --- a/syntaxes/fjsx15/flowtype/type.sublime-syntax +++ /dev/null @@ -1,238 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - - templateArguments: | - (< - [^<>]* - \g<-1>? - [^<>]* - >) - - parameters: | - (\( - [^()]* - \g<-1>? - [^()]* - \)) - - flowFunction: | - {{parameters}} - \s*=>\s* - - expressionGroupBegin: | - (\() - -contexts: - main: - - include: operators - # Function. - - match: | - (?xi) - (?=\s* - {{templateArguments}}? - {{flowFunction}} - ) - set: [ - optional-operator, - function-declaration - ] - # Open new expression group. - - match: | - (?xi)\s* - {{expressionGroupBegin}} - captures: - 1: punctuation.definition.expression.group.a.begin.js.fjsx15 - set: open-b-close-a - # Expression contents. - - match: (?=\s*\S) - set: [ - optional-operator, - type-definitions - ] - - open-a-close-b: - - include: function-no-pop - # Open new expression group. - - match: | - (?xi)\s* - {{expressionGroupBegin}} - captures: - 1: punctuation.definition.expression.group.a.begin.js.fjsx15 - push: open-b-close-a - # Close current expression group. - - match: \s*(\)) - captures: - 1: punctuation.definition.expression.group.b.end.js.fjsx15 - set: optional-operator - # Expression contents. - - match: (?=\s*\S) - push: [ - optional-operator, - type-definitions - ] - - open-b-close-a: - - include: function-no-pop - # Open new expression group. - - match: | - (?xi)\s* - {{expressionGroupBegin}} - captures: - 1: punctuation.definition.expression.group.b.begin.js.fjsx15 - push: open-a-close-b - # Close current expression group. - - match: \s*(\)) - captures: - 1: punctuation.definition.expression.group.a.end.js.fjsx15 - set: optional-operator - # Expression contents. - - match: (?=\s*\S) - push: [ - optional-operator, - type-definitions - ] - - function-no-pop: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/function.no-pop.sublime-syntax - - function-declaration: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/function/declaration.sublime-syntax - - type-definitions: - - include: comment - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/typeof.no-pop.sublime-syntax - # Enveloped nullable. - - match: | - (?x) - \s*(\?) - \s*(\() - captures: - 1: >- - flowtype - keyword.operator.other.nullable.flowtype - 2: >- - flowtype - punctuation.definition.nullable.begin.flowtype - set: [ - enveloped-nullable-end, - main - ] - # Nullable. - - match: \s*(\?) - captures: - 1: >- - flowtype - keyword.operator.other.nullable.flowtype - # Utility operators. - - match: | - (?x)\s* - (Class)\b - captures: - 1: >- - flowtype - keyword.operator.other.utility.flowtype - set: template - # Utility operators preceded by $. - - match: | - (?x)\s* - (\$ - (?> Abstract - | Diff - | Exact - | Keys - | ObjMap - | PropertyType - | ReadOnly(?:Array)? - | Shape - | Supertype - | Subtype - )\b - ) - captures: - 1: >- - flowtype - keyword.operator.other.utility.flowtype - set: template - # Existential. - - match: \s*(\*) - captures: - 1: >- - flowtype - keyword.operator.other.existential.flowtype - pop: true - # Normal type. - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/function.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/number.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/template.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/object.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/tuple.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/simple.sublime-syntax - - optional-operator: - - include: operators - - match: (?=\s*\S) - pop: true - - operators: - - include: comment - - include: co-contravariant - # Intersection. - - match: | - (?x) - \s*(&) - (?!(?>&|=)) - captures: - 1: >- - flowtype - keyword.operator.other.intersection.flowtype - set: main - # Union. - - match: | - (?x) - \s*(\|) - (?!(?>\||=|\s*})) - captures: - 1: >- - flowtype - keyword.operator.other.union.flowtype - set: main - - enveloped-nullable-end: - - match: \s*(\)) - captures: - 1: >- - flowtype - punctuation.definition.nullable.end.flowtype - pop: true - - comment: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - - co-contravariant: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/co-contravariant.no-pop.sublime-syntax - - template: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/parameters.sublime-syntax From e87966562c5c27c851f2e48fc2aa16830da10a38 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 9 Dec 2017 00:07:30 -0200 Subject: [PATCH 096/407] [FJSX15] Add optional associated type --- .../optional-associated-type.sublime-syntax | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 syntaxes/fjsx15/flowtype/optional-associated-type.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/optional-associated-type.sublime-syntax b/syntaxes/fjsx15/flowtype/optional-associated-type.sublime-syntax new file mode 100644 index 00000000..3ba281c5 --- /dev/null +++ b/syntaxes/fjsx15/flowtype/optional-associated-type.sublime-syntax @@ -0,0 +1,28 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +contexts: + main: + - match: (?=\s*:) + set: associated-type + - match: (?=\s*\S) + pop: true + + associated-type: + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax From 5d02c3821a1a5d51f2604af25081052aea1a6102 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 9 Dec 2017 00:07:52 -0200 Subject: [PATCH 097/407] [FJSX15] Linke associated types to expressions --- syntaxes/fjsx15/flowtype/associated-type.sublime-syntax | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax b/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax index e8366a48..3aba12d4 100644 --- a/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax +++ b/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax @@ -24,7 +24,7 @@ contexts: 1: >- flowtype keyword.operator.other.association.flowtype - set: type + set: optional-type-expression - type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type.sublime-syntax + optional-type-expression: + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-type-expression.sublime-syntax From c22cc47a8dfa222a6bbe5fe6ea89b55ad2bdc7a8 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 9 Dec 2017 00:40:49 -0200 Subject: [PATCH 098/407] [FJSX15] Add optional template arguments --- .../optional-arguments.sublime-syntax | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 syntaxes/fjsx15/flowtype/template/optional-arguments.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/template/optional-arguments.sublime-syntax b/syntaxes/fjsx15/flowtype/template/optional-arguments.sublime-syntax new file mode 100644 index 00000000..621e7a69 --- /dev/null +++ b/syntaxes/fjsx15/flowtype/template/optional-arguments.sublime-syntax @@ -0,0 +1,28 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +contexts: + main: + - match: (?=\s*<) + set: arguments + - match: (?=\s*\S) + pop: true + + arguments: + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-type-expression.sublime-syntax From 43326789d04d41f6109d7808cbe91925ed9f0c23 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 9 Dec 2017 00:41:20 -0200 Subject: [PATCH 099/407] [FJSX15] Rename arguments to core arguments --- .../{arguments.sublime-syntax => core-arguments.sublime-syntax} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename syntaxes/fjsx15/function-call/support/{arguments.sublime-syntax => core-arguments.sublime-syntax} (100%) diff --git a/syntaxes/fjsx15/function-call/support/arguments.sublime-syntax b/syntaxes/fjsx15/function-call/support/core-arguments.sublime-syntax similarity index 100% rename from syntaxes/fjsx15/function-call/support/arguments.sublime-syntax rename to syntaxes/fjsx15/function-call/support/core-arguments.sublime-syntax From 3cc62570ebb432c4a35c18085a9ad2e435c1f6e0 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 9 Dec 2017 00:41:38 -0200 Subject: [PATCH 100/407] [FJSX15] Rename parameters to core parameters --- .../{parameters.sublime-syntax => core-parameters.sublime-syntax} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename syntaxes/fjsx15/function/support/{parameters.sublime-syntax => core-parameters.sublime-syntax} (100%) diff --git a/syntaxes/fjsx15/function/support/parameters.sublime-syntax b/syntaxes/fjsx15/function/support/core-parameters.sublime-syntax similarity index 100% rename from syntaxes/fjsx15/function/support/parameters.sublime-syntax rename to syntaxes/fjsx15/function/support/core-parameters.sublime-syntax From 13cb88cd1eef1fee714957f8ddb08d727eea2198 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 9 Dec 2017 00:41:49 -0200 Subject: [PATCH 101/407] [FJSX15] Add optional core arguments --- .../optional-core-arguments.sublime-syntax | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 syntaxes/fjsx15/function-call/support/optional-core-arguments.sublime-syntax diff --git a/syntaxes/fjsx15/function-call/support/optional-core-arguments.sublime-syntax b/syntaxes/fjsx15/function-call/support/optional-core-arguments.sublime-syntax new file mode 100644 index 00000000..5e0ba621 --- /dev/null +++ b/syntaxes/fjsx15/function-call/support/optional-core-arguments.sublime-syntax @@ -0,0 +1,28 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +contexts: + main: + - match: (?=\s*\() + set: arguments + - match: (?=\s*\S) + pop: true + + arguments: + - include: Packages/Naomi/syntaxes/fjsx15/function-call/support/core-arguments.sublime-syntax From 5f68a09a34f400b595cb78df42e3c30233ef334f Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 9 Dec 2017 00:43:08 -0200 Subject: [PATCH 102/407] [FJSX15] Simplify core types --- syntaxes/fjsx15/core.sublime-syntax | 172 ++++++++++++++++------------ 1 file changed, 97 insertions(+), 75 deletions(-) diff --git a/syntaxes/fjsx15/core.sublime-syntax b/syntaxes/fjsx15/core.sublime-syntax index 636ff715..087493e1 100644 --- a/syntaxes/fjsx15/core.sublime-syntax +++ b/syntaxes/fjsx15/core.sublime-syntax @@ -40,27 +40,23 @@ contexts: - include: internationalization - include: web-assembly - function-arguments: - - include: Packages/Naomi/syntaxes/fjsx15/function-call/support/arguments.sublime-syntax - - match: (?=\S) - pop: true + # function-arguments: + # - include: Packages/Naomi/syntaxes/fjsx15/function-call/support/core-arguments.sublime-syntax - optional-template-and-type-arguments: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/arguments.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/type/support/arguments.sublime-syntax - - match: "" - pop: true + optional-template-arguments: + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/optional-arguments.sublime-syntax + + optional-core-arguments: + - include: Packages/Naomi/syntaxes/fjsx15/function-call/support/optional-core-arguments.sublime-syntax array-functions: - match: | (?x) - \s*(Array)\b - (?: - \s*(\.)\s* - ((?> from - | isArray - ))\b - )? + \s*(Array) + \s*(\.)\s* + ((?> from + | isArray + ))\b captures: 1: >- support.core.js.fjsx15 @@ -69,7 +65,7 @@ contexts: 3: >- support.core.js.fjsx15 entity.name.function.js.fjsx15 - set: function-arguments + set: optional-core-arguments math-constants: - match: | @@ -96,35 +92,33 @@ contexts: - match: | (?x) \s*(Math)\b - (?: - \s*(\.)\s* - ((?> abs - | acosh? - | asinh? - | atan(?>2|h)? - | cbrt - | ceil - | clz32 - | cosh? - | exp - | exp(?:m1)? - | floor - | fround - | hypot - | imul - | log(?>10|1p|2)? - | max - | min - | pow - | random - | round - | sign - | sinh? - | sqrt - | tanh? - | trunc - ))\b - )? + \s*(\.)\s* + ((?> abs + | acosh? + | asinh? + | atan(?>2|h)? + | cbrt + | ceil + | clz32 + | cosh? + | exp + | exp(?:m1)? + | floor + | fround + | hypot + | imul + | log(?>10|1p|2)? + | max + | min + | pow + | random + | round + | sign + | sinh? + | sqrt + | tanh? + | trunc + ))\b captures: 1: >- support.core.js.fjsx15 @@ -133,27 +127,25 @@ contexts: 3: >- support.core.js.fjsx15 entity.name.function.js.fjsx15 - set: function-arguments + set: optional-core-arguments object-functions: - match: | (?x) \s*(Object)\b - (?: - \s*(\.)\s* - ((?> assign - | create - | definePropert(?>ies|y) - | freeze - | getOwnProperty(?>Descriptors?|Names|Symbols) - | getPrototypeOf - | is(?>Extensible|Frozen|Sealed)? - | keys - | preventExtensions - | seal - | setPrototypeOf - ))\b - )? + \s*(\.)\s* + ((?> assign + | create + | definePropert(?>ies|y) + | freeze + | getOwnProperty(?>Descriptors?|Names|Symbols) + | getPrototypeOf + | is(?>Extensible|Frozen|Sealed)? + | keys + | preventExtensions + | seal + | setPrototypeOf + ))\b captures: 1: >- support.core.js.fjsx15 @@ -162,7 +154,7 @@ contexts: 3: >- support.core.js.fjsx15 entity.name.function.js.fjsx15 - set: function-arguments + set: optional-core-arguments symbol-functions: - match: | @@ -180,7 +172,7 @@ contexts: 3: >- support.core.js.fjsx15 entity.name.function.js.fjsx15 - set: function-arguments + set: optional-core-arguments symbol-properties: - match: | @@ -240,7 +232,7 @@ contexts: 1: >- support.core.js.fjsx15 entity.name.function.js.fjsx15 - set: function-arguments + set: optional-core-arguments function-properties: - match: | @@ -275,7 +267,10 @@ contexts: 1: >- support.core.js.fjsx15 entity.name.class.js.fjsx15 - set: optional-template-and-type-arguments + set: [ + optional-core-arguments, + optional-template-arguments + ] numbers-and-dates: - match: | @@ -288,7 +283,10 @@ contexts: 1: >- support.core.js.fjsx15 entity.name.class.js.fjsx15 - set: optional-template-and-type-arguments + set: [ + optional-core-arguments, + optional-template-arguments + ] text-processing: - match: | @@ -300,7 +298,10 @@ contexts: 1: >- support.core.js.fjsx15 entity.name.class.js.fjsx15 - set: optional-template-and-type-arguments + set: [ + optional-core-arguments, + optional-template-arguments + ] indexed-collections: - match: | @@ -315,7 +316,10 @@ contexts: 1: >- support.core.js.fjsx15 entity.name.class.js.fjsx15 - set: optional-template-and-type-arguments + set: [ + optional-core-arguments, + optional-template-arguments + ] keyed-collections: - match: | @@ -328,7 +332,10 @@ contexts: 1: >- support.core.js.fjsx15 entity.name.class.js.fjsx15 - set: optional-template-and-type-arguments + set: [ + optional-core-arguments, + optional-template-arguments + ] structured-data: - match: | @@ -341,7 +348,10 @@ contexts: 1: >- support.core.js.fjsx15 entity.name.class.js.fjsx15 - set: optional-template-and-type-arguments + set: [ + optional-core-arguments, + optional-template-arguments + ] control-abstraction-objects: - match: | @@ -353,7 +363,10 @@ contexts: 1: >- support.core.js.fjsx15 entity.name.class.js.fjsx15 - set: optional-template-and-type-arguments + set: [ + optional-core-arguments, + optional-template-arguments + ] reflection: - match: | @@ -365,7 +378,10 @@ contexts: 1: >- support.core.js.fjsx15 entity.name.class.js.fjsx15 - set: optional-template-and-type-arguments + set: [ + optional-core-arguments, + optional-template-arguments + ] internationalization: - match: | @@ -386,7 +402,10 @@ contexts: 3: >- support.core.js.fjsx15 entity.name.class.js.fjsx15 - set: optional-template-and-type-arguments + set: [ + optional-core-arguments, + optional-template-arguments + ] web-assembly: - match: | @@ -411,4 +430,7 @@ contexts: 3: >- support.core.js.fjsx15 entity.name.class.js.fjsx15 - set: optional-template-and-type-arguments + set: [ + optional-core-arguments, + optional-template-arguments + ] From fc0af52783a6d54bd7463abb064cca5e489b43d3 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 9 Dec 2017 00:44:16 -0200 Subject: [PATCH 103/407] [FJSX15] Link instanceof to optional type expression --- syntaxes/fjsx15/operator/relational.sublime-syntax | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/syntaxes/fjsx15/operator/relational.sublime-syntax b/syntaxes/fjsx15/operator/relational.sublime-syntax index 370f65f7..92ea097c 100644 --- a/syntaxes/fjsx15/operator/relational.sublime-syntax +++ b/syntaxes/fjsx15/operator/relational.sublime-syntax @@ -24,7 +24,7 @@ contexts: 1: >- word.js.fjsx15 keyword.operator.relational.js.fjsx15 - set: type + set: optional-type-expression - match: \s*(in)\b captures: 1: >- @@ -35,5 +35,5 @@ contexts: optional-expression: - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax - type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type.sublime-syntax + optional-type-expression: + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-type-expression.sublime-syntax From 5376670d135a61e233340361ee4f781a355bb17d Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 9 Dec 2017 01:19:40 -0200 Subject: [PATCH 104/407] [FJSX15] Simplify function calls --- syntaxes/fjsx15/function-call.sublime-syntax | 67 ++++++-------------- 1 file changed, 18 insertions(+), 49 deletions(-) diff --git a/syntaxes/fjsx15/function-call.sublime-syntax b/syntaxes/fjsx15/function-call.sublime-syntax index 808f16c5..1fc78f54 100644 --- a/syntaxes/fjsx15/function-call.sublime-syntax +++ b/syntaxes/fjsx15/function-call.sublime-syntax @@ -30,8 +30,9 @@ variables: >) contexts: + # There’s no need to highlight the arguments, the expression loop will do it. main: - # Template function. + # Template function call. - match: | (?xi) (?= @@ -41,7 +42,11 @@ contexts: \s*(\?\.)? \s*\( ) - set: modifier-and-name + set: [ + template-arguments, + identifier, + optional-modifier + ] # Simple function call. - match: | (?xi) @@ -51,33 +56,21 @@ contexts: \s*(\?\.)? \s*\( ) - set: modifier-and-name - # Function call near expression. - - include: function-arguments + set: [ + identifier, + optional-modifier + ] - modifier-and-name: - # Private modifier. + optional-modifier: - match: \s*(\#) captures: 1: >- storage.modifier.js.fjsx15 keyword.other.access.js.fjsx15 - # Support identifier. - - match: | - (?x)\s* - ((?> constructor - | super - ))\b - captures: - 1: >- - call.js.fjsx15 - support.js.fjsx15 - entity.name.function.js.fjsx15 - set: [ - optional-chain-and-support-arguments, - possible-template-arguments - ] - # Identifier. + - match: (?=\s*\S) + pop: true + + identifier: - match: | (?xi) \s*({{commonIdentifier}}) @@ -85,31 +78,7 @@ contexts: 1: >- call.js.fjsx entity.name.function.js.fjsx15 - set: [ - optional-chain-and-arguments, - possible-template-arguments - ] - - possible-template-arguments: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/arguments.sublime-syntax - - match: "" pop: true - optional-chain-and-arguments: - - include: optional-chain-operator - - include: function-arguments - - optional-chain-and-support-arguments: - - include: optional-chain-operator - - include: support-function-arguments - - optional-chain-operator: - - match: \s*(\?\.) - captures: - 1: keyword.operator.other.optional-chain.js.fjsx15 - - function-arguments: - - include: Packages/Naomi/syntaxes/fjsx15/function-call/arguments.sublime-syntax - - support-function-arguments: - - include: Packages/Naomi/syntaxes/fjsx15/function-call/support/arguments.sublime-syntax + template-arguments: + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/arguments.sublime-syntax From 1ce3a4bc8a1ca44fd07174e4f1b04f72ecf77f31 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 9 Dec 2017 01:24:54 -0200 Subject: [PATCH 105/407] [FJSX15] Fix optional template arguments --- .../fjsx15/flowtype/template/optional-arguments.sublime-syntax | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/flowtype/template/optional-arguments.sublime-syntax b/syntaxes/fjsx15/flowtype/template/optional-arguments.sublime-syntax index 621e7a69..8a031dca 100644 --- a/syntaxes/fjsx15/flowtype/template/optional-arguments.sublime-syntax +++ b/syntaxes/fjsx15/flowtype/template/optional-arguments.sublime-syntax @@ -25,4 +25,4 @@ contexts: pop: true arguments: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-type-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/arguments.sublime-syntax From 78b24ea3732b5b611e76bbea30139d2742ce6d4a Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 9 Dec 2017 01:26:35 -0200 Subject: [PATCH 106/407] [FJSX15] Expand core types to expect template args --- syntaxes/fjsx15/core.sublime-syntax | 30 +++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/syntaxes/fjsx15/core.sublime-syntax b/syntaxes/fjsx15/core.sublime-syntax index 087493e1..b5585ffc 100644 --- a/syntaxes/fjsx15/core.sublime-syntax +++ b/syntaxes/fjsx15/core.sublime-syntax @@ -40,10 +40,9 @@ contexts: - include: internationalization - include: web-assembly - # function-arguments: - # - include: Packages/Naomi/syntaxes/fjsx15/function-call/support/core-arguments.sublime-syntax - optional-template-arguments: + - match: lol + scope: keyword - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/optional-arguments.sublime-syntax optional-core-arguments: @@ -65,7 +64,10 @@ contexts: 3: >- support.core.js.fjsx15 entity.name.function.js.fjsx15 - set: optional-core-arguments + set: [ + optional-core-arguments, + optional-template-arguments + ] math-constants: - match: | @@ -127,7 +129,10 @@ contexts: 3: >- support.core.js.fjsx15 entity.name.function.js.fjsx15 - set: optional-core-arguments + set: [ + optional-core-arguments, + optional-template-arguments + ] object-functions: - match: | @@ -154,7 +159,10 @@ contexts: 3: >- support.core.js.fjsx15 entity.name.function.js.fjsx15 - set: optional-core-arguments + set: [ + optional-core-arguments, + optional-template-arguments + ] symbol-functions: - match: | @@ -172,7 +180,10 @@ contexts: 3: >- support.core.js.fjsx15 entity.name.function.js.fjsx15 - set: optional-core-arguments + set: [ + optional-core-arguments, + optional-template-arguments + ] symbol-properties: - match: | @@ -232,7 +243,10 @@ contexts: 1: >- support.core.js.fjsx15 entity.name.function.js.fjsx15 - set: optional-core-arguments + set: [ + optional-core-arguments, + optional-template-arguments + ] function-properties: - match: | From a1ac8ec0911b7413d80fd7bb8fc5a8e358d3ed57 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 9 Dec 2017 02:05:11 -0200 Subject: [PATCH 107/407] [FJSX15] Add optional statements and expressions --- ...-statements-and-expressions.sublime-syntax | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 syntaxes/fjsx15/optional-statements-and-expressions.sublime-syntax diff --git a/syntaxes/fjsx15/optional-statements-and-expressions.sublime-syntax b/syntaxes/fjsx15/optional-statements-and-expressions.sublime-syntax new file mode 100644 index 00000000..1bbadbd4 --- /dev/null +++ b/syntaxes/fjsx15/optional-statements-and-expressions.sublime-syntax @@ -0,0 +1,24 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +contexts: + main: + - match: (?=\s*}) + pop: true + - include: Packages/Naomi/syntaxes/naomi.fjsx15.sublime-syntax From ef25b000367cd87f980b2e7b6520fce093947499 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 9 Dec 2017 02:05:48 -0200 Subject: [PATCH 108/407] [FJSX15] Differentiate arrow body from assignment --- syntaxes/fjsx15/operator/assignment.sublime-syntax | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/operator/assignment.sublime-syntax b/syntaxes/fjsx15/operator/assignment.sublime-syntax index 0b6e8232..0dc43879 100644 --- a/syntaxes/fjsx15/operator/assignment.sublime-syntax +++ b/syntaxes/fjsx15/operator/assignment.sublime-syntax @@ -19,7 +19,7 @@ scope: ... contexts: main: - - match: \s*(=) + - match: \s*(=)(?!\s*>) captures: 1: keyword.operator.other.assignment.js.fjsx15 set: optional-expression From 034d56394cd338c334b677c2ed7592d25695b0f7 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 9 Dec 2017 02:06:18 -0200 Subject: [PATCH 109/407] [FJSX15] Rename contexts --- syntaxes/fjsx15/function.sublime-syntax | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/syntaxes/fjsx15/function.sublime-syntax b/syntaxes/fjsx15/function.sublime-syntax index cc4370a6..9c2c6b12 100644 --- a/syntaxes/fjsx15/function.sublime-syntax +++ b/syntaxes/fjsx15/function.sublime-syntax @@ -24,7 +24,6 @@ variables: contexts: main: - # Function declaration. - match: | (?x)\s* (?: @@ -41,7 +40,7 @@ contexts: set: declaration declaration: - - include: comment + - include: comment-no-pop # Body. - match: (?=\s*\{) set: body @@ -68,7 +67,7 @@ contexts: - match: (?=\s*\S) pop: true - comment: + comment-no-pop: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax template-parameters: From 7cec6f7a9bf0fc0b7cf4f1eaaf8b1fcf9672fafb Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 9 Dec 2017 02:06:44 -0200 Subject: [PATCH 110/407] [FJSX15] Fix function body --- syntaxes/fjsx15/function/body.sublime-syntax | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/syntaxes/fjsx15/function/body.sublime-syntax b/syntaxes/fjsx15/function/body.sublime-syntax index 93284a00..f4e720ce 100644 --- a/syntaxes/fjsx15/function/body.sublime-syntax +++ b/syntaxes/fjsx15/function/body.sublime-syntax @@ -22,15 +22,16 @@ contexts: - match: \s*(\{) captures: 1: punctuation.definition.function.body.begin.js.fjsx15 - set: body-content + set: [ + close-body, + optional-statements-and-expressions + ] - body-content: + close-body: - match: \s*(}) captures: 1: punctuation.definition.function.body.end.js.fjsx15 pop: true - - match: "" - push: - - match: (?=\s*}) - pop: true - # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + + optional-statements-and-expressions: + - include: Packages/Naomi/syntaxes/fjsx15/optional-statements-and-expressions.sublime-syntax From eee866765a94622a8600399d898444b7e74fddcc Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 10 Dec 2017 17:00:02 -0200 Subject: [PATCH 111/407] [FJSX15] Allow default value after object destructuring --- .../function/parameter/destructuring/object.sublime-syntax | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax b/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax index 0f7263f4..66a41e2c 100644 --- a/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax +++ b/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax @@ -43,7 +43,7 @@ contexts: 1: >- destructuring.object.js.fjsx15 punctuation.definition.object.end.js.fjsx15 - pop: true + set: optional-default-value optional-parameter: - include: comment-no-pop From 2ba1d34791442c5475ec5fbe96551e70faeaed0e Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 10 Dec 2017 17:02:02 -0200 Subject: [PATCH 112/407] [FJSX15] Make optionals no pop --- ...guments.sublime-syntax => arguments.no-pop.sublime-syntax} | 4 +--- ...ts.sublime-syntax => core-arguments.no-pop.sublime-syntax} | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) rename syntaxes/fjsx15/flowtype/template/{optional-arguments.sublime-syntax => arguments.no-pop.sublime-syntax} (92%) rename syntaxes/fjsx15/function-call/support/{optional-core-arguments.sublime-syntax => core-arguments.no-pop.sublime-syntax} (92%) diff --git a/syntaxes/fjsx15/flowtype/template/optional-arguments.sublime-syntax b/syntaxes/fjsx15/flowtype/template/arguments.no-pop.sublime-syntax similarity index 92% rename from syntaxes/fjsx15/flowtype/template/optional-arguments.sublime-syntax rename to syntaxes/fjsx15/flowtype/template/arguments.no-pop.sublime-syntax index 8a031dca..050ee6da 100644 --- a/syntaxes/fjsx15/flowtype/template/optional-arguments.sublime-syntax +++ b/syntaxes/fjsx15/flowtype/template/arguments.no-pop.sublime-syntax @@ -20,9 +20,7 @@ scope: ... contexts: main: - match: (?=\s*<) - set: arguments - - match: (?=\s*\S) - pop: true + push: arguments arguments: - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/arguments.sublime-syntax diff --git a/syntaxes/fjsx15/function-call/support/optional-core-arguments.sublime-syntax b/syntaxes/fjsx15/function-call/support/core-arguments.no-pop.sublime-syntax similarity index 92% rename from syntaxes/fjsx15/function-call/support/optional-core-arguments.sublime-syntax rename to syntaxes/fjsx15/function-call/support/core-arguments.no-pop.sublime-syntax index 5e0ba621..fa94f1f0 100644 --- a/syntaxes/fjsx15/function-call/support/optional-core-arguments.sublime-syntax +++ b/syntaxes/fjsx15/function-call/support/core-arguments.no-pop.sublime-syntax @@ -20,9 +20,7 @@ scope: ... contexts: main: - match: (?=\s*\() - set: arguments - - match: (?=\s*\S) - pop: true + push: arguments arguments: - include: Packages/Naomi/syntaxes/fjsx15/function-call/support/core-arguments.sublime-syntax From 5e2ca84697448c68f9cfd067f634a453a6cf477a Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 10 Dec 2017 17:02:21 -0200 Subject: [PATCH 113/407] [FJSX15] Add no pop variant --- .../template/parameters.no-pop.sublime-syntax | 26 ++++++++++++++ .../parameter/simple.no-pop.sublime-syntax | 36 +++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 syntaxes/fjsx15/flowtype/template/parameters.no-pop.sublime-syntax create mode 100644 syntaxes/fjsx15/function/parameter/simple.no-pop.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/template/parameters.no-pop.sublime-syntax b/syntaxes/fjsx15/flowtype/template/parameters.no-pop.sublime-syntax new file mode 100644 index 00000000..823ec317 --- /dev/null +++ b/syntaxes/fjsx15/flowtype/template/parameters.no-pop.sublime-syntax @@ -0,0 +1,26 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +contexts: + main: + - match: (?=\s*<) + push: parameters + + parameters: + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/parameters.sublime-syntax diff --git a/syntaxes/fjsx15/function/parameter/simple.no-pop.sublime-syntax b/syntaxes/fjsx15/function/parameter/simple.no-pop.sublime-syntax new file mode 100644 index 00000000..9a8f5147 --- /dev/null +++ b/syntaxes/fjsx15/function/parameter/simple.no-pop.sublime-syntax @@ -0,0 +1,36 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + +contexts: + main: + - match: | + (?xi) + (?= + \s*(?:\.{3})? + {{commonIdentifier}} + ) + push: parameter + + parameter: + - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/simple.sublime-syntax From 07c576c8424da95c9da4fcee0240b9f50693d6c7 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 10 Dec 2017 17:03:06 -0200 Subject: [PATCH 114/407] [FJSX15] Fix function arguments reference --- syntaxes/fjsx15/global.sublime-syntax | 2 +- syntaxes/fjsx15/node-js.sublime-syntax | 2 +- syntaxes/fjsx15/web.sublime-syntax | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/syntaxes/fjsx15/global.sublime-syntax b/syntaxes/fjsx15/global.sublime-syntax index 165343f4..ff666848 100644 --- a/syntaxes/fjsx15/global.sublime-syntax +++ b/syntaxes/fjsx15/global.sublime-syntax @@ -34,7 +34,7 @@ contexts: - include: complex-variable arguments: - - include: Packages/Naomi/syntaxes/fjsx15/function-call/support/arguments.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/function-call/support/core-arguments.sublime-syntax member-access-operator: - match: \s*(\.) diff --git a/syntaxes/fjsx15/node-js.sublime-syntax b/syntaxes/fjsx15/node-js.sublime-syntax index 55364a6e..d604b92d 100644 --- a/syntaxes/fjsx15/node-js.sublime-syntax +++ b/syntaxes/fjsx15/node-js.sublime-syntax @@ -26,7 +26,7 @@ contexts: - include: constants function-arguments: - - include: Packages/Naomi/syntaxes/fjsx15/function-call/support/arguments.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/function-call/support/core-arguments.sublime-syntax module: - match: | diff --git a/syntaxes/fjsx15/web.sublime-syntax b/syntaxes/fjsx15/web.sublime-syntax index 7a4f60c9..e07924ee 100644 --- a/syntaxes/fjsx15/web.sublime-syntax +++ b/syntaxes/fjsx15/web.sublime-syntax @@ -24,7 +24,7 @@ contexts: - include: window-functions function-arguments: - - include: Packages/Naomi/syntaxes/fjsx15/function-call/support/arguments.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/function-call/support/core-arguments.sublime-syntax console-functions: - match: | From d5ce2c4b16356c7f6ccc6141e6b51d7c9f7a592c Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 10 Dec 2017 17:03:06 -0200 Subject: [PATCH 115/407] [FJSX15] Highlight arrow functions in var declaration --- syntaxes/fjsx15/async.no-pop.sublime-syntax | 26 ++++ .../variable-declaration.sublime-syntax | 123 +++++++++++++++++- 2 files changed, 147 insertions(+), 2 deletions(-) create mode 100644 syntaxes/fjsx15/async.no-pop.sublime-syntax diff --git a/syntaxes/fjsx15/async.no-pop.sublime-syntax b/syntaxes/fjsx15/async.no-pop.sublime-syntax new file mode 100644 index 00000000..ae3cc9e9 --- /dev/null +++ b/syntaxes/fjsx15/async.no-pop.sublime-syntax @@ -0,0 +1,26 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +contexts: + main: + - match: \s*(async) + captures: + 1: >- + storage.modifier.js.fjsx15 + keyword.other.async.js.fjsx15 diff --git a/syntaxes/fjsx15/variable-declaration.sublime-syntax b/syntaxes/fjsx15/variable-declaration.sublime-syntax index 202a2e1e..c1238ac2 100644 --- a/syntaxes/fjsx15/variable-declaration.sublime-syntax +++ b/syntaxes/fjsx15/variable-declaration.sublime-syntax @@ -17,14 +17,112 @@ hidden: true scope: ... +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + + templateArguments: | + (< + [^<>]* + \g<-1>? + [^<>]* + >) + + parameters: | + (\( + [^()]* + \g<-1>? + [^()]* + \)) + + flowOperators: | + (?> &(?!&) + | \|(?!\|) + ) + + string: | + (?> '.*?' + | ".*?" + | `.*` + ) + + simpleFlowType: | + (?> {{string}} + | {{commonIdentifier}} + {{templateArguments}}? + ) + + flowFunction: | + ( + {{parameters}} + \s*=>\s* + (?> {{simpleFlowType}} + | \g<-2> + ) + ) + + complexType: | + ( + \??\s* + (?> {{simpleFlowType}} + | {{flowFunction}} + ) + \s*{{flowOperators}}? + \s*\g<-5>? + ) + + flowComment: /\*\s*:.*?\*/ + + type: | + (?> {{flowComment}} + | :{{complexType}} + ) + contexts: main: + # Normal arrow function assigned to variable. + - match: | + (?x) + (?= + \s*(?>const|let|var)\b + \s*{{commonIdentifier}} + \s*= + \s*(?:async)? + \s*{{templateArguments}}? + \s*{{parameters}} + \s*{{type}}? + \s*=> + ) + set: [ + normal-arrow-function, + arrow-identifier, + keyword + ] + # Single parameter arrow function assigned to variable. + - match: | + (?x) + (?= + \s*(?>const|let|var)\b + \s*{{commonIdentifier}} + \s*= + \s*(async)? + \s*{{commonIdentifier}} + \s*{{type}}? + \s*=> + ) + set: [ + single-parameter-arrow-function, + arrow-identifier, + keyword + ] + # Normal variable declaration. - match: | (?x) (?=\s*(?>const|let|var)\b) set: [ optional-type, - optional-variables, + variables, keyword ] @@ -42,7 +140,28 @@ contexts: keyword.declaration.variable.js.fjsx15 pop: true - optional-variables: + arrow-identifier: + - match: | + (?xi) + \s*({{commonIdentifier}}) + \s*(=) + captures: + 1: entity.name.function.js.fjsx15 + 2: punctuation.definition.function.assignment.js.fjsx1 + pop: true + + normal-arrow-function: + - include: Packages/Naomi/syntaxes/fjsx15/async.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/parameters.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/parameters.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/body.sublime-syntax + + single-parameter-arrow-function: + - include: Packages/Naomi/syntaxes/fjsx15/async.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/simple.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/body.sublime-syntax + + variables: - include: comment-no-pop - include: Packages/Naomi/syntaxes/fjsx15/destructuring/array.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/destructuring/object.sublime-syntax From 94a0583f04b4f2df64bb49f7c15428e5445daadb Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 10 Dec 2017 17:03:06 -0200 Subject: [PATCH 116/407] [FJSX15] Enhance single paramter arrow functions support --- syntaxes/fjsx15/function/parameter/simple.sublime-syntax | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/function/parameter/simple.sublime-syntax b/syntaxes/fjsx15/function/parameter/simple.sublime-syntax index ecff36e8..7b82b256 100644 --- a/syntaxes/fjsx15/function/parameter/simple.sublime-syntax +++ b/syntaxes/fjsx15/function/parameter/simple.sublime-syntax @@ -45,6 +45,6 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-associated-type.sublime-syntax optional-default-value: - - match: (?=\s*,) + - match: (?=\s*(?>,|=>)) pop: true - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax From 908cdba0ae7cfa28de3616a55978d8152802f484 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 10 Dec 2017 17:03:06 -0200 Subject: [PATCH 117/407] [FJSX15] Simplify --- syntaxes/fjsx15/function.sublime-syntax | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/syntaxes/fjsx15/function.sublime-syntax b/syntaxes/fjsx15/function.sublime-syntax index 9c2c6b12..d8f439f0 100644 --- a/syntaxes/fjsx15/function.sublime-syntax +++ b/syntaxes/fjsx15/function.sublime-syntax @@ -26,9 +26,7 @@ contexts: main: - match: | (?x)\s* - (?: - (async)\s+ - )? + (?:(async)\s+)? \b(function)\b captures: 1: >- From f7fbb90e8b260423ce4baa4557a47ca2bc0f9867 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 10 Dec 2017 17:03:06 -0200 Subject: [PATCH 118/407] [FJSX15] Use no pop --- syntaxes/fjsx15/core.sublime-syntax | 87 +++++++---------------------- 1 file changed, 20 insertions(+), 67 deletions(-) diff --git a/syntaxes/fjsx15/core.sublime-syntax b/syntaxes/fjsx15/core.sublime-syntax index b5585ffc..f95c9902 100644 --- a/syntaxes/fjsx15/core.sublime-syntax +++ b/syntaxes/fjsx15/core.sublime-syntax @@ -40,13 +40,11 @@ contexts: - include: internationalization - include: web-assembly - optional-template-arguments: - - match: lol - scope: keyword - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/optional-arguments.sublime-syntax - - optional-core-arguments: - - include: Packages/Naomi/syntaxes/fjsx15/function-call/support/optional-core-arguments.sublime-syntax + optional-template-and-arguments: + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/arguments.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/function-call/support/core-arguments.no-pop.sublime-syntax + - match: (?=\s*\S) + pop: true array-functions: - match: | @@ -64,10 +62,7 @@ contexts: 3: >- support.core.js.fjsx15 entity.name.function.js.fjsx15 - set: [ - optional-core-arguments, - optional-template-arguments - ] + set: optional-template-and-arguments math-constants: - match: | @@ -129,10 +124,7 @@ contexts: 3: >- support.core.js.fjsx15 entity.name.function.js.fjsx15 - set: [ - optional-core-arguments, - optional-template-arguments - ] + set: optional-template-and-arguments object-functions: - match: | @@ -159,10 +151,7 @@ contexts: 3: >- support.core.js.fjsx15 entity.name.function.js.fjsx15 - set: [ - optional-core-arguments, - optional-template-arguments - ] + set: optional-template-and-arguments symbol-functions: - match: | @@ -180,10 +169,7 @@ contexts: 3: >- support.core.js.fjsx15 entity.name.function.js.fjsx15 - set: [ - optional-core-arguments, - optional-template-arguments - ] + set: optional-template-and-arguments symbol-properties: - match: | @@ -243,10 +229,7 @@ contexts: 1: >- support.core.js.fjsx15 entity.name.function.js.fjsx15 - set: [ - optional-core-arguments, - optional-template-arguments - ] + set: optional-template-and-arguments function-properties: - match: | @@ -281,10 +264,7 @@ contexts: 1: >- support.core.js.fjsx15 entity.name.class.js.fjsx15 - set: [ - optional-core-arguments, - optional-template-arguments - ] + set: optional-template-and-arguments numbers-and-dates: - match: | @@ -297,10 +277,7 @@ contexts: 1: >- support.core.js.fjsx15 entity.name.class.js.fjsx15 - set: [ - optional-core-arguments, - optional-template-arguments - ] + set: optional-template-and-arguments text-processing: - match: | @@ -312,10 +289,7 @@ contexts: 1: >- support.core.js.fjsx15 entity.name.class.js.fjsx15 - set: [ - optional-core-arguments, - optional-template-arguments - ] + set: optional-template-and-arguments indexed-collections: - match: | @@ -330,10 +304,7 @@ contexts: 1: >- support.core.js.fjsx15 entity.name.class.js.fjsx15 - set: [ - optional-core-arguments, - optional-template-arguments - ] + set: optional-template-and-arguments keyed-collections: - match: | @@ -346,10 +317,7 @@ contexts: 1: >- support.core.js.fjsx15 entity.name.class.js.fjsx15 - set: [ - optional-core-arguments, - optional-template-arguments - ] + set: optional-template-and-arguments structured-data: - match: | @@ -362,10 +330,7 @@ contexts: 1: >- support.core.js.fjsx15 entity.name.class.js.fjsx15 - set: [ - optional-core-arguments, - optional-template-arguments - ] + set: optional-template-and-arguments control-abstraction-objects: - match: | @@ -377,10 +342,7 @@ contexts: 1: >- support.core.js.fjsx15 entity.name.class.js.fjsx15 - set: [ - optional-core-arguments, - optional-template-arguments - ] + set: optional-template-and-arguments reflection: - match: | @@ -392,10 +354,7 @@ contexts: 1: >- support.core.js.fjsx15 entity.name.class.js.fjsx15 - set: [ - optional-core-arguments, - optional-template-arguments - ] + set: optional-template-and-arguments internationalization: - match: | @@ -416,10 +375,7 @@ contexts: 3: >- support.core.js.fjsx15 entity.name.class.js.fjsx15 - set: [ - optional-core-arguments, - optional-template-arguments - ] + set: optional-template-and-arguments web-assembly: - match: | @@ -444,7 +400,4 @@ contexts: 3: >- support.core.js.fjsx15 entity.name.class.js.fjsx15 - set: [ - optional-core-arguments, - optional-template-arguments - ] + set: optional-template-and-arguments From fddd6c08af7283c92b3218291872afa9ac3975ca Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 10 Dec 2017 17:03:06 -0200 Subject: [PATCH 119/407] [FJSX15] Make core arguments pop --- syntaxes/fjsx15/core.sublime-syntax | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/core.sublime-syntax b/syntaxes/fjsx15/core.sublime-syntax index f95c9902..2cd7ce57 100644 --- a/syntaxes/fjsx15/core.sublime-syntax +++ b/syntaxes/fjsx15/core.sublime-syntax @@ -42,7 +42,7 @@ contexts: optional-template-and-arguments: - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/arguments.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/function-call/support/core-arguments.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/function-call/support/core-arguments.sublime-syntax - match: (?=\s*\S) pop: true From 8e9943467ff4b7b483a7fe6cdb2d27a0147d60b5 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 10 Dec 2017 17:03:06 -0200 Subject: [PATCH 120/407] [FJSX15] Restore the new operator --- syntaxes/fjsx15/operator.sublime-syntax | 1 + syntaxes/fjsx15/{ => operator}/new.sublime-syntax | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) rename syntaxes/fjsx15/{ => operator}/new.sublime-syntax (88%) diff --git a/syntaxes/fjsx15/operator.sublime-syntax b/syntaxes/fjsx15/operator.sublime-syntax index 1834e2e5..84a4837a 100644 --- a/syntaxes/fjsx15/operator.sublime-syntax +++ b/syntaxes/fjsx15/operator.sublime-syntax @@ -24,6 +24,7 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/operator/bitwise.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/comparison.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/logical.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/operator/new.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/other.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/pipe.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/relational.sublime-syntax diff --git a/syntaxes/fjsx15/new.sublime-syntax b/syntaxes/fjsx15/operator/new.sublime-syntax similarity index 88% rename from syntaxes/fjsx15/new.sublime-syntax rename to syntaxes/fjsx15/operator/new.sublime-syntax index 8c2ca140..6cd1c720 100644 --- a/syntaxes/fjsx15/new.sublime-syntax +++ b/syntaxes/fjsx15/operator/new.sublime-syntax @@ -32,7 +32,7 @@ contexts: captures: 1: keyword.other.js.fjsx15 set: [ - optional-template-and-args, + optional-template-and-arguments, type ] # Any other expression after the keyword. @@ -51,8 +51,8 @@ contexts: 1: entity.name.class.js.fjsx15 pop: true - optional-template-and-args: + optional-template-and-arguments: - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/arguments.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/type/arguments.sublime-syntax - - match: "" + - include: Packages/Naomi/syntaxes/fjsx15/function-call/arguments.sublime-syntax + - match: (?=\s*\S) pop: true From b92c98e6d6f7a8d4647c107e9ee539a8f5c742a9 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 10 Dec 2017 17:03:06 -0200 Subject: [PATCH 121/407] [FJSX15] Simplify arrow functions --- .../fjsx15/arrow-function/body.sublime-syntax | 25 +++--- .../parameters.no-pop.sublime-syntax | 26 ++++++ .../arrow-function/parameters.sublime-syntax | 79 ++++--------------- 3 files changed, 53 insertions(+), 77 deletions(-) create mode 100644 syntaxes/fjsx15/arrow-function/parameters.no-pop.sublime-syntax diff --git a/syntaxes/fjsx15/arrow-function/body.sublime-syntax b/syntaxes/fjsx15/arrow-function/body.sublime-syntax index 0dc98979..23658de1 100644 --- a/syntaxes/fjsx15/arrow-function/body.sublime-syntax +++ b/syntaxes/fjsx15/arrow-function/body.sublime-syntax @@ -29,31 +29,32 @@ contexts: set: possible-multi-statement-body possible-multi-statement-body: - - include: comment + - include: comment-no-pop - match: \s*(\{) captures: 1: >- arrow.js.fjsx15 punctuation.definition.function.body.begin.js.fjsx15 - set: multi-statement-body + set: [ + close-body, + optional-statements-and-expressions + ] - match: (?=\s*\S) pop: true - multi-statement-body: + close-body: - match: \s*(}) captures: 1: >- arrow.js.fjsx15 punctuation.definition.function.body.end.js.fjsx15 - pop: true - - match: "" - push: - # - include: statement-and-expression - - match: "" - pop: true + set: optional-expression-tail + + optional-statements-and-expressions: + - include: Packages/Naomi/syntaxes/fjsx15/optional-statements-and-expressions.sublime-syntax - comment: + comment-no-pop: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - # statement-and-expression: - # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + optional-expression-tail: + - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax#optional-tail diff --git a/syntaxes/fjsx15/arrow-function/parameters.no-pop.sublime-syntax b/syntaxes/fjsx15/arrow-function/parameters.no-pop.sublime-syntax new file mode 100644 index 00000000..fdec957b --- /dev/null +++ b/syntaxes/fjsx15/arrow-function/parameters.no-pop.sublime-syntax @@ -0,0 +1,26 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +contexts: + main: + - match: (?=\s*\() + push: parameters + + parameters: + - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/parameters.sublime-syntax diff --git a/syntaxes/fjsx15/arrow-function/parameters.sublime-syntax b/syntaxes/fjsx15/arrow-function/parameters.sublime-syntax index a4f19c45..daeb8808 100644 --- a/syntaxes/fjsx15/arrow-function/parameters.sublime-syntax +++ b/syntaxes/fjsx15/arrow-function/parameters.sublime-syntax @@ -29,83 +29,32 @@ contexts: 1: >- arrow.js.fjsx15 punctuation.definition.function.parameters.begin.js.fjsx15 - set: parameters + set: [ delimiters, optional-parameter ] - parameters: + delimiters: - match: \s*(\,) captures: 1: >- arrow.js.fjsx15 punctuation.definition.function.parameters.js.fjsx15 + push: optional-parameter - match: \s*(\)) captures: 1: >- arrow.js.fjsx15 punctuation.definition.function.parameters.end.js.fjsx15 - set: return-type - - match: "" - push: - - match: | - (?x) - (?=\s*(?>,|\))) - pop: true - - include: comment - - include: rest-operator - # Parameter type. - - match: (?=\s*:) - set: associated-type - # Default value. - - match: (?=\s*=) - set: default-value - # Object destructuring. - - match: (?=\s*\{) - set: destructuring-object - # Array destructuring. - - match: (?=\s*\[) - set: destructuring-array - # Reserved word. - - match: \s*(arguments)(?=\W) - captures: - 1: keyword.other.js.fjsx15 - pop: true - # Parameter. - - include: Packages/Naomi/syntaxes/fjsx15/function/parameters/simple.sublime-syntax + set: optional-return-type - associated-type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax - - default-value: - - match: | - (?x) - (?=\s*(?>,|\))) - pop: true - - match: "" - push: - # - include: statement-and-expression - - match: "" - pop: true - - rest-operator: - - include: Packages/Naomi/syntaxes/fjsx15/operator/rest.sublime-syntax - - comment: - - include: Packages/Naomi/syntaxes/fjsx15/comment.sublime-syntax - - destructuring-object: - - include: Packages/Naomi/syntaxes/fjsx15/function/parameters/destructuring/object.sublime-syntax - - destructuring-array: - - include: Packages/Naomi/syntaxes/fjsx15/function/parameters/destructuring/array.sublime-syntax - - return-type: - - include: comment - - match: (?=\s*:) - set: associated-type - - match: "" + optional-parameter: + - include: comment-no-pop + - match: (?=\s*[,)]) pop: true + - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/destructuring/array.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/simple.sublime-syntax - type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type.sublime-syntax + comment-no-pop: + - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - # statement-and-expression: - # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + optional-return-type: + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-associated-type.sublime-syntax From 425ee8b6b752068a237afd31545e2e756450f904 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 10 Dec 2017 17:03:06 -0200 Subject: [PATCH 122/407] [FJSX15] Add arrow functions to expressions --- .../arrow-function.no-pop.sublime-syntax | 117 ++--------- syntaxes/fjsx15/arrow-function.sublime-syntax | 194 ------------------ syntaxes/fjsx15/expression.sublime-syntax | 7 +- 3 files changed, 23 insertions(+), 295 deletions(-) delete mode 100644 syntaxes/fjsx15/arrow-function.sublime-syntax diff --git a/syntaxes/fjsx15/arrow-function.no-pop.sublime-syntax b/syntaxes/fjsx15/arrow-function.no-pop.sublime-syntax index c61968c9..cb182390 100644 --- a/syntaxes/fjsx15/arrow-function.no-pop.sublime-syntax +++ b/syntaxes/fjsx15/arrow-function.no-pop.sublime-syntax @@ -74,121 +74,42 @@ variables: flowComment: /\*\s*:.*?\*/ - returnType: | + type: | (?> {{flowComment}} - | (?::{{complexType}}) - )? + | :{{complexType}} + ) contexts: main: - # Normal arrow function assigned to variable/constant. - - match: | - (?xi) - \s*((?>const|let|var)\b)? - \s*({{commonIdentifier}}) - \s*(=) - \s*(async)? - (?= - \s*{{templateArguments}}? - \s*{{parameters}} - \s*{{returnType}} - \s*=> - ) - captures: - 1: >- - storage.type.js.fjsx15 - keyword.declaration.variable.js.fjsx15 - 2: entity.name.function.js.fjsx15 - 3: punctuation.definition.function.assignment.js.fjsx1 - 4: >- - storage.modifier.js.fjsx15 - keyword.other.async.js.fjsx15 - push: [ - body, - template-and-parameters - ] - # Single parameter arrow function assigned to variable. - - match: | - (?xi) - \s*((?>const|let|var)\b)? - \s*({{commonIdentifier}}) - \s*(=) - \s*(async)? - (?= - \s*{{commonIdentifier}} - \s*{{returnType}} - \s*=> - ) - captures: - 1: >- - storage.type.js.fjsx15 - keyword.declaration.variable.js.fjsx15 - 2: entity.name.function.js.fjsx15 - 3: punctuation.definition.function.assignment.js.fjsx1 - 4: >- - storage.modifier.js.fjsx15 - keyword.other.async.js.fjsx15 - push: [ - body, - single-parameter - ] # Normal arrow function. - match: | (?xi) - \s*(async)? (?= + \s*(async)? \s*{{templateArguments}}? \s*{{parameters}} - \s*{{returnType}} + \s*{{type}}? \s*=> ) - captures: - 1: >- - storage.modifier.js.fjsx15 - keyword.other.async.js.fjsx15 - push: [ - body, - template-and-parameters - ] + push: normal-arrow-function # Single parameter. - match: | (?xi) - \s*(async)? (?= + \s*(async)? \s*{{commonIdentifier}} - \s*{{returnType}} + \s*{{type}}? \s*=> ) - captures: - 1: keyword.other.async.js.fjsx15 - push: [ - body, - single-parameter - ] - - single-parameter: - - match: (?=\s*=>) - pop: true - - match: "" - push: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax - # Parameter. - - match: | - (?xi) - ({{commonIdentifier}})(\?)? - captures: - 0: function.parameter.js.fjsx15 - 1: entity.name.variable.js.fjsx15 - 2: keyword.operator.other.optional.flowtype - pop: true - - template-and-parameters: - - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/parameters.sublime-syntax - - match: "" - push: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/parameters.sublime-syntax - - match: "" - pop: true - - body: + push: single-parameter-arrow-function + + normal-arrow-function: + - include: Packages/Naomi/syntaxes/fjsx15/async.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/parameters.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/parameters.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/body.sublime-syntax + + single-parameter-arrow-function: + - include: Packages/Naomi/syntaxes/fjsx15/async.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/simple.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/body.sublime-syntax diff --git a/syntaxes/fjsx15/arrow-function.sublime-syntax b/syntaxes/fjsx15/arrow-function.sublime-syntax deleted file mode 100644 index 00a3c02a..00000000 --- a/syntaxes/fjsx15/arrow-function.sublime-syntax +++ /dev/null @@ -1,194 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - - templateArguments: | - (< - [^<>]* - \g<-1>? - [^<>]* - >) - - parameters: | - (\( - [^()]* - \g<-1>? - [^()]* - \)) - - flowOperators: | - (?> &(?!&) - | \|(?!\|) - ) - - string: | - (?> '.*?' - | ".*?" - | `.*` - ) - - simpleFlowType: | - (?> {{string}} - | {{commonIdentifier}} - {{templateArguments}}? - ) - - flowFunction: | - ( - {{parameters}} - \s*=>\s* - (?> {{simpleFlowType}} - | \g<-2> - ) - ) - - complexType: | - ( - \??\s* - (?> {{simpleFlowType}} - | {{flowFunction}} - ) - \s*{{flowOperators}}? - \s*\g<-5>? - ) - - flowComment: /\*\s*:.*?\*/ - - returnType: | - (?> {{flowComment}} - | (?::{{complexType}}) - )? - -contexts: - main: - # Normal arrow function assigned to variable/constant. - - match: | - (?xi) - \s*((?>const|let|var)\b)? - \s*({{commonIdentifier}}) - \s*(=) - \s*(async)? - (?= - \s*{{templateArguments}}? - \s*{{parameters}} - \s*{{returnType}} - \s*=> - ) - captures: - 1: >- - storage.type.js.fjsx15 - keyword.declaration.variable.js.fjsx15 - 2: entity.name.function.js.fjsx15 - 3: punctuation.definition.function.assignment.js.fjsx1 - 4: >- - storage.modifier.js.fjsx15 - keyword.other.async.js.fjsx15 - set: [ - body, - template-and-parameters - ] - # Single parameter arrow function assigned to variable. - - match: | - (?xi) - \s*((?>const|let|var)\b)? - \s*({{commonIdentifier}}) - \s*(=) - \s*(async)? - (?= - \s*{{commonIdentifier}} - \s*{{returnType}} - \s*=> - ) - captures: - 1: >- - storage.type.js.fjsx15 - keyword.declaration.variable.js.fjsx15 - 2: entity.name.function.js.fjsx15 - 3: punctuation.definition.function.assignment.js.fjsx1 - 4: >- - storage.modifier.js.fjsx15 - keyword.other.async.js.fjsx15 - set: [ - body, - single-parameter - ] - # Normal arrow function. - - match: | - (?xi) - \s*(async)? - (?= - \s*{{templateArguments}}? - \s*{{parameters}} - \s*{{returnType}} - \s*=> - ) - captures: - 1: >- - storage.modifier.js.fjsx15 - keyword.other.async.js.fjsx15 - set: [ - body, - template-and-parameters - ] - # Single parameter. - - match: | - (?xi) - \s*(async)? - (?= - \s*{{commonIdentifier}} - \s*{{returnType}} - \s*=> - ) - captures: - 1: keyword.other.async.js.fjsx15 - set: [ - body, - single-parameter - ] - - single-parameter: - - match: (?=\s*=>) - pop: true - - match: "" - push: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax - # Parameter. - - match: | - (?xi) - ({{commonIdentifier}})(\?)? - captures: - 0: function.parameter.js.fjsx15 - 1: entity.name.variable.js.fjsx15 - 2: keyword.operator.other.optional.flowtype - pop: true - - template-and-parameters: - - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/parameters.sublime-syntax - - match: "" - push: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/parameters.sublime-syntax - - match: "" - pop: true - - body: - - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/body.sublime-syntax diff --git a/syntaxes/fjsx15/expression.sublime-syntax b/syntaxes/fjsx15/expression.sublime-syntax index 2691cf99..299a5954 100644 --- a/syntaxes/fjsx15/expression.sublime-syntax +++ b/syntaxes/fjsx15/expression.sublime-syntax @@ -18,9 +18,6 @@ hidden: true scope: ... variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* expressionGroupBegin: \s*(\() expressionBegin: (?=\s*\S) @@ -31,6 +28,8 @@ contexts: # At this stage, regex literals will have a higher priority than operators. - match: (?=\s*/.*?(? Date: Sun, 10 Dec 2017 17:03:06 -0200 Subject: [PATCH 123/407] [FJSX15] Add type aliasing --- .../associated-type.no-pop.sublime-syntax | 26 +++++++ .../flowtype/type-aliasing.sublime-syntax | 70 +++++++++++++++++++ syntaxes/fjsx15/statement.sublime-syntax | 1 + 3 files changed, 97 insertions(+) create mode 100644 syntaxes/fjsx15/flowtype/associated-type.no-pop.sublime-syntax create mode 100644 syntaxes/fjsx15/flowtype/type-aliasing.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/associated-type.no-pop.sublime-syntax b/syntaxes/fjsx15/flowtype/associated-type.no-pop.sublime-syntax new file mode 100644 index 00000000..6c662073 --- /dev/null +++ b/syntaxes/fjsx15/flowtype/associated-type.no-pop.sublime-syntax @@ -0,0 +1,26 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +contexts: + main: + - match: (?=\s*:) + push: associated-type + + associated-type: + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/type-aliasing.sublime-syntax b/syntaxes/fjsx15/flowtype/type-aliasing.sublime-syntax new file mode 100644 index 00000000..d6333db7 --- /dev/null +++ b/syntaxes/fjsx15/flowtype/type-aliasing.sublime-syntax @@ -0,0 +1,70 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + + templateArguments: | + (< + [^<>]* + \g<-1>? + [^<>]* + >) + +contexts: + main: + - match: | + (?xi)\s* + (?:(opaque)\s+)? + (type)\b + (?=\s+ + {{commonIdentifier}} + {{templateArguments}}? + ) + captures: + 1: >- + flowtype + storage.type.flowtype + keyword.other.access.flowtype + 2: >- + flowtype + storage.type.flowtype + keyword.declaration.type-aliasing.flowtype + set: [ + punctuation, + identifier + ] + + identifier: + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/simple.sublime-syntax + + punctuation: + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/parameters.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.no-pop.sublime-syntax + - match: \s*(=) + captures: + 1: >- + flowtype + keyword.operator.other.assignment.flowtype + set: type-expression + + type-expression: + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type-expression.sublime-syntax diff --git a/syntaxes/fjsx15/statement.sublime-syntax b/syntaxes/fjsx15/statement.sublime-syntax index 79cfe6e1..2acc4069 100644 --- a/syntaxes/fjsx15/statement.sublime-syntax +++ b/syntaxes/fjsx15/statement.sublime-syntax @@ -20,5 +20,6 @@ scope: ... contexts: main: - include: Packages/Naomi/syntaxes/fjsx15/class.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type-aliasing.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/variable-declaration.sublime-syntax From 8a6fbf85def6b0af19a60a18dddea672421d3870 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 10 Dec 2017 17:03:06 -0200 Subject: [PATCH 124/407] [FJSX15] Restore flow tuples and objects --- .../fjsx15/flowtype/object.sublime-syntax | 174 ++++++++++++++++++ syntaxes/fjsx15/flowtype/tuple.sublime-syntax | 44 +++++ .../flowtype/type-expression.sublime-syntax | 2 + 3 files changed, 220 insertions(+) create mode 100644 syntaxes/fjsx15/flowtype/object.sublime-syntax create mode 100644 syntaxes/fjsx15/flowtype/tuple.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/object.sublime-syntax b/syntaxes/fjsx15/flowtype/object.sublime-syntax new file mode 100644 index 00000000..10c11f86 --- /dev/null +++ b/syntaxes/fjsx15/flowtype/object.sublime-syntax @@ -0,0 +1,174 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + + constantIdentifier: | + [$_[:upper:]] + [$_[:upper:][:digit:]]* + +contexts: + main: + # Exact. + - match: \s*({)\s*(\|) + captures: + 1: >- + flowtype + punctuation.definition.object.begin.flowtype + 2: >- + flowtype + punctuation.definition.object.begin.flowtype + set: [ delimiters, optional-property ] + # Normal. + - match: \s*({) + captures: + 1: >- + flowtype + punctuation.definition.object.begin.flowtype + set: [ delimiters, optional-property ] + + delimiters: + - match: \s*(,|;) + captures: + 1: >- + flowtype + punctuation.definition.object.flowtype + push: optional-property + # Exact. + - match: \s*(\|)\s*(}) + captures: + 1: >- + flowtype + punctuation.definition.object.end.flowtype + 2: >- + flowtype + punctuation.definition.object.end.flowtype + pop: true + # Normal. + - match: \s*(}) + captures: + 1: >- + flowtype + punctuation.definition.object.end.flowtype + pop: true + # - match: "" + # push: + # - include: comment + # - include: Packages/Naomi/syntaxes/fjsx15/flowtype/co-contravariant.no-pop.sublime-syntax + # - include: Packages/Naomi/syntaxes/fjsx15/flowtype/indexer.sublime-syntax + # - include: Packages/Naomi/syntaxes/fjsx15/flowtype/callable.sublime-syntax + # - include: Packages/Naomi/syntaxes/fjsx15/class/method.sublime-syntax + # - include: property + # - match: "" + # pop: true + + optional-property: + - match: (?=\s*[|}]) + pop: true + - include: constant + - include: variable + # String property name. + - match: (?=\s*(?>'|"|`)) + set: [ + associated-type, + string + ] + + constant: + # Single character. + - match: | + (?x)\s* + ([_[:upper:]])\b + (?:\s*(\?\B))? + captures: + 1: >- + object.property.js.fjsx15 + entity.name.constant.js.fjsx15 + 2: >- + flowtype + keyword.operator.other.optional.flowtype + set: associated-type + # Two or more characters. + - match: | + (?x)\s* + ( + {{constantIdentifier}} + (?> \$\B + | [_[:upper:]]\b + ) + ) + (?:\s*(\?\B))? + captures: + 1: >- + object.property.js.fjsx15 + entity.name.constant.js.fjsx15 + 2: >- + flowtype + keyword.operator.other.optional.flowtype + set: associated-type + + variable: + # Single character. + - match: | + (?xi)\s* + ((?> \$\B + | [_[:alpha:]]\b + )) + (?:\s*(\?))? + captures: + 1: >- + object.property.js.fjsx15 + entity.name.variable.js.fjsx15 + 2: >- + flowtype + keyword.operator.other.optional.flowtype + set: associated-type + # Two or more characters. + - match: | + (?xi)\s* + ( + {{commonIdentifier}} + (?> \$\B + | [_[:alnum:]]\b + ) + ) + (?:\s*(\?))? + captures: + 1: >- + object.property.js.fjsx15 + entity.name.variable.js.fjsx15 + 2: >- + flowtype + keyword.operator.other.optional.flowtype + set: associated-type + + string: + - include: Packages/Naomi/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/literal/string/template.sublime-syntax + + associated-type: + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax + + comment: + - include: Packages/Naomi/syntaxes/fjsx15/comment.sublime-syntax + diff --git a/syntaxes/fjsx15/flowtype/tuple.sublime-syntax b/syntaxes/fjsx15/flowtype/tuple.sublime-syntax new file mode 100644 index 00000000..be87ac73 --- /dev/null +++ b/syntaxes/fjsx15/flowtype/tuple.sublime-syntax @@ -0,0 +1,44 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +contexts: + main: + - match: \s*(\[) + captures: + 1: >- + flowtype + punctuation.definition.array.begin.flowtype + set: [ delimiters, optional-type-expression ] + + delimiters: + - match: \s*(,) + captures: + 1: >- + flowtype + punctuation.definition.array.flowtype + push: optional-type-expression + - match: \s*(]) + captures: + 1: >- + flowtype + punctuation.definition.array.end.flowtype + pop: true + + optional-type-expression: + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-type-expression.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/type-expression.sublime-syntax b/syntaxes/fjsx15/flowtype/type-expression.sublime-syntax index ce5f676c..e9a4dfb9 100644 --- a/syntaxes/fjsx15/flowtype/type-expression.sublime-syntax +++ b/syntaxes/fjsx15/flowtype/type-expression.sublime-syntax @@ -87,6 +87,8 @@ contexts: head: - include: comment-no-pop + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/object.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/tuple.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/literal/number.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax From 29f696a6fb3b2b4918578188237a91e8cbdb8c06 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 10 Dec 2017 17:03:06 -0200 Subject: [PATCH 125/407] [FJSX15] Add comment support to flow objects --- syntaxes/fjsx15/flowtype/object.sublime-syntax | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/syntaxes/fjsx15/flowtype/object.sublime-syntax b/syntaxes/fjsx15/flowtype/object.sublime-syntax index 10c11f86..8747b5b2 100644 --- a/syntaxes/fjsx15/flowtype/object.sublime-syntax +++ b/syntaxes/fjsx15/flowtype/object.sublime-syntax @@ -82,6 +82,7 @@ contexts: # pop: true optional-property: + - include: comment-no-pop - match: (?=\s*[|}]) pop: true - include: constant @@ -169,6 +170,6 @@ contexts: associated-type: - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax - comment: - - include: Packages/Naomi/syntaxes/fjsx15/comment.sublime-syntax + comment-no-pop: + - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax From 52e649ef511a45edd43c4a6c2dba6f6efe6757f8 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 10 Dec 2017 17:03:06 -0200 Subject: [PATCH 126/407] [FJSX15] Remove dead code --- syntaxes/fjsx15/flowtype/object.sublime-syntax | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/syntaxes/fjsx15/flowtype/object.sublime-syntax b/syntaxes/fjsx15/flowtype/object.sublime-syntax index 8747b5b2..aeeb503b 100644 --- a/syntaxes/fjsx15/flowtype/object.sublime-syntax +++ b/syntaxes/fjsx15/flowtype/object.sublime-syntax @@ -70,16 +70,6 @@ contexts: flowtype punctuation.definition.object.end.flowtype pop: true - # - match: "" - # push: - # - include: comment - # - include: Packages/Naomi/syntaxes/fjsx15/flowtype/co-contravariant.no-pop.sublime-syntax - # - include: Packages/Naomi/syntaxes/fjsx15/flowtype/indexer.sublime-syntax - # - include: Packages/Naomi/syntaxes/fjsx15/flowtype/callable.sublime-syntax - # - include: Packages/Naomi/syntaxes/fjsx15/class/method.sublime-syntax - # - include: property - # - match: "" - # pop: true optional-property: - include: comment-no-pop From 4b133ee87836362b2fa85c17cfc32cdfe28a1c65 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 10 Dec 2017 17:03:06 -0200 Subject: [PATCH 127/407] [FJSX15] Move eslint commands --- syntaxes/fjsx15/comment.sublime-syntax | 2 +- syntaxes/fjsx15/{ => comment}/eslint.sublime-syntax | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename syntaxes/fjsx15/{ => comment}/eslint.sublime-syntax (100%) diff --git a/syntaxes/fjsx15/comment.sublime-syntax b/syntaxes/fjsx15/comment.sublime-syntax index 142e4a07..c5ae6d62 100644 --- a/syntaxes/fjsx15/comment.sublime-syntax +++ b/syntaxes/fjsx15/comment.sublime-syntax @@ -19,8 +19,8 @@ scope: ... contexts: main: - - include: Packages/Naomi/syntaxes/fjsx15/eslint.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/flowtype/prolog.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/comment/eslint.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/comment/flowtype.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/comment/documentation.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/comment/normal.sublime-syntax diff --git a/syntaxes/fjsx15/eslint.sublime-syntax b/syntaxes/fjsx15/comment/eslint.sublime-syntax similarity index 100% rename from syntaxes/fjsx15/eslint.sublime-syntax rename to syntaxes/fjsx15/comment/eslint.sublime-syntax From a841157b1ff36a07b7ce36d15e4e07ac3818fcb7 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 10 Dec 2017 17:03:06 -0200 Subject: [PATCH 128/407] [FJSX15] Remove dead code --- syntaxes/fjsx15/global.sublime-syntax | 301 -------------------------- 1 file changed, 301 deletions(-) delete mode 100644 syntaxes/fjsx15/global.sublime-syntax diff --git a/syntaxes/fjsx15/global.sublime-syntax b/syntaxes/fjsx15/global.sublime-syntax deleted file mode 100644 index ff666848..00000000 --- a/syntaxes/fjsx15/global.sublime-syntax +++ /dev/null @@ -1,301 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - -# This file will include global variables/classes that are available in NodeJS -# and browsers. -contexts: - main: - - include: simple-class - - include: complex-class - - include: simple-function - - include: complex-function - - include: simple-variable - - include: complex-variable - - arguments: - - include: Packages/Naomi/syntaxes/fjsx15/function-call/support/core-arguments.sublime-syntax - - member-access-operator: - - match: \s*(\.) - captures: - 1: keyword.operator.other.member-access.js.fjsx15 - - simple-class: - - match: | - (?x)\s* - ((?> Array(?:Buffer)? - | Boolean - | DataView - | Date - | Error - | EvalError - | Float32Array - | Float64Array - | Function - | Generator - | GeneratorFunction - | Infinity - | Int16Array - | Int32Array - | Int8Array - | InternalError - | JSON - | Map - | Math - | Number - | Object - | Promise - | Proxy - | RangeError - | ReferenceError - | Reflect - | RegExp - | Set - | String - | Symbol - | SyntaxError - | TypeError - | TypedArray - | URIError - | Uint16Array - | Uint32Array - | Uint8Array - | Uint8ClampedArray - | WeakMap - | WeakSet - ))\b - captures: - 1: >- - support.js.fjsx15 - entity.name.class.js.fjsx15 - set: optional-constructor - - complex-class: - - match: | - (?x)\s* - (?= - (?> Intl.Collator - | Intl.DateTimeFormat - | Intl.NumberFormat - | Intl - )\b - ) - set: complex-class-components - - complex-class-components: - - include: member-access-operator - - match: | - (?x)\s* - ((?> Intl - | Collator - | DateTimeFormat - | NumberFormat - ))\b - captures: - 1: >- - support.js.fjsx15 - entity.name.class.js.fjsx15 - set: optional-constructor - - optional-constructor: - - include: arguments - - match: "" - pop: true - - simple-variable: - - match: | - (?x)\s* - ((?> __dirname - | __filename - ))\b - captures: - 1: >- - support.js.fjsx15 - entity.name.variable.js.fjsx15 - pop: true - - complex-variable: - - match: | - (?x)\s* - (?= - (?> env - | module(?:\.(?>exports|parent))? - | process\. - (?> arch - | argv - | config - | connected - ) - | window(?:\.onload)? - )\b - ) - set: complex-variable-components - - complex-variable-components: - - include: member-access-operator - - include: global-variable - - match: "" - pop: true - - simple-function: - - match: | - (?x)\s* - ((?> decodeURI(?:Component)? - | encodeURI(?:Component)? - | eval - | isFinite - | isNaN - | parseFloat - | parseInt - | require - | setImmediate - | setInterval - | setTimeout - | uneval - )) - (?=\s*\() - captures: - 1: >- - support.js.fjsx15 - entity.name.function.js.fjsx15 - set: arguments - - complex-function: - - match: | - (?x)\s* - (?= - (?> console\. - (?> assert - | dir - | error - | info - | log - | timeEnd - | time - | trace - | warn - ) - | document\. - (?> addEventListener - | adoptNode - | close - | createAttribute - | createComment - | createDocumentFragment - | createElement - | createTextNode - | getElementById - | getElementByClassName - | getElementsByName - | getElementsByTagName - | hasFocus - | importNode - | normalize(?:Document)? - | open - | querySelector(?:all)? - | removeEventListener - | renameNode - | write(?:ln)? - ) - | process\. - (?> exit - | stderr\.write - | stdout\.write - | on - ) - | window\. - (?> addEventListener - | - ) - ) - \s*\( - ) - set: complex-function-components - - complex-function-components: - - include: arguments - - include: member-access-operator - - include: global-variable - - match: | - (?x)\s* - ((?> addEventListener - | adoptNode - | assert - | close - | createAttribute - | createComment - | createDocumentFragment - | createElement - | createTextNode - | dir - | error - | exit - | getElementByClassName - | getElementById - | getElementsByName - | getElementsByTagName - | hasFocus - | importNode - | info - | log - | normalize(?:Document)? - | on - | open - | querySelector(?:all)? - | removeEventListener - | renameNode - | time - | timeEnd - | trace - | warn - | write(?:ln)? - ))\b - captures: - 1: >- - support.js.fjsx15 - entity.name.function.js.fjsx15 - - global-variable: - - match: | - (?x)\s* - ((?> arch - | argv - | config - | connected - | console - | document - | env - | exports - | filename - | module - | onload - | parent - | process - | stdout - | window - ))\b - captures: - 1: >- - support.js.fjsx15 - entity.name.variable.js.fjsx15 From 9bad10bf681e860847d5ced927c788bfc914e82d Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 10 Dec 2017 17:03:06 -0200 Subject: [PATCH 129/407] [FJSX15] Remove doc blocks --- syntaxes/fjsx15/comment.sublime-syntax | 1 - .../comment/documentation.sublime-syntax | 44 ------------- syntaxes/fjsx15/comment/ndoc.sublime-syntax | 63 ------------------- 3 files changed, 108 deletions(-) delete mode 100644 syntaxes/fjsx15/comment/documentation.sublime-syntax delete mode 100644 syntaxes/fjsx15/comment/ndoc.sublime-syntax diff --git a/syntaxes/fjsx15/comment.sublime-syntax b/syntaxes/fjsx15/comment.sublime-syntax index c5ae6d62..2600fc8e 100644 --- a/syntaxes/fjsx15/comment.sublime-syntax +++ b/syntaxes/fjsx15/comment.sublime-syntax @@ -22,5 +22,4 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/flowtype/prolog.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/comment/eslint.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/comment/flowtype.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/comment/documentation.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/comment/normal.sublime-syntax diff --git a/syntaxes/fjsx15/comment/documentation.sublime-syntax b/syntaxes/fjsx15/comment/documentation.sublime-syntax deleted file mode 100644 index be8fb4b9..00000000 --- a/syntaxes/fjsx15/comment/documentation.sublime-syntax +++ /dev/null @@ -1,44 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -contexts: - main: - - match: \s*(/\*\*)(?!/) - captures: - 1: punctuation.definition.comment.documentation.begin.js.fjsx15 - set: content - - content: - - meta_scope: comment.block.documentation.js.fjsx15 - - match: \s*(\*/) - captures: - 1: punctuation.definition.comment.documentation.end.js.fjsx15 - set: - # Used to fix the block comment indentation settings. - # https://forum.sublimetext.com/t/everything-you-n-ever-wanted-to-know-about-indentation-in-st3/26207/6 - - match: \s*$\n? - scope: meta.block-end.js.fjsx15 - pop: true - - match: '' - pop: true - - match: "" - push: - - include: Packages/Naomi/syntaxes/fjsx15/comment/ndoc.sublime-syntax - - match: (?=\s*\*/) - pop: true diff --git a/syntaxes/fjsx15/comment/ndoc.sublime-syntax b/syntaxes/fjsx15/comment/ndoc.sublime-syntax deleted file mode 100644 index 8a857498..00000000 --- a/syntaxes/fjsx15/comment/ndoc.sublime-syntax +++ /dev/null @@ -1,63 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -variables: - commonIdentifier: | - [_[:alpha:]] - [_[:alnum:]]* - -contexts: - main: - - include: param - - param: - - match: \s*\B(@)(param)\b - captures: - 1: >- - keyword.documentation.js.fjsx15 - punctuation.definition.keyword.begin.js.fjsx15 - 2: keyword.documentation.js.fjsx15 - set: param-args - - param-args: - - include: types-begin-no-pop - - include: Packages/Naomi/syntaxes/fjsx15/variable.sublime-syntax - - types-begin-no-pop: - - match: (?=\s*\{) - push: types-begin - - types-begin: - - match: \s*(\{) - captures: - 1: >- - jsdoc.js.fjsx15 - punctuation.definition.types.begin.js.fjsx15 - set: types - - types: - - match: \s*(}) - captures: - 1: >- - jsdoc.js.fjsx15 - punctuation.definition.types.end.js.fjsx15 - pop: true - - match: "" - push: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type.sublime-syntax From 482d6c95457aa10228f7ac5392c3f0001649d777 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 10 Dec 2017 17:03:06 -0200 Subject: [PATCH 130/407] [FJSX15] Simplify function declaration --- syntaxes/fjsx15/function.sublime-syntax | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/syntaxes/fjsx15/function.sublime-syntax b/syntaxes/fjsx15/function.sublime-syntax index d8f439f0..8caea4b4 100644 --- a/syntaxes/fjsx15/function.sublime-syntax +++ b/syntaxes/fjsx15/function.sublime-syntax @@ -25,17 +25,24 @@ variables: contexts: main: - match: | - (?x)\s* - (?:(async)\s+)? - \b(function)\b + (?x) + (?=\s* + (?:async\s+)? + function\b + ) + set: [ + declaration, + keyword + ] + + keyword: + - include: Packages/Naomi/syntaxes/fjsx15/async.no-pop.sublime-syntax + - match: \s*(function) captures: 1: >- - storage.modifier.js.fjsx15 - keyword.other.async.js.fjsx15 - 2: >- storage.type.js.fjsx15 keyword.declaration.function.js.fjsx15 - set: declaration + pop: true declaration: - include: comment-no-pop From f4b8c624db7aad2574cc1dee786e229960367efd Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 10 Dec 2017 17:03:06 -0200 Subject: [PATCH 131/407] [FJSX15] Enable class statements --- syntaxes/fjsx15/statement.sublime-syntax | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/statement.sublime-syntax b/syntaxes/fjsx15/statement.sublime-syntax index 2acc4069..aa6330b5 100644 --- a/syntaxes/fjsx15/statement.sublime-syntax +++ b/syntaxes/fjsx15/statement.sublime-syntax @@ -19,7 +19,7 @@ scope: ... contexts: main: - - include: Packages/Naomi/syntaxes/fjsx15/class.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type-aliasing.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/class.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/variable-declaration.sublime-syntax From 371e4ef02c76cb80b94eb0c0b902cf46db0c0250 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 10 Dec 2017 17:03:06 -0200 Subject: [PATCH 132/407] [FJSX15] Disable class body --- syntaxes/fjsx15/class/body.sublime-syntax | 58 +++++++++++------------ 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/syntaxes/fjsx15/class/body.sublime-syntax b/syntaxes/fjsx15/class/body.sublime-syntax index caf28a55..da887652 100644 --- a/syntaxes/fjsx15/class/body.sublime-syntax +++ b/syntaxes/fjsx15/class/body.sublime-syntax @@ -19,51 +19,51 @@ scope: ... contexts: main: - - include: comment + - include: comment-no-pop - match: \s*(\{) captures: 1: punctuation.definition.class.body.begin.js.fjsx15 set: body body: - - include: comment + - include: comment-no-pop - match: \s*(}) captures: 1: punctuation.definition.class.body.end.js.fjsx15 pop: true - - match: "" - push: - # This is necessary because normally these instance variables would be - # accessed using “this” but in the class body we can use the short version. - - match: | - (?x)\s* - ((?> props - | state - ))\b - captures: - 1: >- - support.core.js.fjsx15 - entity.name.variable.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 - 3: >- - support.lib.react-js.fjsx15 - entity.name.variable.js.fjsx15 - pop: true - - include: Packages/Naomi/syntaxes/fjsx15/comment.sublime-syntax + # - match: "" + # push: + # # This is necessary because normally these instance variables would be + # # accessed using “this” but in the class body we can use the short version. + # - match: | + # (?x)\s* + # ((?> props + # | state + # ))\b + # captures: + # 1: >- + # support.core.js.fjsx15 + # entity.name.variable.js.fjsx15 + # 2: keyword.operator.other.member-access.js.fjsx15 + # 3: >- + # support.lib.react-js.fjsx15 + # entity.name.variable.js.fjsx15 + # pop: true + # - include: Packages/Naomi/syntaxes/fjsx15/comment.sublime-syntax # - include: Packages/Naomi/syntaxes/fjsx15/operator/comma.sublime-syntax # React’s variables (state, contextTypes, etc...). - - include: Packages/Naomi/syntaxes/fjsx15/react-js.sublime-syntax + # - include: Packages/Naomi/syntaxes/fjsx15/react-js.sublime-syntax # Any methods (including supporting libraries’ methods). - - include: Packages/Naomi/syntaxes/fjsx15/class/method.sublime-syntax + # - include: Packages/Naomi/syntaxes/fjsx15/class/method.sublime-syntax # Flow fields and indexers. - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/field.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/indexer.sublime-syntax + # - include: Packages/Naomi/syntaxes/fjsx15/flowtype/field.sublime-syntax + # - include: Packages/Naomi/syntaxes/fjsx15/flowtype/indexer.sublime-syntax # Class variables. - - include: Packages/Naomi/syntaxes/fjsx15/class/property.sublime-syntax + # - include: Packages/Naomi/syntaxes/fjsx15/class/property.sublime-syntax # Any other statement or expression. # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax - - match: "" - pop: true + # - match: "" + # pop: true - comment: + comment-no-pop: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax From a3939d287c47c61c9556e1ebe5b37bdc792f409e Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 10 Dec 2017 17:03:06 -0200 Subject: [PATCH 133/407] [FJXS15] Disable flow comments --- .../fjsx15/comment/flowtype.sublime-syntax | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/syntaxes/fjsx15/comment/flowtype.sublime-syntax b/syntaxes/fjsx15/comment/flowtype.sublime-syntax index 23efef9c..4a165981 100644 --- a/syntaxes/fjsx15/comment/flowtype.sublime-syntax +++ b/syntaxes/fjsx15/comment/flowtype.sublime-syntax @@ -72,20 +72,20 @@ contexts: push: - match: (?=\s*\*\/) pop: true - - match: \s*(\?)(?=\s*:) - captures: - 1: keyword.operator.other.optional.flowtype - set: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax + # - match: \s*(\?)(?=\s*:) + # captures: + # 1: keyword.operator.other.optional.flowtype + # set: + # - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/flowtype/declare.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/field.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/interface.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/indexer.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/module.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type-aliasing.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/import.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/export.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/operator/terminator.sublime-syntax + # - include: Packages/Naomi/syntaxes/fjsx15/flowtype/field.sublime-syntax + # - include: Packages/Naomi/syntaxes/fjsx15/flowtype/interface.sublime-syntax + # - include: Packages/Naomi/syntaxes/fjsx15/flowtype/indexer.sublime-syntax + # - include: Packages/Naomi/syntaxes/fjsx15/flowtype/module.sublime-syntax + # - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type-aliasing.sublime-syntax + # - include: Packages/Naomi/syntaxes/fjsx15/import.sublime-syntax + # - include: Packages/Naomi/syntaxes/fjsx15/export.sublime-syntax + # - include: Packages/Naomi/syntaxes/fjsx15/operator/terminator.sublime-syntax link: - include: Packages/Naomi/syntaxes/shared/link.sublime-syntax From 11761d3c85e3adec6caa60459e553a5e1984ac7f Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 10 Dec 2017 17:03:06 -0200 Subject: [PATCH 134/407] [FJSX15] Remove delete and of --- syntaxes/fjsx15/other-keywords.sublime-syntax | 28 ------------------- 1 file changed, 28 deletions(-) delete mode 100644 syntaxes/fjsx15/other-keywords.sublime-syntax diff --git a/syntaxes/fjsx15/other-keywords.sublime-syntax b/syntaxes/fjsx15/other-keywords.sublime-syntax deleted file mode 100644 index da8560b9..00000000 --- a/syntaxes/fjsx15/other-keywords.sublime-syntax +++ /dev/null @@ -1,28 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -contexts: - main: - - match: | - (?x)\s* - (?> delete - | of - )\b - scope: keyword.other.js.fjsx15 - pop: true From 11e5f3c1bfb2f359b3545d245b5b5a8f2df8f606 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 10 Dec 2017 17:03:06 -0200 Subject: [PATCH 135/407] [FJSX151] Disable hanging statements --- syntaxes/fjsx15/statement/hanging.sublime-syntax | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/syntaxes/fjsx15/statement/hanging.sublime-syntax b/syntaxes/fjsx15/statement/hanging.sublime-syntax index a39b3394..fb734671 100644 --- a/syntaxes/fjsx15/statement/hanging.sublime-syntax +++ b/syntaxes/fjsx15/statement/hanging.sublime-syntax @@ -33,8 +33,8 @@ contexts: captures: 1: keyword.operator.other.js.fjsx15 set: optional-body - - match: "" - push: + # - match: "" + # push: # - include: statement-and-expression optional-body: From 2793a0287b65f6696b8116211829defa72842e30 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 10 Dec 2017 17:03:06 -0200 Subject: [PATCH 136/407] [FJSX15] Upgrade class methods partially --- syntaxes/fjsx15/class/method.sublime-syntax | 36 ++++++++++----------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/syntaxes/fjsx15/class/method.sublime-syntax b/syntaxes/fjsx15/class/method.sublime-syntax index 0823c708..23e28cc8 100644 --- a/syntaxes/fjsx15/class/method.sublime-syntax +++ b/syntaxes/fjsx15/class/method.sublime-syntax @@ -95,9 +95,9 @@ variables: flowComment: /\*\s*:.*?\*/ - returnType: | + type: | (?> {{flowComment}} - | (?::{{complexType}}) + | :{{complexType}} )? contexts: @@ -117,21 +117,21 @@ contexts: modifiers ] # Method assigned to a class property. - - match: | - (?xi) - (?= - \s*{{commonIdentifier}} - \s*= - \s*{{modifiers}}? - \s*{{templateArguments}}? - \s*{{parameters}}? - \s*{{returnType}}? - \s*=> - ) - set: [ - arrow-function, - declaration - ] + # - match: | + # (?xi) + # (?= + # \s*{{commonIdentifier}} + # \s*= + # \s*{{modifiers}}? + # \s*{{templateArguments}}? + # \s*{{parameters}}? + # \s*{{type}}? + # \s*=> + # ) + # set: [ + # arrow-function, + # declaration + # ] modifiers: - match: \s*(\#|static) @@ -228,7 +228,7 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/function/parameters.sublime-syntax support-parameters: - - include: Packages/Naomi/syntaxes/fjsx15/function/support/parameters.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/function/support/core-parameters.sublime-syntax body: - include: Packages/Naomi/syntaxes/fjsx15/function/body.sublime-syntax From 0562cbfdce64b288b862a37a0a191c59d2100f47 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 11 Dec 2017 12:56:16 -0200 Subject: [PATCH 137/407] [FJSX15] Enable console functions --- syntaxes/fjsx15/core.sublime-syntax | 34 +++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/syntaxes/fjsx15/core.sublime-syntax b/syntaxes/fjsx15/core.sublime-syntax index 2cd7ce57..0f0d3605 100644 --- a/syntaxes/fjsx15/core.sublime-syntax +++ b/syntaxes/fjsx15/core.sublime-syntax @@ -19,12 +19,13 @@ scope: ... contexts: main: - - include: symbol-properties - include: array-functions - - include: object-functions + - include: console-functions - include: math-constants - include: math-functions + - include: object-functions - include: symbol-functions + - include: symbol-properties # https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects - include: constants - include: functions @@ -64,6 +65,35 @@ contexts: entity.name.function.js.fjsx15 set: optional-template-and-arguments + console-functions: + - match: | + (?x) + \s*(console)\b + (?: + \s*(\.)\s* + ((?> assert + | clear + | count + | error + | group(?>Collapsed|End)? + | info + | log + | table + | time(?>End|Stamp)? + | trace + | warn + ))\b + ) + captures: + 1: >- + support.core.js.fjsx15 + entity.name.class.js.fjsx15 + 2: keyword.operator.other.member-access.js.fjsx15 + 3: >- + support.core.js.fjsx15 + entity.name.function.js.fjsx15 + set: optional-template-and-arguments + math-constants: - match: | (?x) From b0c7d1aba45a13527e45c146e10f1c5b6c3b235a Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 11 Dec 2017 12:56:27 -0200 Subject: [PATCH 138/407] [FJSX15] Add delete operator --- syntaxes/fjsx15/operator.sublime-syntax | 1 + .../fjsx15/operator/delete.sublime-syntax | 28 +++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 syntaxes/fjsx15/operator/delete.sublime-syntax diff --git a/syntaxes/fjsx15/operator.sublime-syntax b/syntaxes/fjsx15/operator.sublime-syntax index 84a4837a..81a8dd2d 100644 --- a/syntaxes/fjsx15/operator.sublime-syntax +++ b/syntaxes/fjsx15/operator.sublime-syntax @@ -23,6 +23,7 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/operator/assignment.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/bitwise.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/comparison.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/operator/delete.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/logical.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/new.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/other.sublime-syntax diff --git a/syntaxes/fjsx15/operator/delete.sublime-syntax b/syntaxes/fjsx15/operator/delete.sublime-syntax new file mode 100644 index 00000000..836ef5c1 --- /dev/null +++ b/syntaxes/fjsx15/operator/delete.sublime-syntax @@ -0,0 +1,28 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +contexts: + main: + - match: \s*(delete) + captures: + 1: keyword.other.js.fjsx15 + set: optional-expression + + optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax From c6382f76983bc973ffcb62c3379786af2c6498ae Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 11 Dec 2017 12:56:52 -0200 Subject: [PATCH 139/407] [FJSX15] Simplify web globals --- syntaxes/fjsx15/web.sublime-syntax | 39 +++++------------------------- 1 file changed, 6 insertions(+), 33 deletions(-) diff --git a/syntaxes/fjsx15/web.sublime-syntax b/syntaxes/fjsx15/web.sublime-syntax index e07924ee..8b2cd811 100644 --- a/syntaxes/fjsx15/web.sublime-syntax +++ b/syntaxes/fjsx15/web.sublime-syntax @@ -19,41 +19,14 @@ scope: ... contexts: main: - - include: console-functions - include: document-functions - include: window-functions - function-arguments: + optional-template-and-arguments: + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/arguments.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function-call/support/core-arguments.sublime-syntax - - console-functions: - - match: | - (?x) - \s*(console)\b - (?: - \s*(\.)\s* - ((?> assert - | clear - | count - | error - | group(?>Collapsed|End)? - | info - | log - | table - | time(?>End|Stamp)? - | trace - | warn - ))\b - ) - captures: - 1: >- - support.core.js.fjsx15 - entity.name.class.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 - 3: >- - support.core.js.fjsx15 - entity.name.function.js.fjsx15 - set: function-arguments + - match: (?=\s*\S) + pop: true document-functions: - match: | @@ -111,7 +84,7 @@ contexts: 3: >- support.core.js.fjsx15 entity.name.function.js.fjsx15 - set: function-arguments + set: optional-template-and-arguments window-functions: - match: | @@ -171,4 +144,4 @@ contexts: 3: >- support.core.js.fjsx15 entity.name.function.js.fjsx15 - set: function-arguments + set: optional-template-and-arguments From f5d43f1f59ba1ba455c029d9e25ae92dab8f1753 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 11 Dec 2017 12:57:06 -0200 Subject: [PATCH 140/407] [FJSX15] Enable web globals --- syntaxes/fjsx15/expression.sublime-syntax | 1 + 1 file changed, 1 insertion(+) diff --git a/syntaxes/fjsx15/expression.sublime-syntax b/syntaxes/fjsx15/expression.sublime-syntax index 299a5954..441649ee 100644 --- a/syntaxes/fjsx15/expression.sublime-syntax +++ b/syntaxes/fjsx15/expression.sublime-syntax @@ -88,6 +88,7 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/node-js.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/react-js.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/jest.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/web.sublime-syntax head: - include: comment-no-pop From 8015a45752c78e8ac40cfde40530eea4394f74af Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 11 Dec 2017 12:57:23 -0200 Subject: [PATCH 141/407] [FJSX15] Add return statement --- syntaxes/fjsx15/statement.sublime-syntax | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/syntaxes/fjsx15/statement.sublime-syntax b/syntaxes/fjsx15/statement.sublime-syntax index aa6330b5..a8668cdb 100644 --- a/syntaxes/fjsx15/statement.sublime-syntax +++ b/syntaxes/fjsx15/statement.sublime-syntax @@ -23,3 +23,13 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/class.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/variable-declaration.sublime-syntax + - include: return + + optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax + + return: + - match: \s*(return) + captures: + 1: keyword.other.js.fjsx15 + set: optional-expression From 0d8755b0333565b6ddc46900218814846d1ac657 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 11 Dec 2017 14:18:45 -0200 Subject: [PATCH 142/407] [FJSX15] Fix function body statements --- syntaxes/fjsx15/function/body.sublime-syntax | 2 ++ 1 file changed, 2 insertions(+) diff --git a/syntaxes/fjsx15/function/body.sublime-syntax b/syntaxes/fjsx15/function/body.sublime-syntax index f4e720ce..ba6add12 100644 --- a/syntaxes/fjsx15/function/body.sublime-syntax +++ b/syntaxes/fjsx15/function/body.sublime-syntax @@ -32,6 +32,8 @@ contexts: captures: 1: punctuation.definition.function.body.end.js.fjsx15 pop: true + - match: "" + push: optional-statements-and-expressions optional-statements-and-expressions: - include: Packages/Naomi/syntaxes/fjsx15/optional-statements-and-expressions.sublime-syntax From 2dee93a8ecf41279ef2d33a0a0d8ffd1233aeb71 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 11 Dec 2017 14:50:37 -0200 Subject: [PATCH 143/407] [FJSX15] Add statements Add empty, block and label statements. --- syntaxes/fjsx15/operator.sublime-syntax | 1 - .../fjsx15/optional-expression.sublime-syntax | 3 +- syntaxes/fjsx15/statement.sublime-syntax | 41 +++++++++++++++++++ 3 files changed, 42 insertions(+), 3 deletions(-) diff --git a/syntaxes/fjsx15/operator.sublime-syntax b/syntaxes/fjsx15/operator.sublime-syntax index 81a8dd2d..28785fc5 100644 --- a/syntaxes/fjsx15/operator.sublime-syntax +++ b/syntaxes/fjsx15/operator.sublime-syntax @@ -31,5 +31,4 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/operator/relational.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/shebang.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/spread.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/operator/terminator.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/word.sublime-syntax diff --git a/syntaxes/fjsx15/optional-expression.sublime-syntax b/syntaxes/fjsx15/optional-expression.sublime-syntax index 946f0ccb..be1d3e3c 100644 --- a/syntaxes/fjsx15/optional-expression.sublime-syntax +++ b/syntaxes/fjsx15/optional-expression.sublime-syntax @@ -19,7 +19,6 @@ scope: ... contexts: main: - - include: Packages/Naomi/syntaxes/fjsx15/operator/terminator.sublime-syntax - - match: (?=\s*[,:)\]}]) + - match: (?=\s*[,;:)\]}]) pop: true - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax diff --git a/syntaxes/fjsx15/statement.sublime-syntax b/syntaxes/fjsx15/statement.sublime-syntax index a8668cdb..299b6225 100644 --- a/syntaxes/fjsx15/statement.sublime-syntax +++ b/syntaxes/fjsx15/statement.sublime-syntax @@ -17,17 +17,58 @@ hidden: true scope: ... +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + contexts: main: - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type-aliasing.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/class.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/variable-declaration.sublime-syntax + - include: empty + - include: label + - include: block - include: return + optional-statements-and-expressions: + - include: Packages/Naomi/syntaxes/fjsx15/optional-statements-and-expressions.sublime-syntax + optional-expression: - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax + block: + - match: \s*({) + captures: + 1: punctuation.definition.block.begin.js.fjsx15 + set: [ block-end, optional-statements-and-expressions ] + + block-end: + - match: \s*(}) + captures: + 1: punctuation.definition.block.end.js.fjsx15 + pop: true + - match: "" + push: optional-statements-and-expressions + + empty: + - match: \s*(;) + captures: + 1: keyword.operator.other.terminator.js.fjsx15 + pop: true + + label: + - match: | + (?xi) + \s*({{commonIdentifier}}) + \s*(:) + captures: + 1: entity.name.label.js.fjsx15 + 2: keyword.operator.other.js.fjsx15 + set: optional-statements-and-expressions + return: - match: \s*(return) captures: From 952e5188d4472aac9dca833778f28a517692e7fc Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 11 Dec 2017 14:50:48 -0200 Subject: [PATCH 144/407] [FJSX15] Add documents properties --- syntaxes/fjsx15/web.sublime-syntax | 113 +++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) diff --git a/syntaxes/fjsx15/web.sublime-syntax b/syntaxes/fjsx15/web.sublime-syntax index 8b2cd811..32dc67c3 100644 --- a/syntaxes/fjsx15/web.sublime-syntax +++ b/syntaxes/fjsx15/web.sublime-syntax @@ -20,6 +20,7 @@ scope: ... contexts: main: - include: document-functions + - include: document-properties - include: window-functions optional-template-and-arguments: @@ -86,6 +87,118 @@ contexts: entity.name.function.js.fjsx15 set: optional-template-and-arguments + document-properties: + - match: | + (?x) + \s*(document)\b + (?: + \s*(\.)\s* + ((?> activeElement + | body + | characterSet + | childElementCount + | children + | compatMode + | currentScript + | defaultView + | designMode + | dir + | doctype + | documentElement + | documentURI + | documentURIObject + | domain + | embeds + | firstElementChild + | forms + | fullscreenElement + | fullscreenEnabled + | head + | hidden + | images + | implementation + | last + (?> ElementChild + | Modified + | StyleSheetSet + ) + | links + | location + | on + (?> abort + | animationcancel + | animationend + | blur + | change + | click + | close + | contextmenu + | dblclick + | error + | focus + | fullscreenchange + | fullscreenerror + | gotpointercapture + | input + | keydown + | keypress + | keyup + | load + | loadend + | loadstart + | lostpointercapture + | mousedown + | mousemove + | mouseout + | mouseover + | mouseup + | offline + | online + | pointercancel + | pointerdown + | pointerenter + | pointerleave + | pointermove + | pointerout + | pointerover + | pointerup + | reset + | resize + | scroll + | select + | submit + | transitioncancel + | transitionend + | visibilitychange + | wheel + ) + | plugins + | pointerLockElement + | popupNode + | preferredStyleSheetSet + | readyState + | referrer + | scripts + | scrollingElement + | selectedStyleSheetSet + | styleSheets + | styleSheetSets + | title + | tooltipNode + | URL + | visibilityState + ))\b + ) + captures: + 1: >- + support.core.js.fjsx15 + entity.name.class.js.fjsx15 + 2: keyword.operator.other.member-access.js.fjsx15 + 3: >- + support.core.js.fjsx15 + entity.name.function.js.fjsx15 + pop: true + window-functions: - match: | (?x) From 5c098a5dfe2efeb12024e85528fe007bab328e4e Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 11 Dec 2017 14:51:05 -0200 Subject: [PATCH 145/407] Change block statements color --- Candyman.tmTheme | 2 +- schemes/candyman/shared/_punctuation.scss | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Candyman.tmTheme b/Candyman.tmTheme index a4006190..6a294c89 100644 --- a/Candyman.tmTheme +++ b/Candyman.tmTheme @@ -1006,7 +1006,7 @@ scope - .punctuation.definition.control + .punctuation.definition.block, .punctuation.definition.control settings foreground diff --git a/schemes/candyman/shared/_punctuation.scss b/schemes/candyman/shared/_punctuation.scss index 863ec0ea..8fed3c5c 100644 --- a/schemes/candyman/shared/_punctuation.scss +++ b/schemes/candyman/shared/_punctuation.scss @@ -18,6 +18,7 @@ foreground: $brown-200; } +.punctuation.definition.block, .punctuation.definition.control { foreground: $pink-a100; } From cc278086ea90d9388da60c479ec90544e5eed5dc Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 11 Dec 2017 15:03:46 -0200 Subject: [PATCH 146/407] [FJSX15] Add break statement --- syntaxes/fjsx15/statement.sublime-syntax | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/syntaxes/fjsx15/statement.sublime-syntax b/syntaxes/fjsx15/statement.sublime-syntax index 299b6225..43e7aef3 100644 --- a/syntaxes/fjsx15/statement.sublime-syntax +++ b/syntaxes/fjsx15/statement.sublime-syntax @@ -28,6 +28,7 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/class.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/variable-declaration.sublime-syntax + - include: break - include: empty - include: label - include: block @@ -53,6 +54,16 @@ contexts: - match: "" push: optional-statements-and-expressions + break: + - match: | + (?xi) + \s*(break) + (?:\s+({{commonIdentifier}}))? + captures: + 1: keyword.other.js.fjsx15 + 2: entity.name.label.js.fjsx15 + pop: true + empty: - match: \s*(;) captures: From a3b62f9ff8bfcb3a571f87b67c9832786a6f247a Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 11 Dec 2017 15:04:49 -0200 Subject: [PATCH 147/407] [FJXS15] Add continue statement --- syntaxes/fjsx15/statement.sublime-syntax | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/syntaxes/fjsx15/statement.sublime-syntax b/syntaxes/fjsx15/statement.sublime-syntax index 43e7aef3..e4af3267 100644 --- a/syntaxes/fjsx15/statement.sublime-syntax +++ b/syntaxes/fjsx15/statement.sublime-syntax @@ -28,7 +28,7 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/class.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/variable-declaration.sublime-syntax - - include: break + - include: break-continue - include: empty - include: label - include: block @@ -54,10 +54,10 @@ contexts: - match: "" push: optional-statements-and-expressions - break: + break-continue: - match: | (?xi) - \s*(break) + \s*(break|continue) (?:\s+({{commonIdentifier}}))? captures: 1: keyword.other.js.fjsx15 From e966928bc3bc8d896df9960b925510a91a28460c Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 11 Dec 2017 15:21:15 -0200 Subject: [PATCH 148/407] [FJSX15] Fix assignment prediction --- syntaxes/fjsx15/operator/assignment.sublime-syntax | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/operator/assignment.sublime-syntax b/syntaxes/fjsx15/operator/assignment.sublime-syntax index 0dc43879..01af92fe 100644 --- a/syntaxes/fjsx15/operator/assignment.sublime-syntax +++ b/syntaxes/fjsx15/operator/assignment.sublime-syntax @@ -19,7 +19,7 @@ scope: ... contexts: main: - - match: \s*(=)(?!\s*>) + - match: \s*(=)(?!\s*[=>]) captures: 1: keyword.operator.other.assignment.js.fjsx15 set: optional-expression From dcbdf829a1c1cd188af987e30014317b779fc57c Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 11 Dec 2017 17:42:05 -0200 Subject: [PATCH 149/407] [FJSX15] Add the in operator --- syntaxes/fjsx15/operator.sublime-syntax | 1 + syntaxes/fjsx15/operator/in.sublime-syntax | 28 ++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 syntaxes/fjsx15/operator/in.sublime-syntax diff --git a/syntaxes/fjsx15/operator.sublime-syntax b/syntaxes/fjsx15/operator.sublime-syntax index 28785fc5..03590a49 100644 --- a/syntaxes/fjsx15/operator.sublime-syntax +++ b/syntaxes/fjsx15/operator.sublime-syntax @@ -24,6 +24,7 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/operator/bitwise.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/comparison.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/delete.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/operator/in.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/logical.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/new.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/other.sublime-syntax diff --git a/syntaxes/fjsx15/operator/in.sublime-syntax b/syntaxes/fjsx15/operator/in.sublime-syntax new file mode 100644 index 00000000..add41981 --- /dev/null +++ b/syntaxes/fjsx15/operator/in.sublime-syntax @@ -0,0 +1,28 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +contexts: + main: + - match: \s*(in)\b + captures: + 1: keyword.other.js.fjsx15 + set: optional-expression + + optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax From d5ce6a1e02a733edd377a95f161561ca7c161bf3 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 11 Dec 2017 17:44:54 -0200 Subject: [PATCH 150/407] [FJSX15] Make minor temporary fixes --- syntaxes/fjsx15/class.sublime-syntax | 4 ++-- syntaxes/fjsx15/class/method.sublime-syntax | 4 ++-- syntaxes/fjsx15/class/property.sublime-syntax | 6 +++--- syntaxes/fjsx15/comment/flowtype.sublime-syntax | 10 +++++----- syntaxes/fjsx15/operator/pipe.sublime-syntax | 3 +-- 5 files changed, 13 insertions(+), 14 deletions(-) diff --git a/syntaxes/fjsx15/class.sublime-syntax b/syntaxes/fjsx15/class.sublime-syntax index 38dc1773..ea81e5ba 100644 --- a/syntaxes/fjsx15/class.sublime-syntax +++ b/syntaxes/fjsx15/class.sublime-syntax @@ -73,8 +73,8 @@ contexts: template-parameters: - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/parameters.sublime-syntax - type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type.sublime-syntax + type-expression: + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type-expression.sublime-syntax body: - include: Packages/Naomi/syntaxes/fjsx15/class/body.sublime-syntax diff --git a/syntaxes/fjsx15/class/method.sublime-syntax b/syntaxes/fjsx15/class/method.sublime-syntax index 23e28cc8..0c094cdc 100644 --- a/syntaxes/fjsx15/class/method.sublime-syntax +++ b/syntaxes/fjsx15/class/method.sublime-syntax @@ -159,8 +159,8 @@ contexts: - match: "" pop: true - arrow-function: - - include: Packages/Naomi/syntaxes/fjsx15/arrow-function.sublime-syntax + # arrow-function: + # - include: Packages/Naomi/syntaxes/fjsx15/arrow-function.sublime-syntax declaration: - match: \s*(=) diff --git a/syntaxes/fjsx15/class/property.sublime-syntax b/syntaxes/fjsx15/class/property.sublime-syntax index f4f27882..ffac71ff 100644 --- a/syntaxes/fjsx15/class/property.sublime-syntax +++ b/syntaxes/fjsx15/class/property.sublime-syntax @@ -104,7 +104,7 @@ contexts: set: declaration declaration: - - include: terminator + # - include: terminator - match: (?=\s*$) pop: true # Type. @@ -126,8 +126,8 @@ contexts: type: - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax - terminator: - - include: Packages/Naomi/syntaxes/fjsx15/operator/terminator.sublime-syntax + # terminator: + # - include: Packages/Naomi/syntaxes/fjsx15/operator/terminator.sublime-syntax # statement-and-expression: # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax diff --git a/syntaxes/fjsx15/comment/flowtype.sublime-syntax b/syntaxes/fjsx15/comment/flowtype.sublime-syntax index 4a165981..ad10304e 100644 --- a/syntaxes/fjsx15/comment/flowtype.sublime-syntax +++ b/syntaxes/fjsx15/comment/flowtype.sublime-syntax @@ -68,16 +68,16 @@ contexts: pop: true - match: '' pop: true - - match: "" - push: - - match: (?=\s*\*\/) - pop: true + # - match: "" + # push: + # - match: (?=\s*\*\/) + # pop: true # - match: \s*(\?)(?=\s*:) # captures: # 1: keyword.operator.other.optional.flowtype # set: # - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/declare.sublime-syntax + # - include: Packages/Naomi/syntaxes/fjsx15/flowtype/declare.sublime-syntax # - include: Packages/Naomi/syntaxes/fjsx15/flowtype/field.sublime-syntax # - include: Packages/Naomi/syntaxes/fjsx15/flowtype/interface.sublime-syntax # - include: Packages/Naomi/syntaxes/fjsx15/flowtype/indexer.sublime-syntax diff --git a/syntaxes/fjsx15/operator/pipe.sublime-syntax b/syntaxes/fjsx15/operator/pipe.sublime-syntax index 1724d9ea..5c9614be 100644 --- a/syntaxes/fjsx15/operator/pipe.sublime-syntax +++ b/syntaxes/fjsx15/operator/pipe.sublime-syntax @@ -30,7 +30,7 @@ contexts: set: function-or-expression function-or-expression: - - include: Packages/Naomi/syntaxes/fjsx15/arrow-function.sublime-syntax + # - include: Packages/Naomi/syntaxes/fjsx15/arrow-function.sublime-syntax # Await keyword. - match: | (?x)\s* @@ -47,4 +47,3 @@ contexts: pop: true # Other expressions. - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax - From 424ec51153cd8dc487fe00820c01610f44548e3f Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 11 Dec 2017 17:45:05 -0200 Subject: [PATCH 151/407] [FJSX15] Add statements --- syntaxes/fjsx15/statement.sublime-syntax | 83 +++++++++++++++++++++++- 1 file changed, 80 insertions(+), 3 deletions(-) diff --git a/syntaxes/fjsx15/statement.sublime-syntax b/syntaxes/fjsx15/statement.sublime-syntax index e4af3267..37fe6b44 100644 --- a/syntaxes/fjsx15/statement.sublime-syntax +++ b/syntaxes/fjsx15/statement.sublime-syntax @@ -28,11 +28,18 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/class.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/variable-declaration.sublime-syntax + - include: block - include: break-continue + - include: debugger + - include: do-while - include: empty + - include: for + - include: if-else - include: label - - include: block - include: return + - include: throw + - include: try-catch-finally + - include: yield optional-statements-and-expressions: - include: Packages/Naomi/syntaxes/fjsx15/optional-statements-and-expressions.sublime-syntax @@ -40,6 +47,18 @@ contexts: optional-expression: - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax + statement-condition: + - match: \s*(\() + captures: + 1: punctuation.definition.control.header.begin.js.fjsx15 + set: [ statement-condition-end, optional-expression ] + + statement-condition-end: + - match: \s*(\)) + captures: + 1: punctuation.definition.control.header.end.js.fjsx15 + pop: true + block: - match: \s*({) captures: @@ -57,19 +76,51 @@ contexts: break-continue: - match: | (?xi) - \s*(break|continue) + \s*(break|continue)\b (?:\s+({{commonIdentifier}}))? captures: 1: keyword.other.js.fjsx15 2: entity.name.label.js.fjsx15 pop: true + debugger: + - match: \s*(debugger)\b + captures: + 1: keyword.other.js.fjsx15 + pop: true + + do-while: + - match: \s*(do)\b + captures: + 1: keyword.other.js.fjsx15 + pop: true + - match: \s*(while)\b + captures: + 1: keyword.other.js.fjsx15 + set: statement-condition + empty: - match: \s*(;) captures: 1: keyword.operator.other.terminator.js.fjsx15 pop: true + for: + - match: \s*(for) + captures: + 1: keyword.other.js.fjsx15 + set: statement-condition + + if-else: + - match: \s*(if)\b + captures: + 1: keyword.other.js.fjsx15 + set: statement-condition + - match: \s*(else)\b + captures: + 1: keyword.other.js.fjsx15 + pop: true + label: - match: | (?xi) @@ -81,7 +132,33 @@ contexts: set: optional-statements-and-expressions return: - - match: \s*(return) + - match: \s*(return)\b + captures: + 1: keyword.other.js.fjsx15 + set: optional-expression + + throw: + - match: \s*(throw)\b + captures: + 1: keyword.other.js.fjsx15 + set: optional-expression + + try-catch-finally: + - match: \s*(try)\b + captures: + 1: keyword.other.js.fjsx15 + pop: true + - match: \s*(catch)\b + captures: + 1: keyword.other.js.fjsx15 + set: statement-condition + - match: \s*(finally)\b + captures: + 1: keyword.other.js.fjsx15 + pop: true + + yield: + - match: \s*(yield)\b captures: 1: keyword.other.js.fjsx15 set: optional-expression From 0be44852155264a831b8411a66e5899f38a89c2c Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 11 Dec 2017 17:45:13 -0200 Subject: [PATCH 152/407] [FJSX15] Remove dead code --- .../string/guarded-regex.sublime-syntax | 101 ------------------ 1 file changed, 101 deletions(-) delete mode 100644 syntaxes/fjsx15/literal/string/guarded-regex.sublime-syntax diff --git a/syntaxes/fjsx15/literal/string/guarded-regex.sublime-syntax b/syntaxes/fjsx15/literal/string/guarded-regex.sublime-syntax deleted file mode 100644 index 5d0ab226..00000000 --- a/syntaxes/fjsx15/literal/string/guarded-regex.sublime-syntax +++ /dev/null @@ -1,101 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -contexts: - main: - # Regex literals are a bit hard to predict and there are some cases where - # this pattern will fail, for example: - # - # if (something) /regex/.exec(x); - # - # It’s impossible to know that the closing parenthesis is closing the - # statement’s header, that would only be possible with a parser. - # - # http://stackoverflow.com/questions/5519596/when-parsing-javascript-what-determines-the-meaning-of-a-slash - - match: | - (?x) - (?<= ^ - | \. - | , - | ; - | \( - | \{ - | } - | \[ - | < - | > - | = - | \+ - | - - | \& - | \| - | \^ - | ! - | ~ - | \? - | : - | / - | case - | export - | import - | in - | instanceof - | new - | return - | throw - | typeof - | yield - ) - \s*/ - (?= - .*? - (?- - string.unquoted.regex.js.fjsx15 - punctuation.definition.string.begin.js.fjsx15 - set: escape-a - - regex-end: - - match: | - (?x) - (/) - ([a-z]{0,5}) - captures: - 0: string.unquoted.regex.js.fjsx15 - 1: punctuation.definition.string.end.js.fjsx15 - 2: regex.flag.js.fjsx15 - pop: true - - escape-a: - - meta_content_scope: string.unquoted.regex.js.fjsx15 - - match: \\. - scope: constant.character.escape.a.js.fjsx15 - set: escape-b - # If the slash was not consumed before, it probably is the end of the regex. - - include: regex-end - - escape-b: - - meta_content_scope: string.unquoted.regex.js.fjsx15 - - match: \\. - scope: constant.character.escape.b.js.fjsx15 - set: escape-a - # If the slash was not consumed before, it probably is the end of the regex. - - include: regex-end From 8636aac42d5db1aa6eb43b77f0966ed5abf4d083 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 11 Dec 2017 17:45:30 -0200 Subject: [PATCH 153/407] [FJSX15] Fix embedded expressions --- .../literal/string/template.sublime-syntax | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/syntaxes/fjsx15/literal/string/template.sublime-syntax b/syntaxes/fjsx15/literal/string/template.sublime-syntax index d6abcc71..c6f2f849 100644 --- a/syntaxes/fjsx15/literal/string/template.sublime-syntax +++ b/syntaxes/fjsx15/literal/string/template.sublime-syntax @@ -68,19 +68,17 @@ contexts: embedded-expression: - match: \$\{ scope: keyword.operator.other.embedded-expression.begin.js.fjsx15 - push: embedded-content + push: [ close-embedded-expression, embedded-content ] - embedded-content: - - clear_scopes: true - - meta_scope: source.js.fjsx15 + close-embedded-expression: - match: \} scope: keyword.operator.other.embedded-expression.end.js.fjsx15 pop: true - - match: "" - push: - - match: (?=}) - pop: true - # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + + embedded-content: + - clear_scopes: true + - meta_scope: source.js.fjsx15 + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax template-end: - match: \` From 16cfcaf7686551a585167d954a7e98e501c6c803 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 11 Dec 2017 21:00:54 -0200 Subject: [PATCH 154/407] [FJSX15] Use generic scope for terminator --- syntaxes/fjsx15/statement.sublime-syntax | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/statement.sublime-syntax b/syntaxes/fjsx15/statement.sublime-syntax index 37fe6b44..31c293c8 100644 --- a/syntaxes/fjsx15/statement.sublime-syntax +++ b/syntaxes/fjsx15/statement.sublime-syntax @@ -102,7 +102,7 @@ contexts: empty: - match: \s*(;) captures: - 1: keyword.operator.other.terminator.js.fjsx15 + 1: keyword.other.terminator.js.fjsx15 pop: true for: From 3a8657c34767bd29fe521f6458788c0ffb668f22 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Tue, 12 Dec 2017 07:36:20 -0200 Subject: [PATCH 155/407] [FJSX15] Expand optional statement escape delimiter --- .../fjsx15/optional-statements-and-expressions.sublime-syntax | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/optional-statements-and-expressions.sublime-syntax b/syntaxes/fjsx15/optional-statements-and-expressions.sublime-syntax index 1bbadbd4..a5f2b2d9 100644 --- a/syntaxes/fjsx15/optional-statements-and-expressions.sublime-syntax +++ b/syntaxes/fjsx15/optional-statements-and-expressions.sublime-syntax @@ -19,6 +19,6 @@ scope: ... contexts: main: - - match: (?=\s*}) + - match: (?=\s*[)\]}]) pop: true - include: Packages/Naomi/syntaxes/naomi.fjsx15.sublime-syntax From a09b7324dca4c1c3d50a5fe33492859d35f270d5 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Tue, 12 Dec 2017 07:36:53 -0200 Subject: [PATCH 156/407] [FJSX15] Expand "for" loop header --- syntaxes/fjsx15/statement.sublime-syntax | 35 ++++++++++++++++-------- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/syntaxes/fjsx15/statement.sublime-syntax b/syntaxes/fjsx15/statement.sublime-syntax index 31c293c8..7d24fdd4 100644 --- a/syntaxes/fjsx15/statement.sublime-syntax +++ b/syntaxes/fjsx15/statement.sublime-syntax @@ -41,23 +41,34 @@ contexts: - include: try-catch-finally - include: yield + condition-end: + - match: \s*(\)) + captures: + 1: punctuation.definition.control.header.end.js.fjsx15 + pop: true + optional-statements-and-expressions: - include: Packages/Naomi/syntaxes/fjsx15/optional-statements-and-expressions.sublime-syntax + for-header: + - match: \s*(\() + captures: + 1: punctuation.definition.control.header.begin.js.fjsx15 + set: for-header-end + + for-header-end: + - include: condition-end + - match: "" + push: optional-statements-and-expressions + optional-expression: - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax - statement-condition: + expression-only-header: - match: \s*(\() captures: 1: punctuation.definition.control.header.begin.js.fjsx15 - set: [ statement-condition-end, optional-expression ] - - statement-condition-end: - - match: \s*(\)) - captures: - 1: punctuation.definition.control.header.end.js.fjsx15 - pop: true + set: [ condition-end, optional-expression ] block: - match: \s*({) @@ -97,7 +108,7 @@ contexts: - match: \s*(while)\b captures: 1: keyword.other.js.fjsx15 - set: statement-condition + set: expression-only-header empty: - match: \s*(;) @@ -109,13 +120,13 @@ contexts: - match: \s*(for) captures: 1: keyword.other.js.fjsx15 - set: statement-condition + set: statements-and-expressions-header if-else: - match: \s*(if)\b captures: 1: keyword.other.js.fjsx15 - set: statement-condition + set: expression-only-header - match: \s*(else)\b captures: 1: keyword.other.js.fjsx15 @@ -151,7 +162,7 @@ contexts: - match: \s*(catch)\b captures: 1: keyword.other.js.fjsx15 - set: statement-condition + set: expression-only-header - match: \s*(finally)\b captures: 1: keyword.other.js.fjsx15 From 21c6d8ee2558c9a31660d7e94fec927fa57d5508 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Tue, 12 Dec 2017 09:12:55 -0200 Subject: [PATCH 157/407] [FJSX15] Detect lone arrow function body --- syntaxes/fjsx15/operator.sublime-syntax | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/syntaxes/fjsx15/operator.sublime-syntax b/syntaxes/fjsx15/operator.sublime-syntax index 03590a49..334615ec 100644 --- a/syntaxes/fjsx15/operator.sublime-syntax +++ b/syntaxes/fjsx15/operator.sublime-syntax @@ -19,6 +19,10 @@ scope: ... contexts: main: + # It is impossible to detect multiline arrow functions, but we can still + # detect its body as if it were an operator. + - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/body.sublime-syntax + # Actual operators. - include: Packages/Naomi/syntaxes/fjsx15/operator/arithmetic.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/assignment.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/bitwise.sublime-syntax From 503ca4524f5cd0a15efb8de38b99ec8c571cabe3 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Tue, 12 Dec 2017 10:12:09 -0200 Subject: [PATCH 158/407] [FJSX15] Fix global scopes --- syntaxes/fjsx15/core.sublime-syntax | 2 +- syntaxes/fjsx15/web.sublime-syntax | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/syntaxes/fjsx15/core.sublime-syntax b/syntaxes/fjsx15/core.sublime-syntax index 0f0d3605..ce33ebad 100644 --- a/syntaxes/fjsx15/core.sublime-syntax +++ b/syntaxes/fjsx15/core.sublime-syntax @@ -87,7 +87,7 @@ contexts: captures: 1: >- support.core.js.fjsx15 - entity.name.class.js.fjsx15 + entity.name.variable.js.fjsx15 2: keyword.operator.other.member-access.js.fjsx15 3: >- support.core.js.fjsx15 diff --git a/syntaxes/fjsx15/web.sublime-syntax b/syntaxes/fjsx15/web.sublime-syntax index 32dc67c3..33f04dbe 100644 --- a/syntaxes/fjsx15/web.sublime-syntax +++ b/syntaxes/fjsx15/web.sublime-syntax @@ -80,7 +80,7 @@ contexts: captures: 1: >- support.core.js.fjsx15 - entity.name.class.js.fjsx15 + entity.name.variable.js.fjsx15 2: keyword.operator.other.member-access.js.fjsx15 3: >- support.core.js.fjsx15 From 6d07c6465c735956a19273a0f9409553b66bbcf8 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Tue, 12 Dec 2017 10:12:18 -0200 Subject: [PATCH 159/407] [FJSX15] Fix for header --- syntaxes/fjsx15/statement.sublime-syntax | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/statement.sublime-syntax b/syntaxes/fjsx15/statement.sublime-syntax index 7d24fdd4..9b19bea2 100644 --- a/syntaxes/fjsx15/statement.sublime-syntax +++ b/syntaxes/fjsx15/statement.sublime-syntax @@ -120,7 +120,7 @@ contexts: - match: \s*(for) captures: 1: keyword.other.js.fjsx15 - set: statements-and-expressions-header + set: for-header if-else: - match: \s*(if)\b From 67b12e7545f7911ab0e1e3b1d822a01533e98bb3 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Tue, 12 Dec 2017 10:16:42 -0200 Subject: [PATCH 160/407] [FJSX15] Add the "of" operator --- syntaxes/fjsx15/operator.sublime-syntax | 1 + syntaxes/fjsx15/operator/of.sublime-syntax | 29 ++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 syntaxes/fjsx15/operator/of.sublime-syntax diff --git a/syntaxes/fjsx15/operator.sublime-syntax b/syntaxes/fjsx15/operator.sublime-syntax index 334615ec..c6b987d0 100644 --- a/syntaxes/fjsx15/operator.sublime-syntax +++ b/syntaxes/fjsx15/operator.sublime-syntax @@ -31,6 +31,7 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/operator/in.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/logical.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/new.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/operator/of.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/other.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/pipe.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/relational.sublime-syntax diff --git a/syntaxes/fjsx15/operator/of.sublime-syntax b/syntaxes/fjsx15/operator/of.sublime-syntax new file mode 100644 index 00000000..b9cc29b5 --- /dev/null +++ b/syntaxes/fjsx15/operator/of.sublime-syntax @@ -0,0 +1,29 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +contexts: + main: + # Technically there’s no “of” operator, but this will simplify for loops. + - match: \s*(of)\b + captures: + 1: keyword.other.js.fjsx15 + set: optional-expression + + optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax From 2936bcc3a191e013b0d9ae8bff0584a076a44368 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Tue, 12 Dec 2017 13:18:47 -0200 Subject: [PATCH 161/407] [FJSX15] Function declaration meta scope --- syntaxes/fjsx15/function.sublime-syntax | 1 + .../variable-declaration.sublime-syntax | 30 +++++++++++++++---- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/syntaxes/fjsx15/function.sublime-syntax b/syntaxes/fjsx15/function.sublime-syntax index 8caea4b4..12875d65 100644 --- a/syntaxes/fjsx15/function.sublime-syntax +++ b/syntaxes/fjsx15/function.sublime-syntax @@ -45,6 +45,7 @@ contexts: pop: true declaration: + - meta_scope: meta.function.declaration.js.fjsx15 - include: comment-no-pop # Body. - match: (?=\s*\{) diff --git a/syntaxes/fjsx15/variable-declaration.sublime-syntax b/syntaxes/fjsx15/variable-declaration.sublime-syntax index c1238ac2..0a251dba 100644 --- a/syntaxes/fjsx15/variable-declaration.sublime-syntax +++ b/syntaxes/fjsx15/variable-declaration.sublime-syntax @@ -88,7 +88,7 @@ contexts: \s*(?>const|let|var)\b \s*{{commonIdentifier}} \s*= - \s*(?:async)? + \s*(?:async\b)? \s*{{templateArguments}}? \s*{{parameters}} \s*{{type}}? @@ -96,7 +96,7 @@ contexts: ) set: [ normal-arrow-function, - arrow-identifier, + function-identifier, keyword ] # Single parameter arrow function assigned to variable. @@ -106,16 +106,32 @@ contexts: \s*(?>const|let|var)\b \s*{{commonIdentifier}} \s*= - \s*(async)? + \s*(?:async\b)? \s*{{commonIdentifier}} \s*{{type}}? \s*=> ) set: [ single-parameter-arrow-function, - arrow-identifier, + function-identifier, keyword ] + # Function assigned to variable. + - match: | + (?x) + (?= + \s*(?>const|let|var)\b + \s*{{commonIdentifier}} + \s*= + \s*(?:async\b)? + \s*function + ) + set: [ + function, + function-identifier, + keyword + ] + # Normal variable declaration. - match: | (?x) @@ -140,12 +156,16 @@ contexts: keyword.declaration.variable.js.fjsx15 pop: true - arrow-identifier: + function: + - include: Packages/Naomi/syntaxes/fjsx15/function.sublime-syntax + + function-identifier: - match: | (?xi) \s*({{commonIdentifier}}) \s*(=) captures: + 0: meta.function.declaration.js.fjsx15 1: entity.name.function.js.fjsx15 2: punctuation.definition.function.assignment.js.fjsx1 pop: true From 24052152863b4ca349ffe0d1aa9a06a561e989a7 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Tue, 12 Dec 2017 13:23:50 -0200 Subject: [PATCH 162/407] [FJSX15] Make arrow function consistent --- syntaxes/fjsx15/arrow-function.sublime-syntax | 115 ++++++++++++++++++ syntaxes/fjsx15/expression.sublime-syntax | 2 +- 2 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 syntaxes/fjsx15/arrow-function.sublime-syntax diff --git a/syntaxes/fjsx15/arrow-function.sublime-syntax b/syntaxes/fjsx15/arrow-function.sublime-syntax new file mode 100644 index 00000000..3d03d6dd --- /dev/null +++ b/syntaxes/fjsx15/arrow-function.sublime-syntax @@ -0,0 +1,115 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + + templateArguments: | + (< + [^<>]* + \g<-1>? + [^<>]* + >) + + parameters: | + (\( + [^()]* + \g<-1>? + [^()]* + \)) + + flowOperators: | + (?> &(?!&) + | \|(?!\|) + ) + + string: | + (?> '.*?' + | ".*?" + | `.*` + ) + + simpleFlowType: | + (?> {{string}} + | {{commonIdentifier}} + {{templateArguments}}? + ) + + flowFunction: | + ( + {{parameters}} + \s*=>\s* + (?> {{simpleFlowType}} + | \g<-2> + ) + ) + + complexType: | + ( + \??\s* + (?> {{simpleFlowType}} + | {{flowFunction}} + ) + \s*{{flowOperators}}? + \s*\g<-5>? + ) + + flowComment: /\*\s*:.*?\*/ + + type: | + (?> {{flowComment}} + | :{{complexType}} + ) + +contexts: + main: + # Normal arrow function. + - match: | + (?xi) + (?= + \s*(async)? + \s*{{templateArguments}}? + \s*{{parameters}} + \s*{{type}}? + \s*=> + ) + set: normal-arrow-function + # Single parameter. + - match: | + (?xi) + (?= + \s*(async)? + \s*{{commonIdentifier}} + \s*{{type}}? + \s*=> + ) + set: single-parameter-arrow-function + + normal-arrow-function: + - include: Packages/Naomi/syntaxes/fjsx15/async.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/parameters.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/parameters.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/body.sublime-syntax + + single-parameter-arrow-function: + - include: Packages/Naomi/syntaxes/fjsx15/async.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/simple.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/body.sublime-syntax diff --git a/syntaxes/fjsx15/expression.sublime-syntax b/syntaxes/fjsx15/expression.sublime-syntax index 441649ee..14555095 100644 --- a/syntaxes/fjsx15/expression.sublime-syntax +++ b/syntaxes/fjsx15/expression.sublime-syntax @@ -29,7 +29,7 @@ contexts: - match: (?=\s*/.*?(? Date: Tue, 12 Dec 2017 13:27:29 -0200 Subject: [PATCH 163/407] [FJSX15] Restore JSX --- syntaxes/fjsx15/expression.sublime-syntax | 3 +++ syntaxes/fjsx15/jsx1.sublime-syntax | 17 +++++++---------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/syntaxes/fjsx15/expression.sublime-syntax b/syntaxes/fjsx15/expression.sublime-syntax index 14555095..69ba47bd 100644 --- a/syntaxes/fjsx15/expression.sublime-syntax +++ b/syntaxes/fjsx15/expression.sublime-syntax @@ -30,6 +30,8 @@ contexts: set: [ optional-tail, regex-literal ] # Arrow functions need to be detect before expression groups. - include: Packages/Naomi/syntaxes/fjsx15/arrow-function.sublime-syntax + # JSX tags. + - include: Packages/Naomi/syntaxes/fjsx15/jsx1.sublime-syntax # Detect operators as soon as possible. - include: Packages/Naomi/syntaxes/fjsx15/operator.sublime-syntax # Open new expression group. @@ -93,6 +95,7 @@ contexts: head: - include: comment-no-pop - include: globals + - include: Packages/Naomi/syntaxes/fjsx15/jsx1.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/literal.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/class.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function.sublime-syntax diff --git a/syntaxes/fjsx15/jsx1.sublime-syntax b/syntaxes/fjsx15/jsx1.sublime-syntax index 1074959c..ccf25413 100644 --- a/syntaxes/fjsx15/jsx1.sublime-syntax +++ b/syntaxes/fjsx15/jsx1.sublime-syntax @@ -26,13 +26,10 @@ contexts: main: - match: | (?xi) - (?=\s* - <{{commonIdentifier}} - (?>\s|>|/>) - ) + (?=\s*<{{commonIdentifier}}) with_prototype: # Single line comment. - - match: (\{\s*/\*)(.*)(\*/\s*}) + - match: \s*(\{\s*/\*)(.*)(\*/\s*}) captures: 1: >- source.jsx @@ -46,7 +43,7 @@ contexts: comment.block.js.fjsx15 punctuation.definition.comment.end.js.fjsx15 # Embedded javascript. - - match: (\{) + - match: \s*(\{) captures: 1: >- source.jsx.jsx1 @@ -71,7 +68,7 @@ contexts: 3: source.jsx.jsx1 pop: true - match: "" - push: - # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax - - match: "" - pop: true + push: optional-statements-and-expressions + + optional-statements-and-expressions: + - include: Packages/Naomi/syntaxes/fjsx15/optional-statements-and-expressions.sublime-syntax From c0de8cb84624766b85ee5ec94876c236c29a7d86 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Tue, 12 Dec 2017 13:38:42 -0200 Subject: [PATCH 164/407] [FJSX15] Add JSX fragments --- syntaxes/fjsx15/jsx1.sublime-syntax | 3 +- syntaxes/jsx1/fragment.sublime-syntax | 55 +++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 syntaxes/jsx1/fragment.sublime-syntax diff --git a/syntaxes/fjsx15/jsx1.sublime-syntax b/syntaxes/fjsx15/jsx1.sublime-syntax index ccf25413..77fca43b 100644 --- a/syntaxes/fjsx15/jsx1.sublime-syntax +++ b/syntaxes/fjsx15/jsx1.sublime-syntax @@ -26,7 +26,7 @@ contexts: main: - match: | (?xi) - (?=\s*<{{commonIdentifier}}) + (?=\s*<(?>>|{{commonIdentifier}})) with_prototype: # Single line comment. - match: \s*(\{\s*/\*)(.*)(\*/\s*}) @@ -53,6 +53,7 @@ contexts: jsx: - clear_scopes: true + - include: Packages/Naomi/syntaxes/jsx1/fragment.sublime-syntax - include: Packages/Naomi/syntaxes/jsx1/component.sublime-syntax - include: Packages/Naomi/syntaxes/jsx1/element.sublime-syntax diff --git a/syntaxes/jsx1/fragment.sublime-syntax b/syntaxes/jsx1/fragment.sublime-syntax new file mode 100644 index 00000000..3e05f5c8 --- /dev/null +++ b/syntaxes/jsx1/fragment.sublime-syntax @@ -0,0 +1,55 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_.:[:alnum:]]* + +contexts: + main: + - match: \s*(<)(>) + captures: + 1: punctuation.definition.tag.begin.jsx.jsx1 + 2: punctuation.definition.tag.end.jsx.jsx1 + set: content + + content: + - clear_scopes: true + - meta_scope: source.jsx.jsx1 + # Closing tag. + - match: \s*() + captures: + 1: punctuation.definition.tag.begin.jsx.jsx1 + 2: entity.name.tag.jsx.jsx1 + 3: punctuation.definition.tag.end.jsx.jsx1 + pop: true + # Sub tags. + - match: "" + push: + - clear_scopes: true + - include: Packages/Naomi/syntaxes/jsx1/main.sublime-syntax + - include: Packages/Naomi/syntaxes/jsx1/component.sublime-syntax + - include: Packages/Naomi/syntaxes/jsx1/element.sublime-syntax + - match: | + (?x) + (?=\s*<) + pop: true + - match: .|\n + scope: source.jsx From cde481ee199dbca368683c805660d8dcef6d4c62 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Tue, 12 Dec 2017 17:59:50 -0200 Subject: [PATCH 165/407] [FJXS15] Add await operator --- syntaxes/fjsx15/operator.sublime-syntax | 1 + syntaxes/fjsx15/operator/await.sublime-syntax | 34 +++++++++++++++++++ syntaxes/fjsx15/statement.sublime-syntax | 10 +++++- 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 syntaxes/fjsx15/operator/await.sublime-syntax diff --git a/syntaxes/fjsx15/operator.sublime-syntax b/syntaxes/fjsx15/operator.sublime-syntax index c6b987d0..06d4e93a 100644 --- a/syntaxes/fjsx15/operator.sublime-syntax +++ b/syntaxes/fjsx15/operator.sublime-syntax @@ -25,6 +25,7 @@ contexts: # Actual operators. - include: Packages/Naomi/syntaxes/fjsx15/operator/arithmetic.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/assignment.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/operator/await.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/bitwise.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/comparison.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/delete.sublime-syntax diff --git a/syntaxes/fjsx15/operator/await.sublime-syntax b/syntaxes/fjsx15/operator/await.sublime-syntax new file mode 100644 index 00000000..77993744 --- /dev/null +++ b/syntaxes/fjsx15/operator/await.sublime-syntax @@ -0,0 +1,34 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +contexts: + main: + - match: \s*(await)\b + captures: + 1: keyword.other.js.fjsx15 + set: optional-expression + + optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax + + just-pop: + - match: \s*(await)\b + captures: + 1: keyword.other.js.fjsx15 + pop: true diff --git a/syntaxes/fjsx15/statement.sublime-syntax b/syntaxes/fjsx15/statement.sublime-syntax index 9b19bea2..bb5d9aca 100644 --- a/syntaxes/fjsx15/statement.sublime-syntax +++ b/syntaxes/fjsx15/statement.sublime-syntax @@ -47,6 +47,11 @@ contexts: 1: punctuation.definition.control.header.end.js.fjsx15 pop: true + optional-await: + - include: Packages/Naomi/syntaxes/fjsx15/operator/await.sublime-syntax#just-pop + - match: (?=\s*\S) + pop: true + optional-statements-and-expressions: - include: Packages/Naomi/syntaxes/fjsx15/optional-statements-and-expressions.sublime-syntax @@ -120,7 +125,10 @@ contexts: - match: \s*(for) captures: 1: keyword.other.js.fjsx15 - set: for-header + set: [ + for-header, + optional-await + ] if-else: - match: \s*(if)\b From f61219249e6dc07138a583b54250a45475d780df Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Wed, 13 Dec 2017 08:45:00 -0200 Subject: [PATCH 166/407] [FJSX15] Add rest operator --- .../fjsx15/destructuring/array.sublime-syntax | 1 + .../destructuring/object.sublime-syntax | 1 + .../destructuring/array.sublime-syntax | 1 + .../destructuring/object.sublime-syntax | 1 + .../function/parameter/simple.sublime-syntax | 3 --- .../fjsx15/function/parameters.sublime-syntax | 1 + .../operator/rest.no-pop.sublime-syntax | 26 +++++++++++++++++++ syntaxes/fjsx15/operator/rest.sublime-syntax | 25 ++++++++++++++++++ 8 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 syntaxes/fjsx15/operator/rest.no-pop.sublime-syntax create mode 100644 syntaxes/fjsx15/operator/rest.sublime-syntax diff --git a/syntaxes/fjsx15/destructuring/array.sublime-syntax b/syntaxes/fjsx15/destructuring/array.sublime-syntax index 91666cf2..e3ad2e38 100644 --- a/syntaxes/fjsx15/destructuring/array.sublime-syntax +++ b/syntaxes/fjsx15/destructuring/array.sublime-syntax @@ -58,6 +58,7 @@ contexts: optional-variable: - match: (?=\s*[,)\]}]) pop: true + - include: Packages/Naomi/syntaxes/fjsx15/operator/rest.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/destructuring/array.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/destructuring/object.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/constant.sublime-syntax diff --git a/syntaxes/fjsx15/destructuring/object.sublime-syntax b/syntaxes/fjsx15/destructuring/object.sublime-syntax index 3431df7e..05e8e129 100644 --- a/syntaxes/fjsx15/destructuring/object.sublime-syntax +++ b/syntaxes/fjsx15/destructuring/object.sublime-syntax @@ -49,6 +49,7 @@ contexts: - include: comment-no-pop - match: (?=\s*[,)\]}]) pop: true + - include: Packages/Naomi/syntaxes/fjsx15/operator/rest.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/destructuring/object/property.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/destructuring/array.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/destructuring/object.sublime-syntax diff --git a/syntaxes/fjsx15/function/parameter/destructuring/array.sublime-syntax b/syntaxes/fjsx15/function/parameter/destructuring/array.sublime-syntax index 7984ee9d..c037c81d 100644 --- a/syntaxes/fjsx15/function/parameter/destructuring/array.sublime-syntax +++ b/syntaxes/fjsx15/function/parameter/destructuring/array.sublime-syntax @@ -44,6 +44,7 @@ contexts: - include: comment-no-pop - match: (?=\s*[,)\]}]) pop: true + - include: Packages/Naomi/syntaxes/fjsx15/operator/rest.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/destructuring/array.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/simple.sublime-syntax diff --git a/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax b/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax index 66a41e2c..374536c4 100644 --- a/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax +++ b/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax @@ -49,6 +49,7 @@ contexts: - include: comment-no-pop - match: (?=\s*[,)\]}]) pop: true + - include: Packages/Naomi/syntaxes/fjsx15/operator/rest.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/destructuring/object/property.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/destructuring/array.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax diff --git a/syntaxes/fjsx15/function/parameter/simple.sublime-syntax b/syntaxes/fjsx15/function/parameter/simple.sublime-syntax index 7b82b256..9f28d299 100644 --- a/syntaxes/fjsx15/function/parameter/simple.sublime-syntax +++ b/syntaxes/fjsx15/function/parameter/simple.sublime-syntax @@ -26,11 +26,8 @@ contexts: main: - match: | (?xi)\s* - (\.{3})? ({{commonIdentifier}})(\?)? captures: - 1: keyword.operator.other.rest.js.fjsx15 - 2: >- function.parameter.js.fjsx15 entity.name.variable.js.fjsx15 3: >- diff --git a/syntaxes/fjsx15/function/parameters.sublime-syntax b/syntaxes/fjsx15/function/parameters.sublime-syntax index 75b0e9fa..463c1d1e 100644 --- a/syntaxes/fjsx15/function/parameters.sublime-syntax +++ b/syntaxes/fjsx15/function/parameters.sublime-syntax @@ -39,6 +39,7 @@ contexts: - include: comment-no-pop - match: (?=\s*[,)]) pop: true + - include: Packages/Naomi/syntaxes/fjsx15/operator/rest.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/destructuring/array.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/simple.sublime-syntax diff --git a/syntaxes/fjsx15/operator/rest.no-pop.sublime-syntax b/syntaxes/fjsx15/operator/rest.no-pop.sublime-syntax new file mode 100644 index 00000000..495c74ee --- /dev/null +++ b/syntaxes/fjsx15/operator/rest.no-pop.sublime-syntax @@ -0,0 +1,26 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +contexts: + main: + - match: (?=\s*\.{3}) + push: rest-operator + + rest-operator: + - include: Packages/Naomi/syntaxes/fjsx15/operator/rest.sublime-syntax diff --git a/syntaxes/fjsx15/operator/rest.sublime-syntax b/syntaxes/fjsx15/operator/rest.sublime-syntax new file mode 100644 index 00000000..e6bfce85 --- /dev/null +++ b/syntaxes/fjsx15/operator/rest.sublime-syntax @@ -0,0 +1,25 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +contexts: + main: + - match: \s*(\.{3}) + captures: + 1: keyword.operator.other.rest.js.fjsx15 + pop: true From b2a500e45c2c4054433cffbbca71392b3b9099ae Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Wed, 13 Dec 2017 08:46:41 -0200 Subject: [PATCH 167/407] [FJSX15] Normalize terminator scope --- Candyman.tmTheme | 2 +- schemes/candyman/scss/_operator.scss | 2 +- .../fjsx15/operator/terminator.sublime-syntax | 2 +- syntaxes/mql4/statement/bodied.sublime-syntax | 2 +- syntaxes/mql4/terminator.sublime-syntax | 2 +- syntaxes/php7/statement/bodied.sublime-syntax | 2 +- syntaxes/php7/terminator.sublime-syntax | 2 +- syntaxes/scss3/terminator.sublime-syntax | 2 +- .../fjsx15/destructuring/syntax_test_array.js | 8 +++---- .../destructuring/syntax_test_object.js | 10 ++++---- .../flowtype/syntax_test_type-aliasing.js | 24 +++++++++---------- .../fjsx15/literal/syntax_test_object.js | 4 ++-- tests/syntaxes/fjsx15/syntax_test_class.js | 6 ++--- .../fjsx15/syntax_test_function-call.js | 8 +++---- tests/syntaxes/mql4/syntax_test_input.mq4 | 4 ++-- tests/syntaxes/php7/syntax_test_use.php7 | 24 +++++++++---------- 16 files changed, 52 insertions(+), 52 deletions(-) diff --git a/Candyman.tmTheme b/Candyman.tmTheme index 6a294c89..75a93720 100644 --- a/Candyman.tmTheme +++ b/Candyman.tmTheme @@ -1863,7 +1863,7 @@ scope - .source.scss .keyword.operator.other.comma, .source.scss .keyword.operator.other.association, .source.scss .keyword.operator.other.terminator + .source.scss .keyword.operator.other.comma, .source.scss .keyword.operator.other.association, .source.scss .keyword.other.terminator settings foreground diff --git a/schemes/candyman/scss/_operator.scss b/schemes/candyman/scss/_operator.scss index 40d4b406..b5cf5103 100644 --- a/schemes/candyman/scss/_operator.scss +++ b/schemes/candyman/scss/_operator.scss @@ -13,7 +13,7 @@ .source.scss { .keyword.operator.other.comma, .keyword.operator.other.association, - .keyword.operator.other.terminator { + .keyword.other.terminator { foreground: $gray-0; } } diff --git a/syntaxes/fjsx15/operator/terminator.sublime-syntax b/syntaxes/fjsx15/operator/terminator.sublime-syntax index d732148c..784b1282 100644 --- a/syntaxes/fjsx15/operator/terminator.sublime-syntax +++ b/syntaxes/fjsx15/operator/terminator.sublime-syntax @@ -21,7 +21,7 @@ contexts: main: - match: \s*(;) captures: - 1: keyword.operator.other.terminator.js.fjsx15 + 1: keyword.other.terminator.js.fjsx15 set: entry-point entry-point: diff --git a/syntaxes/mql4/statement/bodied.sublime-syntax b/syntaxes/mql4/statement/bodied.sublime-syntax index 07d39fed..ca4ea6f3 100644 --- a/syntaxes/mql4/statement/bodied.sublime-syntax +++ b/syntaxes/mql4/statement/bodied.sublime-syntax @@ -78,7 +78,7 @@ contexts: terminator: - match: \s*(;) captures: - 1: keyword.operator.other.terminator.mql.mql4 + 1: keyword.other.terminator.mql.mql4 pop: true body: diff --git a/syntaxes/mql4/terminator.sublime-syntax b/syntaxes/mql4/terminator.sublime-syntax index 94d80d9c..666ee3ef 100644 --- a/syntaxes/mql4/terminator.sublime-syntax +++ b/syntaxes/mql4/terminator.sublime-syntax @@ -21,5 +21,5 @@ contexts: main: - match: \s*(;) captures: - 1: keyword.operator.other.terminator.mql.mql4 + 1: keyword.other.terminator.mql.mql4 pop: true diff --git a/syntaxes/php7/statement/bodied.sublime-syntax b/syntaxes/php7/statement/bodied.sublime-syntax index 7762c4fc..8a9e89cd 100644 --- a/syntaxes/php7/statement/bodied.sublime-syntax +++ b/syntaxes/php7/statement/bodied.sublime-syntax @@ -73,7 +73,7 @@ contexts: terminator: - match: \s*(;) captures: - 1: keyword.operator.other.terminator.php.php7 + 1: keyword.other.terminator.php.php7 pop: true body: diff --git a/syntaxes/php7/terminator.sublime-syntax b/syntaxes/php7/terminator.sublime-syntax index e6ba8333..3da8bf1d 100644 --- a/syntaxes/php7/terminator.sublime-syntax +++ b/syntaxes/php7/terminator.sublime-syntax @@ -21,5 +21,5 @@ contexts: main: - match: \s*(;) captures: - 1: keyword.operator.other.terminator.php.php7 + 1: keyword.other.terminator.php.php7 pop: true diff --git a/syntaxes/scss3/terminator.sublime-syntax b/syntaxes/scss3/terminator.sublime-syntax index daf4ae96..04213a84 100644 --- a/syntaxes/scss3/terminator.sublime-syntax +++ b/syntaxes/scss3/terminator.sublime-syntax @@ -21,5 +21,5 @@ contexts: main: - match: \s*(;) captures: - 1: keyword.operator.other.terminator.scss.scss3 + 1: keyword.other.terminator.scss.scss3 pop: true diff --git a/tests/syntaxes/fjsx15/destructuring/syntax_test_array.js b/tests/syntaxes/fjsx15/destructuring/syntax_test_array.js index 496e651d..afb3af2c 100644 --- a/tests/syntaxes/fjsx15/destructuring/syntax_test_array.js +++ b/tests/syntaxes/fjsx15/destructuring/syntax_test_array.js @@ -33,7 +33,7 @@ // ^ .punctuation.definition.array.js.fjsx15 // ^ .constant.numeric.decimal.js.fjsx15 // ^ .punctuation.definition.array.end.js.fjsx15 -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 let [a=0,...b=0]:[number,number] = [1,2]; // ^^^ .keyword.declaration.variable.js.fjsx15 // ^ .destructuring.array.js.fjsx15 @@ -63,7 +63,7 @@ // ^ .punctuation.definition.array.js.fjsx15 // ^ .constant.numeric.decimal.js.fjsx15 // ^ .punctuation.definition.array.end.js.fjsx15 -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 let [[a=0,...b=0]] = [[1,2]]; // ^^^ .keyword.declaration.variable.js.fjsx15 // ^ .destructuring.array.js.fjsx15 @@ -91,7 +91,7 @@ // ^ .constant.numeric.decimal.js.fjsx15 // ^ .punctuation.definition.array.end.js.fjsx15 // ^ .punctuation.definition.array.end.js.fjsx15 -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 let [[a=0,...b=0]]:[[number,number]] = [[1,2]]; // ^^^ .keyword.declaration.variable.js.fjsx15 // ^ .destructuring.array.js.fjsx15 @@ -129,7 +129,7 @@ // ^ .constant.numeric.decimal.js.fjsx15 // ^ .punctuation.definition.array.end.js.fjsx15 // ^ .punctuation.definition.array.end.js.fjsx15 -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 function foo([a=0,...b=0]){} // ^^^^^^^^ .keyword.declaration.function.js.fjsx15 // ^^^ .entity.name.function.js.fjsx15 diff --git a/tests/syntaxes/fjsx15/destructuring/syntax_test_object.js b/tests/syntaxes/fjsx15/destructuring/syntax_test_object.js index 20c0f436..9a9d9f2c 100644 --- a/tests/syntaxes/fjsx15/destructuring/syntax_test_object.js +++ b/tests/syntaxes/fjsx15/destructuring/syntax_test_object.js @@ -42,7 +42,7 @@ // ^ .keyword.operator.other.association.js.fjsx15 // ^ .constant.numeric.decimal.js.fjsx15 // ^ .punctuation.definition.object.end.js.fjsx15 -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 let {a=0,...b=0} = {a:1,b:2}; // ^^^ .keyword.declaration.variable.js.fjsx15 // ^ .destructuring.object.js.fjsx15 @@ -72,7 +72,7 @@ // ^ .keyword.operator.other.association.js.fjsx15 // ^ .constant.numeric.decimal.js.fjsx15 // ^ .punctuation.definition.object.end.js.fjsx15 -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 let {a=0,...b=0}:{a:number,b:number} = {a:1,b:2}; // ^^^ .keyword.declaration.variable.js.fjsx15 // ^ .destructuring.object.js.fjsx15 @@ -102,7 +102,7 @@ // ^ .punctuation.definition.object.js.fjsx15 // ^ .constant.numeric.decimal.js.fjsx15 // ^ .punctuation.definition.object.end.js.fjsx15 -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 let {a:{a=0,...b=0}} = {a:{a:1,a:2}}; // ^^^ .keyword.declaration.variable.js.fjsx15 // ^ .destructuring.object.js.fjsx15 @@ -142,7 +142,7 @@ // ^ .constant.numeric.decimal.js.fjsx15 // ^ .punctuation.definition.object.end.js.fjsx15 // ^ .punctuation.definition.object.end.js.fjsx15 -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 let {a:{a=0,...b=0}}:{a:{a:number,b:number}} = {a:{a:1,b:2}}; // ^^^ .keyword.declaration.variable.js.fjsx15 // ^ .destructuring.object.js.fjsx15 @@ -192,7 +192,7 @@ // ^ .constant.numeric.decimal.js.fjsx15 // ^ .punctuation.definition.object.end.js.fjsx15 // ^ .punctuation.definition.object.end.js.fjsx15 -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 function foo({a=0,...b=0}){} // ^^^^^^^^ .keyword.declaration.function.js.fjsx15 // ^^^ .entity.name.function.js.fjsx15 diff --git a/tests/syntaxes/fjsx15/flowtype/syntax_test_type-aliasing.js b/tests/syntaxes/fjsx15/flowtype/syntax_test_type-aliasing.js index aa02851c..a00e2115 100644 --- a/tests/syntaxes/fjsx15/flowtype/syntax_test_type-aliasing.js +++ b/tests/syntaxes/fjsx15/flowtype/syntax_test_type-aliasing.js @@ -17,7 +17,7 @@ // ^^^^^ .entity.name.type.flowtype // ^ .keyword.operator.other.assignment.flowtype // ^^^^^^^^ .entity.name.type.flowtype -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 type Alias = SomeType[]; // ^^^^ .keyword.declaration.type-aliasing.flowtype // ^^^^^ .entity.name.type.flowtype @@ -25,7 +25,7 @@ // ^^^^^^^^ .entity.name.type.flowtype // ^ .punctuation.definition.array.begin.flowtype // ^ .punctuation.definition.array.end.flowtype -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 type Alias = SomeType; // ^^^^ .keyword.declaration.type-aliasing.flowtype // ^^^^^ .entity.name.type.flowtype @@ -35,7 +35,7 @@ // ^^^^^^ .support.flowtype // ^^^^^^ .entity.name.type.flowtype // ^ .punctuation.definition.template.arguments.end.flowtype -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 type Alias = SomeType; // ^^^^ .keyword.declaration.type-aliasing.flowtype // ^^^^^ .entity.name.type.flowtype @@ -47,7 +47,7 @@ // ^ .punctuation.definition.array.begin.flowtype // ^ .punctuation.definition.array.end.flowtype // ^ .punctuation.definition.template.arguments.end.flowtype -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 type Alias = (param:number) => number; // ^^^^ .keyword.declaration.type-aliasing.flowtype // ^^^^^ .entity.name.type.flowtype @@ -61,7 +61,7 @@ // ^^ .punctuation.definition.function.result.flowtype // ^^^^^^ .support.flowtype // ^^^^^^ .entity.name.type.flowtype -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 type Alias = (param:number, param:string) => number; // ^^^^ .keyword.declaration.type-aliasing.flowtype // ^^^^^ .entity.name.type.flowtype @@ -80,7 +80,7 @@ // ^^ .punctuation.definition.function.result.flowtype // ^^^^^^ .support.flowtype // ^^^^^^ .entity.name.type.flowtype -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 type Alias = (param:A, param:B) => C; // ^^^^ .keyword.declaration.type-aliasing.flowtype // ^^^^^ .entity.name.type.flowtype @@ -103,7 +103,7 @@ // ^ .punctuation.definition.function.parameters.end.flowtype // ^^ .punctuation.definition.function.result.flowtype // ^ .entity.name.type.flowtype -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 type Alias = (param:A|B, param:B) => C|B; // ^^^^ .keyword.declaration.type-aliasing.flowtype // ^^^^^ .entity.name.type.flowtype @@ -130,7 +130,7 @@ // ^ .entity.name.type.flowtype // ^ .keyword.operator.other.union.flowtype // ^ .entity.name.type.flowtype -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 type Alias = (param:?(A|B), param:?B) => ?C; // ^^^^ .keyword.declaration.type-aliasing.flowtype // ^^^^^ .entity.name.type.flowtype @@ -160,7 +160,7 @@ // ^^ .punctuation.definition.function.result.flowtype // ^ .keyword.operator.other.nullable.flowtype // ^ .entity.name.type.flowtype -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 type Alias = {a:?A, b:?B}; // ^^^^ .keyword.declaration.type-aliasing.flowtype // ^^^^^ .entity.name.type.flowtype @@ -181,7 +181,7 @@ // ^ .keyword.operator.other.nullable.flowtype // ^ .entity.name.type.flowtype // ^ .punctuation.definition.object.end.flowtype -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 type Alias = {a:?(A|C), b:?B}; // ^^^^ .keyword.declaration.type-aliasing.flowtype // ^^^^^ .entity.name.type.flowtype @@ -208,7 +208,7 @@ // ^ .keyword.operator.other.nullable.flowtype // ^ .entity.name.type.flowtype // ^ .punctuation.definition.object.end.flowtype -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 type Alias = {a:A} & {b:B}; // ^^^^ .keyword.declaration.type-aliasing.flowtype // ^^^^^ .entity.name.type.flowtype @@ -229,4 +229,4 @@ // ^ .keyword.operator.other.association.flowtype // ^ .entity.name.type.flowtype // ^ .punctuation.definition.object.end.flowtype -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 diff --git a/tests/syntaxes/fjsx15/literal/syntax_test_object.js b/tests/syntaxes/fjsx15/literal/syntax_test_object.js index 53156ff6..24261a99 100644 --- a/tests/syntaxes/fjsx15/literal/syntax_test_object.js +++ b/tests/syntaxes/fjsx15/literal/syntax_test_object.js @@ -44,7 +44,7 @@ // ^ .punctuation.definition.object.js.fjsx15 }; // ^ .punctuation.definition.object.end.js.fjsx15 -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 var object = { // ^^^ .storage.type.js.fjsx15 // ^^^ .keyword.declaration.variable.js.fjsx15 @@ -159,4 +159,4 @@ // ^ .punctuation.definition.object.js.fjsx15 }; // ^ .punctuation.definition.object.end.js.fjsx15 -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 diff --git a/tests/syntaxes/fjsx15/syntax_test_class.js b/tests/syntaxes/fjsx15/syntax_test_class.js index 5ed64e9e..ab96ec41 100644 --- a/tests/syntaxes/fjsx15/syntax_test_class.js +++ b/tests/syntaxes/fjsx15/syntax_test_class.js @@ -111,7 +111,7 @@ // ^ .keyword.operator.other.member-access.js.fjsx15 // ^^^^^^ .entity.name.variable.js.fjsx15 // ^ .punctuation.definition.object.end.js.fjsx15 -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 static defaultProps = {initialCount:0}; // ^^^^^^ .storage.modifier.js.fjsx15 // ^^^^^^ .keyword.other.access.js.fjsx15 @@ -122,7 +122,7 @@ // ^ .keyword.operator.other.association.js.fjsx15 // ^ .constant.numeric.decimal.js.fjsx15 // ^ .punctuation.definition.object.end.js.fjsx15 -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 state = {count:this.props.initialCount}; // ^^^^^ .entity.name.variable.js.fjsx15 // ^ .keyword.operator.other.assignment.js.fjsx15 @@ -137,7 +137,7 @@ // ^ .keyword.operator.other.member-access.js.fjsx15 // ^^^^^^^^^^^^ .entity.name.variable.js.fjsx15 // ^ .punctuation.definition.object.end.js.fjsx15 -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 constructor(){} // ^^^^^^^^^^^ .support.js.fjsx15 // ^^^^^^^^^^^ .entity.name.function.js.fjsx15 diff --git a/tests/syntaxes/fjsx15/syntax_test_function-call.js b/tests/syntaxes/fjsx15/syntax_test_function-call.js index 05ee54a8..2860015d 100644 --- a/tests/syntaxes/fjsx15/syntax_test_function-call.js +++ b/tests/syntaxes/fjsx15/syntax_test_function-call.js @@ -20,7 +20,7 @@ // ^ .punctuation.definition.function.arguments.js.fjsx15 // ^ .constant.numeric.decimal.js.fjsx15 // ^ .punctuation.definition.function.arguments.end.js.fjsx15 -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 foo(1,2); // ^^^ .entity.name.function.js.fjsx15 // ^ .punctuation.definition.template.arguments.begin.flowtype @@ -33,7 +33,7 @@ // ^ .punctuation.definition.function.arguments.js.fjsx15 // ^ .constant.numeric.decimal.js.fjsx15 // ^ .punctuation.definition.function.arguments.end.js.fjsx15 -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 foo(1,2); // ^^^ .entity.name.function.js.fjsx15 // ^ .punctuation.definition.template.arguments.begin.flowtype @@ -46,7 +46,7 @@ // ^ .punctuation.definition.function.arguments.js.fjsx15 // ^ .constant.numeric.decimal.js.fjsx15 // ^ .punctuation.definition.function.arguments.end.js.fjsx15 -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 foo<{a:A} & {b:B}>(1,2); // ^^^ .entity.name.function.js.fjsx15 // ^ .punctuation.definition.template.arguments.begin.flowtype @@ -67,4 +67,4 @@ // ^ .punctuation.definition.function.arguments.js.fjsx15 // ^ .constant.numeric.decimal.js.fjsx15 // ^ .punctuation.definition.function.arguments.end.js.fjsx15 -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 diff --git a/tests/syntaxes/mql4/syntax_test_input.mq4 b/tests/syntaxes/mql4/syntax_test_input.mq4 index eb438ece..18498cd7 100644 --- a/tests/syntaxes/mql4/syntax_test_input.mq4 +++ b/tests/syntaxes/mql4/syntax_test_input.mq4 @@ -22,7 +22,7 @@ // ^^^ string.content.mql.mql4 // ^ punctuation.definition.string.begin.mql.mql4 // ^ punctuation.definition.string.end.mql.mql4 -// ^ keyword.operator.other.terminator.mql.mql4 +// ^ keyword.other.terminator.mql.mql4 input Custom identifier = "..."; // ^^^^^ keyword.input.mql.mql4 // ^^^^^^ entity.name.type.mql.mql4 @@ -32,4 +32,4 @@ // ^^^ string.content.mql.mql4 // ^ punctuation.definition.string.begin.mql.mql4 // ^ punctuation.definition.string.end.mql.mql4 -// ^ keyword.operator.other.terminator.mql.mql4 +// ^ keyword.other.terminator.mql.mql4 diff --git a/tests/syntaxes/php7/syntax_test_use.php7 b/tests/syntaxes/php7/syntax_test_use.php7 index dd5e92eb..8f928325 100644 --- a/tests/syntaxes/php7/syntax_test_use.php7 +++ b/tests/syntaxes/php7/syntax_test_use.php7 @@ -18,7 +18,7 @@ // ^ punctuation.definition.namespace.a.php.php7 // ^ punctuation.definition.namespace.b.php.php7 // ^ punctuation.definition.ambiguous.php.php7 -// ^ keyword.operator.other.terminator.php.php7 +// ^ keyword.other.terminator.php.php7 // ^^^^^^^^^ entity.name.namespace.a.php.php7 // ^^^^^^^^^ entity.name.namespace.b.php.php7 // ^^^^^ entity.name.ambiguous.php.php7 @@ -29,7 +29,7 @@ // ^ punctuation.definition.namespace.a.php.php7 // ^ punctuation.definition.namespace.b.php.php7 // ^ punctuation.definition.ambiguous.php.php7 -// ^ keyword.operator.other.terminator.php.php7 +// ^ keyword.other.terminator.php.php7 // ^^^^^^^^^ entity.name.namespace.a.php.php7 // ^^^^^^^^^ entity.name.namespace.b.php.php7 // ^^^^^ entity.name.ambiguous.php.php7 @@ -39,7 +39,7 @@ // ^^^ keyword.import.php.php7 // ^ punctuation.definition.namespace.b.php.php7 // ^ punctuation.definition.ambiguous.php.php7 -// ^ keyword.operator.other.terminator.php.php7 +// ^ keyword.other.terminator.php.php7 // ^^^^^^^^^ entity.name.namespace.a.php.php7 // ^^^^^^^^^ entity.name.namespace.b.php.php7 // ^^^^^ entity.name.ambiguous.php.php7 @@ -49,7 +49,7 @@ // ^^ keyword.import.alias.php.php7 // ^ punctuation.definition.namespace.b.php.php7 // ^ punctuation.definition.ambiguous.php.php7 -// ^ keyword.operator.other.terminator.php.php7 +// ^ keyword.other.terminator.php.php7 // ^^^^^^^^^ entity.name.namespace.a.php.php7 // ^^^^^^^^^ entity.name.namespace.b.php.php7 // ^^^^^ entity.name.ambiguous.php.php7 @@ -61,7 +61,7 @@ // ^ punctuation.definition.namespace.a.php.php7 // ^ punctuation.definition.namespace.b.php.php7 // ^ punctuation.definition.function.php.php7 -// ^ keyword.operator.other.terminator.php.php7 +// ^ keyword.other.terminator.php.php7 // ^^^^^^^^^ entity.name.namespace.a.php.php7 // ^^^^^^^^^ entity.name.namespace.b.php.php7 // ^^^^^^^^^^ entity.name.function.php.php7 @@ -73,7 +73,7 @@ // ^ punctuation.definition.namespace.a.php.php7 // ^ punctuation.definition.namespace.b.php.php7 // ^ punctuation.definition.function.php.php7 -// ^ keyword.operator.other.terminator.php.php7 +// ^ keyword.other.terminator.php.php7 // ^^^^^^^^^ entity.name.namespace.a.php.php7 // ^^^^^^^^^ entity.name.namespace.b.php.php7 // ^^^^^^^^^ entity.name.function.php.php7 @@ -84,7 +84,7 @@ // ^^^^^^^^ keyword.import.function.php.php7 // ^ punctuation.definition.namespace.b.php.php7 // ^ punctuation.definition.function.php.php7 -// ^ keyword.operator.other.terminator.php.php7 +// ^ keyword.other.terminator.php.php7 // ^^^^^^^^^ entity.name.namespace.a.php.php7 // ^^^^^^^^^ entity.name.namespace.b.php.php7 // ^^^^^^^^^^ entity.name.function.php.php7 @@ -95,7 +95,7 @@ // ^^ keyword.import.alias.php.php7 // ^ punctuation.definition.namespace.b.php.php7 // ^ punctuation.definition.function.php.php7 -// ^ keyword.operator.other.terminator.php.php7 +// ^ keyword.other.terminator.php.php7 // ^^^^^^^^^ entity.name.namespace.a.php.php7 // ^^^^^^^^^ entity.name.namespace.b.php.php7 // ^^^^^^^^^^ entity.name.function.php.php7 @@ -107,7 +107,7 @@ // ^ punctuation.definition.namespace.a.php.php7 // ^ punctuation.definition.namespace.b.php.php7 // ^ punctuation.definition.constant.php.php7 -// ^ keyword.operator.other.terminator.php.php7 +// ^ keyword.other.terminator.php.php7 // ^^^^^^^^^ entity.name.namespace.a.php.php7 // ^^^^^^^^^ entity.name.namespace.b.php.php7 // ^^^^^^^^^^ entity.name.constant.php.php7 @@ -119,7 +119,7 @@ // ^ punctuation.definition.namespace.a.php.php7 // ^ punctuation.definition.namespace.b.php.php7 // ^ punctuation.definition.constant.php.php7 -// ^ keyword.operator.other.terminator.php.php7 +// ^ keyword.other.terminator.php.php7 // ^^^^^^^^^ entity.name.namespace.a.php.php7 // ^^^^^^^^^ entity.name.namespace.b.php.php7 // ^^^^^^^^^^ entity.name.constant.php.php7 @@ -130,7 +130,7 @@ // ^^^^^ keyword.import.constant.php.php7 // ^ punctuation.definition.namespace.b.php.php7 // ^ punctuation.definition.constant.php.php7 -// ^ keyword.operator.other.terminator.php.php7 +// ^ keyword.other.terminator.php.php7 // ^^^^^^^^^ entity.name.namespace.a.php.php7 // ^^^^^^^^^ entity.name.namespace.b.php.php7 // ^^^^^^^^^^ entity.name.constant.php.php7 @@ -141,7 +141,7 @@ // ^^ keyword.import.alias.php.php7 // ^ punctuation.definition.namespace.b.php.php7 // ^ punctuation.definition.constant.php.php7 -// ^ keyword.operator.other.terminator.php.php7 +// ^ keyword.other.terminator.php.php7 // ^^^^^^^^^ entity.name.namespace.a.php.php7 // ^^^^^^^^^ entity.name.namespace.b.php.php7 // ^^^^^^^^^^ entity.name.constant.php.php7 From 5df6290d807406ad7bc45040a0bbb99915c8d0d9 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Wed, 13 Dec 2017 08:47:08 -0200 Subject: [PATCH 168/407] [FJSX15] Simplify optional modifier --- .../optional-modifier.no-pop.sublime-syntax | 26 ++++++++++++++++++ .../flowtype/optional-modifier.sublime-syntax | 27 +++++++++++++++++++ .../function/parameter/simple.sublime-syntax | 11 ++++---- 3 files changed, 58 insertions(+), 6 deletions(-) create mode 100644 syntaxes/fjsx15/flowtype/optional-modifier.no-pop.sublime-syntax create mode 100644 syntaxes/fjsx15/flowtype/optional-modifier.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/optional-modifier.no-pop.sublime-syntax b/syntaxes/fjsx15/flowtype/optional-modifier.no-pop.sublime-syntax new file mode 100644 index 00000000..cbf1986a --- /dev/null +++ b/syntaxes/fjsx15/flowtype/optional-modifier.no-pop.sublime-syntax @@ -0,0 +1,26 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +contexts: + main: + - match: (?=\s*\?) + push: optional-modifier + + optional-modifier: + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-modifier.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/optional-modifier.sublime-syntax b/syntaxes/fjsx15/flowtype/optional-modifier.sublime-syntax new file mode 100644 index 00000000..24d73e53 --- /dev/null +++ b/syntaxes/fjsx15/flowtype/optional-modifier.sublime-syntax @@ -0,0 +1,27 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +contexts: + main: + - match: \s*(\?) + captures: + 1: >- + flowtype + keyword.operator.other.optional.flowtype + pop: true diff --git a/syntaxes/fjsx15/function/parameter/simple.sublime-syntax b/syntaxes/fjsx15/function/parameter/simple.sublime-syntax index 9f28d299..3357ad45 100644 --- a/syntaxes/fjsx15/function/parameter/simple.sublime-syntax +++ b/syntaxes/fjsx15/function/parameter/simple.sublime-syntax @@ -26,19 +26,18 @@ contexts: main: - match: | (?xi)\s* - ({{commonIdentifier}})(\?)? + ({{commonIdentifier}}) captures: + 1: >- function.parameter.js.fjsx15 entity.name.variable.js.fjsx15 - 3: >- - flowtype - keyword.operator.other.optional.flowtype set: [ optional-default-value, - optional-type + optional-modifier-and-type ] - optional-type: + optional-modifier-and-type: + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-modifier.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-associated-type.sublime-syntax optional-default-value: From 5f19e8875f5f5bc8e5bf62bd5518a90dcaab5d56 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Wed, 13 Dec 2017 09:01:10 -0200 Subject: [PATCH 169/407] [FJSX15] Fix object destructuring --- syntaxes/fjsx15/destructuring/object.sublime-syntax | 7 ++++--- .../fjsx15/destructuring/object/property.sublime-syntax | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/syntaxes/fjsx15/destructuring/object.sublime-syntax b/syntaxes/fjsx15/destructuring/object.sublime-syntax index 05e8e129..fd330750 100644 --- a/syntaxes/fjsx15/destructuring/object.sublime-syntax +++ b/syntaxes/fjsx15/destructuring/object.sublime-syntax @@ -44,6 +44,9 @@ contexts: destructuring.object.js.fjsx15 punctuation.definition.object.end.js.fjsx15 pop: true + # Default value. + - match: (?=\s*=) + push: default-value optional-variable: - include: comment-no-pop @@ -56,9 +59,7 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/constant.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/variable.sublime-syntax - optional-default-value: - - match: (?=\s*,) - pop: true + default-value: - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax comment-no-pop: diff --git a/syntaxes/fjsx15/destructuring/object/property.sublime-syntax b/syntaxes/fjsx15/destructuring/object/property.sublime-syntax index 08aa51ba..8e639912 100644 --- a/syntaxes/fjsx15/destructuring/object/property.sublime-syntax +++ b/syntaxes/fjsx15/destructuring/object/property.sublime-syntax @@ -72,9 +72,10 @@ contexts: - include: comment-no-pop - match: (?=\s*\)) pop: true - - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/destructuring/array.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/simple.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/destructuring/array.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/destructuring/object.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/constant.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/variable.sublime-syntax comment-no-pop: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax From 5542b1a0011d5d56ca879fe863fd926285571ad8 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Wed, 13 Dec 2017 09:04:57 -0200 Subject: [PATCH 170/407] [FJSX15] Fix expression group scope --- syntaxes/fjsx15/flowtype/type-expression.sublime-syntax | 6 +++--- tests/syntaxes/fjsx15/syntax_test_function.js | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/syntaxes/fjsx15/flowtype/type-expression.sublime-syntax b/syntaxes/fjsx15/flowtype/type-expression.sublime-syntax index e9a4dfb9..94d28c85 100644 --- a/syntaxes/fjsx15/flowtype/type-expression.sublime-syntax +++ b/syntaxes/fjsx15/flowtype/type-expression.sublime-syntax @@ -52,7 +52,7 @@ contexts: captures: 1: >- flowtype - punctuation.definition.expression.group.begin.js.fjsx15 + punctuation.definition.expression.group.begin.flowtype set: open-group # Start of the type expression. - match: "{{expressionBegin}}" @@ -69,7 +69,7 @@ contexts: # Open new type expression group. - match: "{{expressionGroupBegin}}" captures: - 1: punctuation.definition.expression.group.begin.js.fjsx15 + 1: punctuation.definition.expression.group.begin.flowtype push: open-group # Close the current type expression group. - include: close-group @@ -82,7 +82,7 @@ contexts: captures: 1: >- flowtype - punctuation.definition.expression.group.end.js.fjsx15 + punctuation.definition.expression.group.end.flowtype set: optional-tail head: diff --git a/tests/syntaxes/fjsx15/syntax_test_function.js b/tests/syntaxes/fjsx15/syntax_test_function.js index 8912e6de..da1e14f0 100644 --- a/tests/syntaxes/fjsx15/syntax_test_function.js +++ b/tests/syntaxes/fjsx15/syntax_test_function.js @@ -86,13 +86,13 @@ // ^^^^^ .entity.name.variable.js.fjsx15 // ^ .keyword.operator.other.association.flowtype // ^ .keyword.operator.other.nullable.flowtype -// ^ .punctuation.definition.nullable.begin.flowtype +// ^ .punctuation.definition.expression.group.begin.flowtype // ^^^^^^ .support.flowtype // ^^^^^^ .entity.name.type.flowtype // ^ .keyword.operator.other.union.flowtype // ^^^^^^ .support.flowtype // ^^^^^^ .entity.name.type.flowtype -// ^ .punctuation.definition.nullable.end.flowtype +// ^ .punctuation.definition.expression.group.end.flowtype // ^ .punctuation.definition.function.parameters.end.js.fjsx15 // ^ .keyword.operator.other.association.flowtype // ^ .keyword.operator.other.nullable.flowtype From fdf10a19c4ad17001cccd4624a1042b2040a0396 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Wed, 13 Dec 2017 09:09:52 -0200 Subject: [PATCH 171/407] [FJSX15] Fix super not being highlighted as support --- syntaxes/fjsx15/core.sublime-syntax | 1 + tests/syntaxes/fjsx15/syntax_test_function-call.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/core.sublime-syntax b/syntaxes/fjsx15/core.sublime-syntax index ce33ebad..60b4c4b8 100644 --- a/syntaxes/fjsx15/core.sublime-syntax +++ b/syntaxes/fjsx15/core.sublime-syntax @@ -253,6 +253,7 @@ contexts: | eval | is(?>Finite|NaN) | parse(?>Float|Int) + | super )) (?=\s*\() captures: diff --git a/tests/syntaxes/fjsx15/syntax_test_function-call.js b/tests/syntaxes/fjsx15/syntax_test_function-call.js index 2860015d..1d745a15 100644 --- a/tests/syntaxes/fjsx15/syntax_test_function-call.js +++ b/tests/syntaxes/fjsx15/syntax_test_function-call.js @@ -13,7 +13,7 @@ // the License. super(1,2); -// ^^^^^ .support.js.fjsx15 +// ^^^^^ .support.core.js.fjsx15 // ^^^^^ .entity.name.function.js.fjsx15 // ^ .punctuation.definition.function.arguments.begin.js.fjsx15 // ^ .constant.numeric.decimal.js.fjsx15 From 6109a1a0c499fd1af014a3e9ae3f552b199ecf4c Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Wed, 13 Dec 2017 09:23:57 -0200 Subject: [PATCH 172/407] [FJSX15] Fix fragment content --- syntaxes/jsx1/fragment.sublime-syntax | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/jsx1/fragment.sublime-syntax b/syntaxes/jsx1/fragment.sublime-syntax index 3e05f5c8..df5bdb7b 100644 --- a/syntaxes/jsx1/fragment.sublime-syntax +++ b/syntaxes/jsx1/fragment.sublime-syntax @@ -44,7 +44,7 @@ contexts: - match: "" push: - clear_scopes: true - - include: Packages/Naomi/syntaxes/jsx1/main.sublime-syntax + - include: main - include: Packages/Naomi/syntaxes/jsx1/component.sublime-syntax - include: Packages/Naomi/syntaxes/jsx1/element.sublime-syntax - match: | From 97b52bb9166e5f0aa3c4c046ca9879fc70da6c8c Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Wed, 13 Dec 2017 09:30:15 -0200 Subject: [PATCH 173/407] [FJSX15] Remove unnecessary capturing group --- syntaxes/fjsx15/arrow-function.no-pop.sublime-syntax | 4 ++-- syntaxes/fjsx15/arrow-function.sublime-syntax | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/syntaxes/fjsx15/arrow-function.no-pop.sublime-syntax b/syntaxes/fjsx15/arrow-function.no-pop.sublime-syntax index cb182390..b83610ac 100644 --- a/syntaxes/fjsx15/arrow-function.no-pop.sublime-syntax +++ b/syntaxes/fjsx15/arrow-function.no-pop.sublime-syntax @@ -85,7 +85,7 @@ contexts: - match: | (?xi) (?= - \s*(async)? + (?:\s*async)? \s*{{templateArguments}}? \s*{{parameters}} \s*{{type}}? @@ -96,7 +96,7 @@ contexts: - match: | (?xi) (?= - \s*(async)? + (?:\s*async)? \s*{{commonIdentifier}} \s*{{type}}? \s*=> diff --git a/syntaxes/fjsx15/arrow-function.sublime-syntax b/syntaxes/fjsx15/arrow-function.sublime-syntax index 3d03d6dd..44886c46 100644 --- a/syntaxes/fjsx15/arrow-function.sublime-syntax +++ b/syntaxes/fjsx15/arrow-function.sublime-syntax @@ -85,7 +85,7 @@ contexts: - match: | (?xi) (?= - \s*(async)? + (?:\s*async)? \s*{{templateArguments}}? \s*{{parameters}} \s*{{type}}? @@ -96,7 +96,7 @@ contexts: - match: | (?xi) (?= - \s*(async)? + (?:\s*async)? \s*{{commonIdentifier}} \s*{{type}}? \s*=> From cb1a138760eaa21a64ee127ea8b0e0d4a76c527a Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Wed, 13 Dec 2017 09:31:57 -0200 Subject: [PATCH 174/407] [FJSX15] Add rest to arrow parameters --- syntaxes/fjsx15/arrow-function/parameters.sublime-syntax | 1 + 1 file changed, 1 insertion(+) diff --git a/syntaxes/fjsx15/arrow-function/parameters.sublime-syntax b/syntaxes/fjsx15/arrow-function/parameters.sublime-syntax index daeb8808..c4f8ff90 100644 --- a/syntaxes/fjsx15/arrow-function/parameters.sublime-syntax +++ b/syntaxes/fjsx15/arrow-function/parameters.sublime-syntax @@ -49,6 +49,7 @@ contexts: - include: comment-no-pop - match: (?=\s*[,)]) pop: true + - include: Packages/Naomi/syntaxes/fjsx15/operator/rest.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/destructuring/array.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/simple.sublime-syntax From 6aa176ec05efc24fa237d95ddf405c964c8ff687 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Wed, 13 Dec 2017 09:42:17 -0200 Subject: [PATCH 175/407] [FJSX15] Add meta scope test --- tests/syntaxes/fjsx15/syntax_test_function.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/syntaxes/fjsx15/syntax_test_function.js b/tests/syntaxes/fjsx15/syntax_test_function.js index da1e14f0..5ce8c2a5 100644 --- a/tests/syntaxes/fjsx15/syntax_test_function.js +++ b/tests/syntaxes/fjsx15/syntax_test_function.js @@ -13,6 +13,7 @@ // the License. function foo() {} +// ^^^^^^^^^^^^^^ .meta.function.declaration.js.fjsx15 // ^^^^^^^^ .keyword.declaration.function.js.fjsx15 // ^^^ .entity.name.function.js.fjsx15 // ^ .punctuation.definition.function.parameters.begin.js.fjsx15 @@ -20,6 +21,7 @@ // ^ .punctuation.definition.function.body.begin.js.fjsx15 // ^ .punctuation.definition.function.body.end.js.fjsx15 function *foo() {} +// ^^^^^^^^^^^^^^^ .meta.function.declaration.js.fjsx15 // ^^^^^^^^ .keyword.declaration.function.js.fjsx15 // ^ .storage.modifier.js.fjsx15 // ^ .keyword.operator.other.generator.js.fjsx15 @@ -29,6 +31,7 @@ // ^ .punctuation.definition.function.body.begin.js.fjsx15 // ^ .punctuation.definition.function.body.end.js.fjsx15 function foo(param, ...param) {} +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .meta.function.declaration.js.fjsx15 // ^^^^^^^^ .keyword.declaration.function.js.fjsx15 // ^^^ .entity.name.function.js.fjsx15 // ^ .punctuation.definition.function.parameters.begin.js.fjsx15 @@ -40,6 +43,7 @@ // ^ .punctuation.definition.function.body.begin.js.fjsx15 // ^ .punctuation.definition.function.body.end.js.fjsx15 function *foo(param, ...param) {} +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .meta.function.declaration.js.fjsx15 // ^^^^^^^^ .keyword.declaration.function.js.fjsx15 // ^ .storage.modifier.js.fjsx15 // ^ .keyword.operator.other.generator.js.fjsx15 @@ -53,6 +57,7 @@ // ^ .punctuation.definition.function.body.begin.js.fjsx15 // ^ .punctuation.definition.function.body.end.js.fjsx15 function foo(param:number, ...param:string):boolean {} +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .meta.function.declaration.js.fjsx15 // ^^^^^^^^ .keyword.declaration.function.js.fjsx15 // ^^^ .entity.name.function.js.fjsx15 // ^ .punctuation.definition.function.parameters.begin.js.fjsx15 @@ -73,6 +78,7 @@ // ^ .punctuation.definition.function.body.begin.js.fjsx15 // ^ .punctuation.definition.function.body.end.js.fjsx15 function foo(param:?number, ...param:?(string|number)):?boolean {} +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .meta.function.declaration.js.fjsx15 // ^^^^^^^^ .keyword.declaration.function.js.fjsx15 // ^^^ .entity.name.function.js.fjsx15 // ^ .punctuation.definition.function.parameters.begin.js.fjsx15 @@ -101,6 +107,7 @@ // ^ .punctuation.definition.function.body.begin.js.fjsx15 // ^ .punctuation.definition.function.body.end.js.fjsx15 function foo(param:A, ...param:B):B {} +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .meta.function.declaration.js.fjsx15 // ^^^^^^^^ .keyword.declaration.function.js.fjsx15 // ^^^ .entity.name.function.js.fjsx15 // ^ .punctuation.definition.template.parameters.begin.flowtype @@ -123,6 +130,7 @@ // ^ .punctuation.definition.function.body.begin.js.fjsx15 // ^ .punctuation.definition.function.body.end.js.fjsx15 function *foo(param:A, ...param:B):B {} +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .meta.function.declaration.js.fjsx15 // ^^^^^^^^ .keyword.declaration.function.js.fjsx15 // ^ .storage.modifier.js.fjsx15 // ^ .keyword.operator.other.generator.js.fjsx15 @@ -147,12 +155,14 @@ // ^ .punctuation.definition.function.body.begin.js.fjsx15 // ^ .punctuation.definition.function.body.end.js.fjsx15 function () {} +// ^^^^^^^^^^^ .meta.function.declaration.js.fjsx15 // ^^^^^^^^ .keyword.declaration.function.js.fjsx15 // ^ .punctuation.definition.function.parameters.begin.js.fjsx15 // ^ .punctuation.definition.function.parameters.end.js.fjsx15 // ^ .punctuation.definition.function.body.begin.js.fjsx15 // ^ .punctuation.definition.function.body.end.js.fjsx15 function *() {} +// ^^^^^^^^^^^^ .meta.function.declaration.js.fjsx15 // ^^^^^^^^ .keyword.declaration.function.js.fjsx15 // ^ .storage.modifier.js.fjsx15 // ^ .keyword.operator.other.generator.js.fjsx15 @@ -161,6 +171,7 @@ // ^ .punctuation.definition.function.body.begin.js.fjsx15 // ^ .punctuation.definition.function.body.end.js.fjsx15 function *(param:A, ...param:B):B {} +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .meta.function.declaration.js.fjsx15 // ^^^^^^^^ .keyword.declaration.function.js.fjsx15 // ^ .storage.modifier.js.fjsx15 // ^ .keyword.operator.other.generator.js.fjsx15 From c1257ac824d431f8cce77633920a6e6723e8fcff Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Thu, 14 Dec 2017 11:30:12 -0200 Subject: [PATCH 176/407] Add variable function calls to candyman --- Candyman.tmTheme | 9 +++++++++ schemes/candyman/shared/_function.scss | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/Candyman.tmTheme b/Candyman.tmTheme index 75a93720..1f5d9ec2 100644 --- a/Candyman.tmTheme +++ b/Candyman.tmTheme @@ -716,6 +716,15 @@ #aed581 + + scope + .function.call .entity.name.variable + settings + + foreground + #4fc3f7 + + scope .entity.name.function, .keyword.operator.other.computed-function, .punctuation.definition.function diff --git a/schemes/candyman/shared/_function.scss b/schemes/candyman/shared/_function.scss index 5360e8c9..164c1f4b 100644 --- a/schemes/candyman/shared/_function.scss +++ b/schemes/candyman/shared/_function.scss @@ -10,6 +10,12 @@ // License for the specific language governing permissions and limitations under // the License. +.function.call { + .entity.name.variable { + foreground: $light-blue-300; + } +} + .entity.name.function, .keyword.operator.other.computed-function, .punctuation.definition.function { From 772f876354efb3be26a4f2fd40b4d58640cfc0fe Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Thu, 14 Dec 2017 11:34:54 -0200 Subject: [PATCH 177/407] [FJSX15] Fix parameter destructuring with type --- .../function/parameter/destructuring/array.sublime-syntax | 5 +++-- .../function/parameter/destructuring/object.sublime-syntax | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/syntaxes/fjsx15/function/parameter/destructuring/array.sublime-syntax b/syntaxes/fjsx15/function/parameter/destructuring/array.sublime-syntax index c037c81d..b3bc7f61 100644 --- a/syntaxes/fjsx15/function/parameter/destructuring/array.sublime-syntax +++ b/syntaxes/fjsx15/function/parameter/destructuring/array.sublime-syntax @@ -38,7 +38,7 @@ contexts: 1: >- destructuring.array.js.fjsx15 punctuation.definition.array.end.js.fjsx15 - set: optional-default-value + set: optional-type-and-default-value optional-parameter: - include: comment-no-pop @@ -49,9 +49,10 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/simple.sublime-syntax - optional-default-value: + optional-type-and-default-value: - match: (?=\s*,) pop: true + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax comment-no-pop: diff --git a/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax b/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax index 374536c4..79586b9d 100644 --- a/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax +++ b/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax @@ -43,7 +43,7 @@ contexts: 1: >- destructuring.object.js.fjsx15 punctuation.definition.object.end.js.fjsx15 - set: optional-default-value + set: optional-type-and-default-value optional-parameter: - include: comment-no-pop @@ -55,9 +55,10 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/simple.sublime-syntax - optional-default-value: + optional-type-and-default-value: - match: (?=\s*,) pop: true + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax comment-no-pop: From f339e14b06b5f0c61c3eaa6b42b2cc6f63efbe6c Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Thu, 14 Dec 2017 11:38:28 -0200 Subject: [PATCH 178/407] [FJSX15] Restrict function call context scope --- syntaxes/fjsx15/function-call.sublime-syntax | 4 ++-- .../fjsx15/function-call/arguments.sublime-syntax | 12 +++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/syntaxes/fjsx15/function-call.sublime-syntax b/syntaxes/fjsx15/function-call.sublime-syntax index 1fc78f54..1556df65 100644 --- a/syntaxes/fjsx15/function-call.sublime-syntax +++ b/syntaxes/fjsx15/function-call.sublime-syntax @@ -76,8 +76,8 @@ contexts: \s*({{commonIdentifier}}) captures: 1: >- - call.js.fjsx - entity.name.function.js.fjsx15 + function.call.js.fjsx + entity.name.variable.js.fjsx15 pop: true template-arguments: diff --git a/syntaxes/fjsx15/function-call/arguments.sublime-syntax b/syntaxes/fjsx15/function-call/arguments.sublime-syntax index 313ac711..3447bbae 100644 --- a/syntaxes/fjsx15/function-call/arguments.sublime-syntax +++ b/syntaxes/fjsx15/function-call/arguments.sublime-syntax @@ -21,17 +21,23 @@ contexts: main: - match: \s*(\() captures: - 1: punctuation.definition.function.arguments.begin.js.fjsx15 + 1: >- + function.call.js.fjsx15 + punctuation.definition.function.arguments.begin.js.fjsx15 set: [ delimiter, optional-expression ] delimiter: - match: \s*(\)) captures: - 1: punctuation.definition.function.arguments.end.js.fjsx15 + 1: >- + function.call.js.fjsx15 + punctuation.definition.function.arguments.end.js.fjsx15 pop: true - match: \s*(,) captures: - 1: punctuation.definition.function.arguments.js.fjsx15 + 1: >- + function.call.js.fjsx15 + punctuation.definition.function.arguments.js.fjsx15 push: optional-expression optional-expression: From d72f3a61fb459441ae7bf0f5a95f07a1798667d9 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Thu, 14 Dec 2017 11:39:01 -0200 Subject: [PATCH 179/407] Add terminator to arrow tests --- .../syntaxes/fjsx15/syntax_test_arrow-function.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/syntaxes/fjsx15/syntax_test_arrow-function.js b/tests/syntaxes/fjsx15/syntax_test_arrow-function.js index c966003b..ae094f76 100644 --- a/tests/syntaxes/fjsx15/syntax_test_arrow-function.js +++ b/tests/syntaxes/fjsx15/syntax_test_arrow-function.js @@ -12,13 +12,14 @@ // License for the specific language governing permissions and limitations under // the License. - () => {} + () => {}; // ^ .punctuation.definition.function.parameters.begin.js.fjsx15 // ^ .punctuation.definition.function.parameters.end.js.fjsx15 // ^^ .punctuation.definition.function.body.arrow.js.fjsx15 // ^ .punctuation.definition.function.body.begin.js.fjsx15 // ^ .punctuation.definition.function.body.end.js.fjsx15 - async () => {} +// ^ .keyword.other.terminator.js.fjsx15 + async () => {}; // ^^^^^ .storage.modifier.js.fjsx15 // ^^^^^ .keyword.other.async.js.fjsx15 // ^ .punctuation.definition.function.parameters.begin.js.fjsx15 @@ -26,7 +27,7 @@ // ^^ .punctuation.definition.function.body.arrow.js.fjsx15 // ^ .punctuation.definition.function.body.begin.js.fjsx15 // ^ .punctuation.definition.function.body.end.js.fjsx15 - (param, ...param) => {} + (param, ...param) => {}; // ^ .punctuation.definition.function.parameters.begin.js.fjsx15 // ^^^^^ .entity.name.variable.js.fjsx15 // ^ .punctuation.definition.function.parameters.js.fjsx15 @@ -36,7 +37,7 @@ // ^^ .punctuation.definition.function.body.arrow.js.fjsx15 // ^ .punctuation.definition.function.body.begin.js.fjsx15 // ^ .punctuation.definition.function.body.end.js.fjsx15 - async (param, ...param) => {} + async (param, ...param) => {}; // ^^^^^ .storage.modifier.js.fjsx15 // ^^^^^ .keyword.other.async.js.fjsx15 // ^ .punctuation.definition.function.parameters.begin.js.fjsx15 @@ -48,7 +49,7 @@ // ^^ .punctuation.definition.function.body.arrow.js.fjsx15 // ^ .punctuation.definition.function.body.begin.js.fjsx15 // ^ .punctuation.definition.function.body.end.js.fjsx15 - (param:number, ...param:string):number => {} + (param:number, ...param:string):number => {}; // ^ .punctuation.definition.function.parameters.begin.js.fjsx15 // ^^^^^ .entity.name.variable.js.fjsx15 // ^ .keyword.operator.other.association.flowtype @@ -67,7 +68,7 @@ // ^^ .punctuation.definition.function.body.arrow.js.fjsx15 // ^ .punctuation.definition.function.body.begin.js.fjsx15 // ^ .punctuation.definition.function.body.end.js.fjsx15 - async (param:number, ...param:string):number => {} + async (param:number, ...param:string):number => {}; // ^^^^^ .storage.modifier.js.fjsx15 // ^^^^^ .keyword.other.async.js.fjsx15 // ^ .punctuation.definition.function.parameters.begin.js.fjsx15 @@ -88,7 +89,7 @@ // ^^ .punctuation.definition.function.body.arrow.js.fjsx15 // ^ .punctuation.definition.function.body.begin.js.fjsx15 // ^ .punctuation.definition.function.body.end.js.fjsx15 - (param:A, ...param:B):C => {} + (param:A, ...param:B):C => {}; // ^ .punctuation.definition.template.parameters.begin.flowtype // ^ .entity.name.type.flowtype // ^ .punctuation.definition.template.parameters.flowtype From a54259bf9cb817f196edb6e1cf830ddd4495840a Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Thu, 14 Dec 2017 13:57:48 -0200 Subject: [PATCH 180/407] [FJSX15] Fix property access scope --- Candyman.tmTheme | 13 ++----------- schemes/candyman/shared/_object.scss | 4 ---- schemes/candyman/shared/_punctuation.scss | 4 ++-- syntaxes/fjsx15/property-access.sublime-syntax | 4 ++-- 4 files changed, 6 insertions(+), 19 deletions(-) diff --git a/Candyman.tmTheme b/Candyman.tmTheme index 1f5d9ec2..55366994 100644 --- a/Candyman.tmTheme +++ b/Candyman.tmTheme @@ -941,15 +941,6 @@ #aed581 - - scope - .punctuation.definition.property.access - settings - - foreground - #aed581 - - scope .object .keyword.operator @@ -1006,11 +997,11 @@ scope - .punctuation.definition.expression.group.b + .punctuation.other.property.access settings foreground - #bcaaa4 + #aed581 diff --git a/schemes/candyman/shared/_object.scss b/schemes/candyman/shared/_object.scss index a69e6dd5..2afdf4ef 100644 --- a/schemes/candyman/shared/_object.scss +++ b/schemes/candyman/shared/_object.scss @@ -14,10 +14,6 @@ foreground: $light-green-300; } -.punctuation.definition.property.access { - foreground: $light-green-300; -} - .object { .keyword.operator { foreground: $light-green-300; diff --git a/schemes/candyman/shared/_punctuation.scss b/schemes/candyman/shared/_punctuation.scss index 8fed3c5c..8991a6e1 100644 --- a/schemes/candyman/shared/_punctuation.scss +++ b/schemes/candyman/shared/_punctuation.scss @@ -14,8 +14,8 @@ foreground: $amber-100; } -.punctuation.definition.expression.group.b { - foreground: $brown-200; +.punctuation.other.property.access { + foreground: $light-green-300; } .punctuation.definition.block, diff --git a/syntaxes/fjsx15/property-access.sublime-syntax b/syntaxes/fjsx15/property-access.sublime-syntax index 76586eb7..238e6ffe 100644 --- a/syntaxes/fjsx15/property-access.sublime-syntax +++ b/syntaxes/fjsx15/property-access.sublime-syntax @@ -21,13 +21,13 @@ contexts: main: - match: \s*(\[) captures: - 1: punctuation.definition.property.access.begin.js.fjsx15 + 1: punctuation.other.property.access.begin.js.fjsx15 set: index index: - match: \s*(]) captures: - 1: punctuation.definition.property.access.end.js.fjsx15a + 1: punctuation.other.property.access.end.js.fjsx15a pop: true - match: "" push: optional-expression From d14ffb4dbd5f21df88884f3750a1fcfbaf12ff40 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Fri, 15 Dec 2017 21:55:13 -0200 Subject: [PATCH 181/407] [FJSX15] Resolve spread operator ambiguity --- syntaxes/fjsx15/operator/other.sublime-syntax | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/operator/other.sublime-syntax b/syntaxes/fjsx15/operator/other.sublime-syntax index 0142c7c6..265a4f25 100644 --- a/syntaxes/fjsx15/operator/other.sublime-syntax +++ b/syntaxes/fjsx15/operator/other.sublime-syntax @@ -39,7 +39,7 @@ contexts: captures: 1: keyword.operator.other.optional-chain.js.fjsx15 set: optional-expression - - match: \s*(\.) + - match: \s*(\.)(?!\.) captures: 1: keyword.operator.other.member-access.js.fjsx15 set: optional-expression From 4a1a13aaee9ff0feaa1800e4f39610cc8f73d84e Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 16 Dec 2017 00:18:45 -0200 Subject: [PATCH 182/407] [FJSX15] Fix simple arrow function expression body --- syntaxes/fjsx15/arrow-function/body.sublime-syntax | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/syntaxes/fjsx15/arrow-function/body.sublime-syntax b/syntaxes/fjsx15/arrow-function/body.sublime-syntax index 23658de1..98cdb5b6 100644 --- a/syntaxes/fjsx15/arrow-function/body.sublime-syntax +++ b/syntaxes/fjsx15/arrow-function/body.sublime-syntax @@ -39,8 +39,8 @@ contexts: close-body, optional-statements-and-expressions ] - - match: (?=\s*\S) - pop: true + - include: optional-expression + close-body: - match: \s*(}) @@ -56,5 +56,8 @@ contexts: comment-no-pop: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax + optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax + optional-expression-tail: - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax#optional-tail From fa7514877cba68c54f430d8ee6baea1749ddcf73 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 16 Dec 2017 00:19:14 -0200 Subject: [PATCH 183/407] [FJSX15] Rename variable for consistency --- syntaxes/fjsx15/arrow-function.no-pop.sublime-syntax | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/arrow-function.no-pop.sublime-syntax b/syntaxes/fjsx15/arrow-function.no-pop.sublime-syntax index b83610ac..6263e20f 100644 --- a/syntaxes/fjsx15/arrow-function.no-pop.sublime-syntax +++ b/syntaxes/fjsx15/arrow-function.no-pop.sublime-syntax @@ -29,6 +29,8 @@ variables: [^<>]* >) + templateParameters: {{templateArguments}} + parameters: | (\( [^()]* @@ -86,7 +88,7 @@ contexts: (?xi) (?= (?:\s*async)? - \s*{{templateArguments}}? + \s*{{templateParameters}}? \s*{{parameters}} \s*{{type}}? \s*=> From 9b5e8e57c68b9d1f9b436acfcc049fb1d0baf590 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 16 Dec 2017 00:19:24 -0200 Subject: [PATCH 184/407] [FJSX15] Compact code --- syntaxes/fjsx15/function.sublime-syntax | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/syntaxes/fjsx15/function.sublime-syntax b/syntaxes/fjsx15/function.sublime-syntax index 12875d65..d140fff1 100644 --- a/syntaxes/fjsx15/function.sublime-syntax +++ b/syntaxes/fjsx15/function.sublime-syntax @@ -60,10 +60,7 @@ contexts: - match: | (?xi)\s* (\*)? - (?: - \s* - ({{commonIdentifier}}) - )? + (?:\s*({{commonIdentifier}}))? captures: 1: >- storage.modifier.js.fjsx15 From c6a1c6de06f87c6d74d34fa4250ff06e10c87e7e Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 16 Dec 2017 00:25:07 -0200 Subject: [PATCH 185/407] [FJSX15] Add required quotes --- syntaxes/fjsx15/arrow-function.no-pop.sublime-syntax | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/arrow-function.no-pop.sublime-syntax b/syntaxes/fjsx15/arrow-function.no-pop.sublime-syntax index 6263e20f..00a77011 100644 --- a/syntaxes/fjsx15/arrow-function.no-pop.sublime-syntax +++ b/syntaxes/fjsx15/arrow-function.no-pop.sublime-syntax @@ -29,7 +29,7 @@ variables: [^<>]* >) - templateParameters: {{templateArguments}} + templateParameters: "{{templateArguments}}" parameters: | (\( From 7d7d3b12dcb912cb8a1bd5f907c781e3f948e981 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 16 Dec 2017 00:25:55 -0200 Subject: [PATCH 186/407] [FJSX15] Restore object literal --- syntaxes/fjsx15/class/method.sublime-syntax | 134 ++---------- syntaxes/fjsx15/literal/object.sublime-syntax | 64 ++---- .../literal/object/property.sublime-syntax | 204 +++++++++++++++--- 3 files changed, 210 insertions(+), 192 deletions(-) diff --git a/syntaxes/fjsx15/class/method.sublime-syntax b/syntaxes/fjsx15/class/method.sublime-syntax index 0c094cdc..6aac7799 100644 --- a/syntaxes/fjsx15/class/method.sublime-syntax +++ b/syntaxes/fjsx15/class/method.sublime-syntax @@ -30,108 +30,35 @@ variables: \]) methodIdentifier: | - (?> {{commonIdentifier}} - | '.*?(? '.*?(?\#|async|get|set|static)) - (\s+\g<-2>)* - ) - - templateArguments: | + templateParameters: | (< [^<>]* \g<-1>? [^<>]* >) - parameters: | - (\( - [^()]* - \g<-1>? - [^()]* - \)) - - flowOperators: | - (?> &(?!&) - | \|(?!\|) - ) - - string: | - (?> '.*?' - | ".*?" - | `.*` - ) - - simpleFlowType: | - (?> {{string}} - | {{commonIdentifier}} - {{templateArguments}}? - ) - - flowFunction: | - ( - {{parameters}} - \s*=>\s* - (?> {{simpleFlowType}} - | \g<-2> - ) - ) - - complexType: | - ( - \??\s* - (?> {{simpleFlowType}} - | {{flowFunction}} - ) - \s*{{flowOperators}}? - \s*\g<-5>? - ) - - flowComment: /\*\s*:.*?\*/ - - type: | - (?> {{flowComment}} - | :{{complexType}} - )? - contexts: main: + - match: | + (?xi) + (?=\s*(?>\#|\*|async|get|set|static)) + set: declaration # Normal method. - match: | (?xi) (?= - \s*{{modifiers}}? - \s*\*? \s*{{methodIdentifier}} - \s*{{templateArguments}}? + \s*{{templateParameters}}? \s*\( ) - set: [ - declaration, - modifiers - ] - # Method assigned to a class property. - # - match: | - # (?xi) - # (?= - # \s*{{commonIdentifier}} - # \s*= - # \s*{{modifiers}}? - # \s*{{templateArguments}}? - # \s*{{parameters}}? - # \s*{{type}}? - # \s*=> - # ) - # set: [ - # arrow-function, - # declaration - # ] + set: declaration modifiers: - match: \s*(\#|static) @@ -156,17 +83,10 @@ contexts: 1: >- storage.modifier.js.fjsx15 keyword.operator.other.generator.js.fjsx15 - - match: "" - pop: true - - # arrow-function: - # - include: Packages/Naomi/syntaxes/fjsx15/arrow-function.sublime-syntax declaration: - - match: \s*(=) - captures: - 1: punctuation.definition.function.assignment.js.fjsx15 - pop: true + - include: comment-no-pop + - include: modifiers # Body. - match: (?=\s*\{) set: body @@ -193,26 +113,18 @@ contexts: # Identifier. - match: | (?xi) - \s*(\*)? \s*({{commonIdentifier}}) captures: - 1: >- - storage.modifier.js.fjsx15 - keyword.operator.other.generator.js.fjsx15 - 2: entity.name.function.js.fjsx15 + 1: entity.name.function.js.fjsx15 # Computed identifier. - match: | (?x) - (?:\s*(\*))? \s*(\[) captures: - 1: >- - storage.modifier.js.fjsx15 - keyword.operator.other.generator.js.fjsx15 - 2: punctuation.definition.function.identifier.begin.js.fjsx15 - push: computed-identifier + 1: punctuation.definition.function.identifier.begin.js.fjsx15 + push: [ computed-identifier-end, optional-expression ] # String identifiers - - match: (?=(?>'|"|`)) + - match: (?=\s*(?>'|"|`)) push: - include: Packages/Naomi/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax @@ -232,24 +144,20 @@ contexts: body: - include: Packages/Naomi/syntaxes/fjsx15/function/body.sublime-syntax - - match: (?=\s*\S) - pop: true support-body: - include: Packages/Naomi/syntaxes/fjsx15/function/support/body.sublime-syntax - match: (?=\s*\S) pop: true - computed-identifier: + computed-identifier-end: - match: \s*(]) captures: 1: punctuation.definition.function.identifier.end.js.fjsx15 pop: true - - match: "" - push: - - match: (?=\s*]) - pop: true - # - include: statement-and-expression - # statement-and-expression: - # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + comment-no-pop: + - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax + + optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/literal/object.sublime-syntax b/syntaxes/fjsx15/literal/object.sublime-syntax index 869e4128..af651210 100644 --- a/syntaxes/fjsx15/literal/object.sublime-syntax +++ b/syntaxes/fjsx15/literal/object.sublime-syntax @@ -30,72 +30,42 @@ contexts: main: - match: \s*({) scope: punctuation.definition.object.begin.js.fjsx15 - set: declaration + set: [ delimiters, statements-and-expressions ] - declaration: + delimiters: + - include: comment-no-pop - match: \s*(,) captures: 1: punctuation.definition.object.js.fjsx15 + push: statements-and-expressions - match: \s*(}) captures: 1: punctuation.definition.object.end.js.fjsx15 pop: true + + statements-and-expressions: + - include: comment-no-pop + - match: (?=\s*[,}]) + pop: true + # Spread. + - include: Packages/Naomi/syntaxes/fjsx15/operator/spread.sublime-syntax + # Method. + - include: Packages/Naomi/syntaxes/fjsx15/class/method.sublime-syntax # Simple constant. - match: | (?x)\s* (?={{constantIdentifier}}\s*(?>,|}|$)) - push: constant + set: constant # Simple variable. - match: | (?xi)\s* (?={{commonIdentifier}}\s*(?>,|}|$)) - push: variable + set: variable # Property. - include: Packages/Naomi/syntaxes/fjsx15/literal/object/property.sublime-syntax - # - match: "" - # push: - # - match: (?=\s*(?>,|})) - # pop: true - # - include: comment - # - include: spread-operator - # # Associated value. - # - match: \s*(:) - # scope: >- - # object.js.fjsx15 - # keyword.operator.other.association.js.fjsx15 - # set: associated-value - # # Decorators. - # - include: Packages/Naomi/syntaxes/fjsx15/decorator.sublime-syntax - # # Methods. - # - include: Packages/Naomi/syntaxes/fjsx15/class/method.sublime-syntax - - # # Property. - # - include: Packages/Naomi/syntaxes/fjsx15/literal/object/property.sublime-syntax - # # Other expressions. - # - include: statement-and-expression - - associated-value: - - match: | - (?x) - (?=\s*(?>,|})) - pop: true - - match: "" - push: - - include: statement-and-expression - - match: "" - pop: true - - comment: - - include: Packages/Naomi/syntaxes/fjsx15/comment.sublime-syntax - - spread-operator: - - include: Packages/Naomi/syntaxes/fjsx15/operator/spread.sublime-syntax - - statement-and-expression: - - match: lol - scope: lol - # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + comment-no-pop: + - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax constant: - include: Packages/Naomi/syntaxes/fjsx15/constant.sublime-syntax diff --git a/syntaxes/fjsx15/literal/object/property.sublime-syntax b/syntaxes/fjsx15/literal/object/property.sublime-syntax index d055b001..6f8769e1 100644 --- a/syntaxes/fjsx15/literal/object/property.sublime-syntax +++ b/syntaxes/fjsx15/literal/object/property.sublime-syntax @@ -26,27 +26,166 @@ variables: [$_[:upper:]] [$_[:upper:][:digit:]]* + indexer: | + (\[ + [^\[\]]* + \g<-1>? + [^\[\]]* + \]) + + methodIdentifier: | + (?> '.*?(?]* + \g<-1>? + [^<>]* + >) + + templateParameters: "{{templateArguments}}" + + parameters: | + (\( + [^()]* + \g<-1>? + [^()]* + \)) + + flowOperators: | + (?> &(?!&) + | \|(?!\|) + ) + + string: | + (?> '.*?' + | ".*?" + | `.*` + ) + + simpleFlowType: | + (?> {{string}} + | {{commonIdentifier}} + {{templateArguments}}? + ) + + flowFunction: | + ( + {{parameters}} + \s*=>\s* + (?> {{simpleFlowType}} + | \g<-2> + ) + ) + + complexType: | + ( + \??\s* + (?> {{simpleFlowType}} + | {{flowFunction}} + ) + \s*{{flowOperators}}? + \s*\g<-5>? + ) + + flowComment: /\*\s*:.*?\*/ + + type: | + (?> {{flowComment}} + | :{{complexType}} + ) + contexts: main: - # # Computed property name. - # - match: \s*(\[) - # captures: - # 1: punctuation.definition.object.computed-property.begin.js.fjsx15 - # push: [ - # associated-value, - # computed-property - # ] - # # Other property formats. - # - include: string - # - include: constant + # Function assigned to property. + - match: | + (?xi) + (?= + \s*{{commonIdentifier}} + \s*: + (?:\s*async\b)? + \s*function + ) + set: [ + function-declaration, + function-keyword, + method-identifier + ] + # Single parameter arrow function assigned to property. + - match: | + (?xi) + (?= + \s*{{commonIdentifier}} + \s*: + (?:\s*async\b)? + \s*{{commonIdentifier}} + \s*{{type}}? + \s*=> + ) + set: [ + arrow-function, + method-identifier + ] + # Arrow function assigned to property. + - match: | + (?xi) + (?= + \s*{{commonIdentifier}} + \s*: + (?:\s*async\b)? + \s*{{templateParameters}}? + \s*{{parameters}} + \s*=> + ) + set: [ + arrow-function, + method-identifier + ] + # Computed property name. + - match: \s*(\[) + captures: + 1: punctuation.definition.object.computed-property.begin.js.fjsx15 + set: [ + associated-value, + computed-property-end, + optional-expression + ] + # String. + - match: (?=\s*['"`]) + set: [ associated-value, string ] + # Simple property. + - include: constant - include: variable - computed-property: + method-identifier: + - match: | + (?xi) + \s*({{commonIdentifier}}) + \s*(:) + captures: + 1: entity.name.function.js.fjsx15 + 2: punctuation.definition.function.js.fjsx15 + pop: true + + arrow-function: + - include: Packages/Naomi/syntaxes/fjsx15/arrow-function.sublime-syntax + + function-keyword: + - include: Packages/Naomi/syntaxes/fjsx15/function.sublime-syntax#keyword + + function-declaration: + - include: Packages/Naomi/syntaxes/fjsx15/function.sublime-syntax#declaration + + computed-property-end: - match: \s*(\]) captures: 1: punctuation.definition.object.computed-property.end.js.fjsx15 pop: true - - include: expression string: - include: Packages/Naomi/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax @@ -62,7 +201,7 @@ contexts: 1: >- object.property.js.fjsx15 entity.name.constant.js.fjsx15 - push: associated-value + set: associated-value # Two or more characters. - match: | (?x)\s* @@ -76,20 +215,20 @@ contexts: 1: >- object.property.js.fjsx15 entity.name.constant.js.fjsx15 - push: associated-value + set: associated-value variable: # Single character. - # - match: | - # (?xi)\s* - # ((?> \$\B - # | [_[:alpha:]]\b - # )) - # captures: - # 1: >- - # object.property.js.fjsx15 - # entity.name.variable.js.fjsx15 - # push: associated-value + - match: | + (?xi)\s* + ((?> \$\B + | [_[:alpha:]]\b + )) + captures: + 1: >- + object.property.js.fjsx15 + entity.name.variable.js.fjsx15 + set: associated-value # Two or more characters. - match: | (?xi)\s* @@ -103,14 +242,15 @@ contexts: 1: >- object.property.js.fjsx15 entity.name.variable.js.fjsx15 - push: associated-value + set: associated-value - expression: - - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax + optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax associated-value: - match: \s*(:) - scope: >- - object.js.fjsx15 - keyword.operator.other.association.js.fjsx15 - set: expression + captures: + 1: >- + object.js.fjsx15 + keyword.operator.other.association.js.fjsx15 + set: optional-expression From e92223f06e75c0a56742b1666f31a25496c68f59 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 16 Dec 2017 12:04:38 -0200 Subject: [PATCH 187/407] [FJSX15] Restore class body --- syntaxes/fjsx15/class/body.sublime-syntax | 18 ++- syntaxes/fjsx15/class/method.sublime-syntax | 30 ----- syntaxes/fjsx15/class/modifier.sublime-syntax | 58 +++++++++ syntaxes/fjsx15/class/property.sublime-syntax | 115 ++++-------------- 4 files changed, 95 insertions(+), 126 deletions(-) create mode 100644 syntaxes/fjsx15/class/modifier.sublime-syntax diff --git a/syntaxes/fjsx15/class/body.sublime-syntax b/syntaxes/fjsx15/class/body.sublime-syntax index da887652..8155ade3 100644 --- a/syntaxes/fjsx15/class/body.sublime-syntax +++ b/syntaxes/fjsx15/class/body.sublime-syntax @@ -23,14 +23,28 @@ contexts: - match: \s*(\{) captures: 1: punctuation.definition.class.body.begin.js.fjsx15 - set: body + set: [ body-end, statements-and-expressions ] - body: + body-end: - include: comment-no-pop + - match: \s*(?>(,)|(;)) + captures: + 1: punctuation.definition.object.js.fjsx15 + 2: keyword.other.terminator.js.fjsx15 + push: statements-and-expressions - match: \s*(}) captures: 1: punctuation.definition.class.body.end.js.fjsx15 pop: true + - match: (?=\s*\S) + push: statements-and-expressions + + statements-and-expressions: + - include: comment-no-pop + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/indexer.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/class/modifier.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/class/method.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/class/property.sublime-syntax # - match: "" # push: # # This is necessary because normally these instance variables would be diff --git a/syntaxes/fjsx15/class/method.sublime-syntax b/syntaxes/fjsx15/class/method.sublime-syntax index 6aac7799..3ac6c0a4 100644 --- a/syntaxes/fjsx15/class/method.sublime-syntax +++ b/syntaxes/fjsx15/class/method.sublime-syntax @@ -46,11 +46,6 @@ variables: contexts: main: - - match: | - (?xi) - (?=\s*(?>\#|\*|async|get|set|static)) - set: declaration - # Normal method. - match: | (?xi) (?= @@ -60,33 +55,8 @@ contexts: ) set: declaration - modifiers: - - match: \s*(\#|static) - captures: - 1: >- - storage.modifier.js.fjsx15 - keyword.other.access.js.fjsx15 - - match: \s*(async)\b - captures: - 1: >- - storage.modifier.js.fjsx15 - keyword.other.async.js.fjsx15 - - match: | - (?xi)\s* - (get|set)\b - captures: - 1: >- - storage.modifier.js.fjsx15 - keyword.other.proxy.js.fjsx15 - - match: \s*(\*)\b - captures: - 1: >- - storage.modifier.js.fjsx15 - keyword.operator.other.generator.js.fjsx15 - declaration: - include: comment-no-pop - - include: modifiers # Body. - match: (?=\s*\{) set: body diff --git a/syntaxes/fjsx15/class/modifier.sublime-syntax b/syntaxes/fjsx15/class/modifier.sublime-syntax new file mode 100644 index 00000000..f0ed2110 --- /dev/null +++ b/syntaxes/fjsx15/class/modifier.sublime-syntax @@ -0,0 +1,58 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +contexts: + main: + - match: \s*(\#|static) + captures: + 1: >- + storage.modifier.js.fjsx15 + keyword.other.access.js.fjsx15 + set: property-or-method + - match: \s*(async)\b + captures: + 1: >- + storage.modifier.js.fjsx15 + keyword.other.async.js.fjsx15 + set: method-declaration + - match: | + (?xi)\s* + (get|set)\b + captures: + 1: >- + storage.modifier.js.fjsx15 + keyword.other.proxy.js.fjsx15 + set: method-declaration + - match: \s*(\*) + captures: + 1: >- + storage.modifier.js.fjsx15 + keyword.operator.other.generator.js.fjsx15 + set: method-declaration + + property-or-method: + - include: comment-no-pop + - include: Packages/Naomi/syntaxes/fjsx15/class/method.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/class/property.sublime-syntax + + method-declaration: + - include: Packages/Naomi/syntaxes/fjsx15/class/method.sublime-syntax#declaration + + comment-no-pop: + - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax diff --git a/syntaxes/fjsx15/class/property.sublime-syntax b/syntaxes/fjsx15/class/property.sublime-syntax index ffac71ff..4800f87f 100644 --- a/syntaxes/fjsx15/class/property.sublime-syntax +++ b/syntaxes/fjsx15/class/property.sublime-syntax @@ -22,112 +22,39 @@ variables: [$_[:alpha:]] [$_[:alnum:]]* - templateArguments: | - (< - [^<>]* - \g<-1>? - [^<>]* - >) - - parameters: | - (\( - [^()]* - \g<-1>? - [^()]* - \)) - - flowOperators: | - (?> &(?!&) - | \|(?!\|) - ) - - string: | - (?> '.*?' - | ".*?" - | `.*` - ) - - simpleFlowType: | - (?> {{string}} - | {{commonIdentifier}} - {{templateArguments}}? - ) - - flowFunction: | - ( - {{parameters}} - \s*=>\s* - (?> {{simpleFlowType}} - | \g<-2> - ) - ) - - complexType: | - ( - \??\s* - (?> {{simpleFlowType}} - | {{flowFunction}} - ) - \s*{{flowOperators}}? - \s*\g<-5>? - ) - - flowComment: /\*\s*:.*?\*/ - - flowType: | - (?> {{flowComment}} - | (?::{{complexType}}) - ) - contexts: main: - # Static variables. - - match: | - (?xi)\s* - (static) - (?= - \s+{{commonIdentifier}} - (\s*{{flowType}})? - ) - captures: - 1: >- - storage.modifier.js.fjsx15 - keyword.other.access.js.fjsx15 - set: declaration - # Normal variable. - match: | (?xi) - (?= - \s+{{commonIdentifier}} - (\s*{{flowType}})? - ) - set: declaration + (?=\s*{{commonIdentifier}}) + set: [ + optional-type-and-value, + identifier + ] - declaration: - # - include: terminator - - match: (?=\s*$) + identifier: + - include: Packages/Naomi/syntaxes/fjsx15/constant.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/variable.sublime-syntax + + optional-type-and-value: + - match: (?=\s*=) + set: optional-expression + - match: (?=\s*\S) pop: true + # - include: terminator + # - match: (?=\s*$) + # pop: true # Type. - match: (?=\s*:) - push: type + push: associated-type # Value. - - match: (?=\s*=) - pop: true - # Identifier. - - match: | - (?xi) - (?=\s* - {{commonIdentifier}} - ) - push: - - include: Packages/Naomi/syntaxes/fjsx15/constant.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/variable.sublime-syntax - type: + + associated-type: - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax # terminator: # - include: Packages/Naomi/syntaxes/fjsx15/operator/terminator.sublime-syntax - # statement-and-expression: - # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax From dc2dec19d35869c27242cc04391f476f91d95460 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 16 Dec 2017 12:04:50 -0200 Subject: [PATCH 188/407] [FJSX15] Remove dead code --- .../flowtype/type-expression.sublime-syntax | 21 ------------------- 1 file changed, 21 deletions(-) diff --git a/syntaxes/fjsx15/flowtype/type-expression.sublime-syntax b/syntaxes/fjsx15/flowtype/type-expression.sublime-syntax index 94d28c85..9a7fe0ed 100644 --- a/syntaxes/fjsx15/flowtype/type-expression.sublime-syntax +++ b/syntaxes/fjsx15/flowtype/type-expression.sublime-syntax @@ -18,27 +18,6 @@ hidden: true scope: ... variables: - # commonIdentifier: | - # [$_[:alpha:]] - # [$_[:alnum:]]* - - # templateArguments: | - # (< - # [^<>]* - # \g<-1>? - # [^<>]* - # >) - - # parameters: | - # (\( - # [^()]* - # \g<-1>? - # [^()]* - # \)) - - # flowFunction: | - # {{parameters}} - # \s*=>\s* expressionGroupBegin: \s*(\() expressionBegin: (?=\s*\S) From f2fdcff379b9600b33118d0cff48eb26e96bea73 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 16 Dec 2017 12:05:07 -0200 Subject: [PATCH 189/407] [FJSX15] Restore indexer --- .../fjsx15/flowtype/indexer.sublime-syntax | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 syntaxes/fjsx15/flowtype/indexer.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/indexer.sublime-syntax b/syntaxes/fjsx15/flowtype/indexer.sublime-syntax new file mode 100644 index 00000000..edc00c55 --- /dev/null +++ b/syntaxes/fjsx15/flowtype/indexer.sublime-syntax @@ -0,0 +1,82 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + +contexts: + main: + - match: \s*(\[) + captures: + 1: >- + flowtype + punctuation.definition.object.indexer.flowtype + set: [ indexer-end, optional-name ] + + indexer-end: + - match: \s*(]) + captures: + 1: >- + flowtype + punctuation.definition.object.indexer.flowtype + set: optional-associated-type + + type-expression: + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type-expression.sublime-syntax + + optional-associated-type: + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-associated-type.sublime-syntax + + optional-name: + - include: comment-no-pop + # Named indexers are similar to function’s parameters. + - match: | + (?xi)\s* + ({{commonIdentifier}})(\?)? + (?=\s*:) + captures: + 1: >- + function.parameter.js.fjsx15 + entity.name.variable.js.fjsx15 + 2: >- + flowtype + keyword.operator.other.optional.flowtype + set: associated-type + # Strings. + - match: (?=\s*(?>'|"|`)) + set: [ + associated-type, + string + ] + # Other type expressions. + - match: (?=\s*\S) + set: type-expression + + string: + - include: Packages/Naomi/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/literal/string/template.sublime-syntax + + associated-type: + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax + + comment-no-pop: + - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax From d48ad7324bcbed53ab3390eb8f609075ffe1ae72 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 16 Dec 2017 12:05:16 -0200 Subject: [PATCH 190/407] [FJSX15] Simplify object literal --- syntaxes/fjsx15/literal/object.sublime-syntax | 1 + 1 file changed, 1 insertion(+) diff --git a/syntaxes/fjsx15/literal/object.sublime-syntax b/syntaxes/fjsx15/literal/object.sublime-syntax index af651210..89a7d1b5 100644 --- a/syntaxes/fjsx15/literal/object.sublime-syntax +++ b/syntaxes/fjsx15/literal/object.sublime-syntax @@ -50,6 +50,7 @@ contexts: # Spread. - include: Packages/Naomi/syntaxes/fjsx15/operator/spread.sublime-syntax # Method. + - include: Packages/Naomi/syntaxes/fjsx15/class/modifier.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/class/method.sublime-syntax # Simple constant. - match: | From e1cd2f963ca1fa127c1d898713c455b2902e63f3 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 16 Dec 2017 12:10:29 -0200 Subject: [PATCH 191/407] [FJSX15] Restore decorators --- syntaxes/fjsx15/class/body.sublime-syntax | 1 + .../fjsx15/decorator/arguments.sublime-syntax | 19 +++++++++---------- syntaxes/fjsx15/statement.sublime-syntax | 1 + 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/syntaxes/fjsx15/class/body.sublime-syntax b/syntaxes/fjsx15/class/body.sublime-syntax index 8155ade3..dc772762 100644 --- a/syntaxes/fjsx15/class/body.sublime-syntax +++ b/syntaxes/fjsx15/class/body.sublime-syntax @@ -42,6 +42,7 @@ contexts: statements-and-expressions: - include: comment-no-pop - include: Packages/Naomi/syntaxes/fjsx15/flowtype/indexer.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/decorator.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/class/modifier.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/class/method.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/class/property.sublime-syntax diff --git a/syntaxes/fjsx15/decorator/arguments.sublime-syntax b/syntaxes/fjsx15/decorator/arguments.sublime-syntax index 4ef49809..58590979 100644 --- a/syntaxes/fjsx15/decorator/arguments.sublime-syntax +++ b/syntaxes/fjsx15/decorator/arguments.sublime-syntax @@ -22,18 +22,17 @@ contexts: - match: \s*(\() captures: 1: punctuation.definition.decorator.arguments.begin.js.fjsx15 - set: arguments + set: [ delimiters, optional-expression ] - arguments: + delimiters: + - match: \s*(\,) + captures: + 1: punctuation.definition.decorator.arguments.js.fjsx15 + push: optional-expression - match: \s*(\)) captures: 1: punctuation.definition.decorator.arguments.end.js.fjsx15 pop: true - - match: \s*(\,) - captures: - 1: punctuation.definition.decorator.arguments.js.fjsx15 - - match: "" - push: - # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax - - match: "" - pop: true + + optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/statement.sublime-syntax b/syntaxes/fjsx15/statement.sublime-syntax index bb5d9aca..44e44e94 100644 --- a/syntaxes/fjsx15/statement.sublime-syntax +++ b/syntaxes/fjsx15/statement.sublime-syntax @@ -25,6 +25,7 @@ variables: contexts: main: - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type-aliasing.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/decorator.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/class.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/variable-declaration.sublime-syntax From a397dd6f3c6fd19a2ec5e076be34384cbeb46864 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 16 Dec 2017 12:22:49 -0200 Subject: [PATCH 192/407] [FJSX15] Add modifier trap --- syntaxes/fjsx15/class/modifier.sublime-syntax | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/syntaxes/fjsx15/class/modifier.sublime-syntax b/syntaxes/fjsx15/class/modifier.sublime-syntax index f0ed2110..8ac772f6 100644 --- a/syntaxes/fjsx15/class/modifier.sublime-syntax +++ b/syntaxes/fjsx15/class/modifier.sublime-syntax @@ -19,18 +19,27 @@ scope: ... contexts: main: - - match: \s*(\#|static) + - include: modifiers + + modifiers: + - match: \s*(static) captures: 1: >- storage.modifier.js.fjsx15 keyword.other.access.js.fjsx15 - set: property-or-method + set: modifier-trap + - match: \s*(\#) + captures: + 1: >- + storage.modifier.js.fjsx15 + keyword.other.access.js.fjsx15 + set: modifier-trap - match: \s*(async)\b captures: 1: >- storage.modifier.js.fjsx15 keyword.other.async.js.fjsx15 - set: method-declaration + set: modifier-trap - match: | (?xi)\s* (get|set)\b @@ -38,13 +47,18 @@ contexts: 1: >- storage.modifier.js.fjsx15 keyword.other.proxy.js.fjsx15 - set: method-declaration + set: modifier-trap - match: \s*(\*) captures: 1: >- storage.modifier.js.fjsx15 keyword.operator.other.generator.js.fjsx15 - set: method-declaration + set: modifier-trap + + modifier-trap: + - include: modifiers + - match: (?=\s*\S) + set: property-or-method property-or-method: - include: comment-no-pop From 7f393a8619917e837aab6e86f12fe6f6821cf707 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 16 Dec 2017 12:31:43 -0200 Subject: [PATCH 193/407] [FJSX15] Simplify class properties --- syntaxes/fjsx15/class/property.sublime-syntax | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/syntaxes/fjsx15/class/property.sublime-syntax b/syntaxes/fjsx15/class/property.sublime-syntax index 4800f87f..27a3932e 100644 --- a/syntaxes/fjsx15/class/property.sublime-syntax +++ b/syntaxes/fjsx15/class/property.sublime-syntax @@ -37,24 +37,18 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/variable.sublime-syntax optional-type-and-value: - - match: (?=\s*=) - set: optional-expression - - match: (?=\s*\S) - pop: true - # - include: terminator - # - match: (?=\s*$) - # pop: true # Type. - match: (?=\s*:) push: associated-type # Value. - + - match: (?=\s*=) + set: optional-expression + # Anything else. + - match: (?=\s*\S) + pop: true associated-type: - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax - # terminator: - # - include: Packages/Naomi/syntaxes/fjsx15/operator/terminator.sublime-syntax - optional-expression: - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax From e3421564791ae04ddb89ca23903f8895f7771478 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 16 Dec 2017 13:43:04 -0200 Subject: [PATCH 194/407] [FJSX15] Simplify expressions --- syntaxes/fjsx15/arrow-function/body.sublime-syntax | 4 +--- syntaxes/fjsx15/operator.sublime-syntax | 2 +- syntaxes/fjsx15/operator/assignment.sublime-syntax | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/syntaxes/fjsx15/arrow-function/body.sublime-syntax b/syntaxes/fjsx15/arrow-function/body.sublime-syntax index 98cdb5b6..fdf561bf 100644 --- a/syntaxes/fjsx15/arrow-function/body.sublime-syntax +++ b/syntaxes/fjsx15/arrow-function/body.sublime-syntax @@ -19,9 +19,7 @@ scope: ... contexts: main: - - match: | - (?x) - \s*(=>) + - match: \s*(=>) captures: 1: >- arrow.js.fjsx15 diff --git a/syntaxes/fjsx15/operator.sublime-syntax b/syntaxes/fjsx15/operator.sublime-syntax index 06d4e93a..ae176e5b 100644 --- a/syntaxes/fjsx15/operator.sublime-syntax +++ b/syntaxes/fjsx15/operator.sublime-syntax @@ -23,6 +23,7 @@ contexts: # detect its body as if it were an operator. - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/body.sublime-syntax # Actual operators. + - include: Packages/Naomi/syntaxes/fjsx15/operator/pipe.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/arithmetic.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/assignment.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/await.sublime-syntax @@ -34,7 +35,6 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/operator/new.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/of.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/other.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/operator/pipe.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/relational.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/shebang.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/spread.sublime-syntax diff --git a/syntaxes/fjsx15/operator/assignment.sublime-syntax b/syntaxes/fjsx15/operator/assignment.sublime-syntax index 01af92fe..0b6e8232 100644 --- a/syntaxes/fjsx15/operator/assignment.sublime-syntax +++ b/syntaxes/fjsx15/operator/assignment.sublime-syntax @@ -19,7 +19,7 @@ scope: ... contexts: main: - - match: \s*(=)(?!\s*[=>]) + - match: \s*(=) captures: 1: keyword.operator.other.assignment.js.fjsx15 set: optional-expression From 3b141a4aae90d3740332f6e5da7117daf2f16976 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 16 Dec 2017 13:43:17 -0200 Subject: [PATCH 195/407] [FJXS15] Restore import export --- syntaxes/fjsx15/statement.sublime-syntax | 2 ++ 1 file changed, 2 insertions(+) diff --git a/syntaxes/fjsx15/statement.sublime-syntax b/syntaxes/fjsx15/statement.sublime-syntax index 44e44e94..a25fcdb3 100644 --- a/syntaxes/fjsx15/statement.sublime-syntax +++ b/syntaxes/fjsx15/statement.sublime-syntax @@ -26,6 +26,8 @@ contexts: main: - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type-aliasing.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/decorator.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/import.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/export.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/class.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/variable-declaration.sublime-syntax From 7ecbcfd54f165f7f4a91e01c2a41129a85ea51cb Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 16 Dec 2017 13:43:40 -0200 Subject: [PATCH 196/407] [FJSX15] Rename context for consistency --- syntaxes/fjsx15/import.sublime-syntax | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/syntaxes/fjsx15/import.sublime-syntax b/syntaxes/fjsx15/import.sublime-syntax index c428e441..55093c40 100644 --- a/syntaxes/fjsx15/import.sublime-syntax +++ b/syntaxes/fjsx15/import.sublime-syntax @@ -59,7 +59,7 @@ contexts: header: - include: Packages/Naomi/syntaxes/fjsx15/statement/header.sublime-syntax - comment: + comment-no-pop: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax function-arguments: @@ -88,7 +88,7 @@ contexts: 1: punctuation.definition.import.item.js.fjsx15 targets: - - include: comment + - include: comment-no-pop - include: origin - include: punctuation - match: "" From 844613f330cea67c6180c69e85736e4ee6f7951a Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 16 Dec 2017 13:43:57 -0200 Subject: [PATCH 197/407] [FJSX15] Simplify pipe --- syntaxes/fjsx15/operator/pipe.sublime-syntax | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/syntaxes/fjsx15/operator/pipe.sublime-syntax b/syntaxes/fjsx15/operator/pipe.sublime-syntax index 5c9614be..7d94a5fb 100644 --- a/syntaxes/fjsx15/operator/pipe.sublime-syntax +++ b/syntaxes/fjsx15/operator/pipe.sublime-syntax @@ -30,11 +30,9 @@ contexts: set: function-or-expression function-or-expression: - # - include: Packages/Naomi/syntaxes/fjsx15/arrow-function.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/arrow-function.sublime-syntax # Await keyword. - - match: | - (?x)\s* - (await)\b + - match: \s*(await)\b captures: 1: keyword.control.js.fjsx15 pop: true @@ -46,4 +44,5 @@ contexts: 1: entity.name.function.js.fjsx15 pop: true # Other expressions. - - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax + - match: (?=\s*\S) + pop: true From 4ab6b16e08b2a21a1fe0ef7ec44d8087949ec504 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 16 Dec 2017 13:49:39 -0200 Subject: [PATCH 198/407] [FJSX15] Restore react class properties --- syntaxes/fjsx15/class/body.sublime-syntax | 35 ++--------------------- syntaxes/fjsx15/react-js.sublime-syntax | 17 ++++++++++- 2 files changed, 18 insertions(+), 34 deletions(-) diff --git a/syntaxes/fjsx15/class/body.sublime-syntax b/syntaxes/fjsx15/class/body.sublime-syntax index dc772762..37db6ae6 100644 --- a/syntaxes/fjsx15/class/body.sublime-syntax +++ b/syntaxes/fjsx15/class/body.sublime-syntax @@ -41,44 +41,13 @@ contexts: statements-and-expressions: - include: comment-no-pop + - include: Packages/Naomi/syntaxes/fjsx15/react-js.sublime-syntax#class-properties + - include: Packages/Naomi/syntaxes/fjsx15/react-js.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/flowtype/indexer.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/decorator.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/class/modifier.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/class/method.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/class/property.sublime-syntax - # - match: "" - # push: - # # This is necessary because normally these instance variables would be - # # accessed using “this” but in the class body we can use the short version. - # - match: | - # (?x)\s* - # ((?> props - # | state - # ))\b - # captures: - # 1: >- - # support.core.js.fjsx15 - # entity.name.variable.js.fjsx15 - # 2: keyword.operator.other.member-access.js.fjsx15 - # 3: >- - # support.lib.react-js.fjsx15 - # entity.name.variable.js.fjsx15 - # pop: true - # - include: Packages/Naomi/syntaxes/fjsx15/comment.sublime-syntax - # - include: Packages/Naomi/syntaxes/fjsx15/operator/comma.sublime-syntax - # React’s variables (state, contextTypes, etc...). - # - include: Packages/Naomi/syntaxes/fjsx15/react-js.sublime-syntax - # Any methods (including supporting libraries’ methods). - # - include: Packages/Naomi/syntaxes/fjsx15/class/method.sublime-syntax - # Flow fields and indexers. - # - include: Packages/Naomi/syntaxes/fjsx15/flowtype/field.sublime-syntax - # - include: Packages/Naomi/syntaxes/fjsx15/flowtype/indexer.sublime-syntax - # Class variables. - # - include: Packages/Naomi/syntaxes/fjsx15/class/property.sublime-syntax - # Any other statement or expression. - # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax - # - match: "" - # pop: true comment-no-pop: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax diff --git a/syntaxes/fjsx15/react-js.sublime-syntax b/syntaxes/fjsx15/react-js.sublime-syntax index 63de7352..430948b1 100644 --- a/syntaxes/fjsx15/react-js.sublime-syntax +++ b/syntaxes/fjsx15/react-js.sublime-syntax @@ -28,6 +28,21 @@ contexts: arguments: - include: Packages/Naomi/syntaxes/fjsx15/function-call/support/react-js-arguments.sublime-syntax + optional-property-type-and-value: + - include: Packages/Naomi/syntaxes/fjsx15/class/property.sublime-syntax#optional-type-and-value + + class-properties: + - match: | + (?x)\s* + ((?> props + | state + ))\b + captures: + 1: >- + support.core.js.fjsx15 + entity.name.variable.js.fjsx15 + set: optional-property-type-and-value + instance-variables: - match: | (?x)\s* @@ -64,7 +79,7 @@ contexts: 2: >- support.lib.react-js.fjsx15 entity.name.variable.js.fjsx15 - pop: true + set: optional-property-type-and-value proptypes: # Function call. From 4cdd70d67258b85e86d5f11e404c883a365417cd Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 16 Dec 2017 14:06:53 -0200 Subject: [PATCH 199/407] [FJSX15] Fix methods optional body --- syntaxes/fjsx15/class/body.sublime-syntax | 6 ++++-- syntaxes/fjsx15/class/method.sublime-syntax | 14 +++++++++++--- syntaxes/fjsx15/class/modifier.sublime-syntax | 2 +- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/syntaxes/fjsx15/class/body.sublime-syntax b/syntaxes/fjsx15/class/body.sublime-syntax index 37db6ae6..535088ff 100644 --- a/syntaxes/fjsx15/class/body.sublime-syntax +++ b/syntaxes/fjsx15/class/body.sublime-syntax @@ -41,13 +41,15 @@ contexts: statements-and-expressions: - include: comment-no-pop - - include: Packages/Naomi/syntaxes/fjsx15/react-js.sublime-syntax#class-properties - - include: Packages/Naomi/syntaxes/fjsx15/react-js.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/flowtype/indexer.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/decorator.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/react-js.sublime-syntax#class-properties + - include: Packages/Naomi/syntaxes/fjsx15/react-js.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/class/modifier.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/class/method.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/class/property.sublime-syntax + - match: (?=\s*\S) + pop: true comment-no-pop: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax diff --git a/syntaxes/fjsx15/class/method.sublime-syntax b/syntaxes/fjsx15/class/method.sublime-syntax index 3ac6c0a4..a6cdc3b0 100644 --- a/syntaxes/fjsx15/class/method.sublime-syntax +++ b/syntaxes/fjsx15/class/method.sublime-syntax @@ -65,7 +65,10 @@ contexts: push: template-parameters # Parameters. - match: (?=\s*\() - push: parameters + set: [ + optional-body, + parameters + ] # Support identifier. - match: | (?x) @@ -75,7 +78,7 @@ contexts: support.js.fjsx15 entity.name.function.js.fjsx15 set: [ - support-body, + optional-support-body, support-parameters ] # React JS’s support methods. @@ -115,7 +118,12 @@ contexts: body: - include: Packages/Naomi/syntaxes/fjsx15/function/body.sublime-syntax - support-body: + optional-body: + - include: body + - match: (?=\s*\S) + pop: true + + optional-support-body: - include: Packages/Naomi/syntaxes/fjsx15/function/support/body.sublime-syntax - match: (?=\s*\S) pop: true diff --git a/syntaxes/fjsx15/class/modifier.sublime-syntax b/syntaxes/fjsx15/class/modifier.sublime-syntax index 8ac772f6..088795c5 100644 --- a/syntaxes/fjsx15/class/modifier.sublime-syntax +++ b/syntaxes/fjsx15/class/modifier.sublime-syntax @@ -22,7 +22,7 @@ contexts: - include: modifiers modifiers: - - match: \s*(static) + - match: \s*(static)\b captures: 1: >- storage.modifier.js.fjsx15 From a08f2e86c611e05c8c18ffdd3473679aafefa1de Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 16 Dec 2017 14:21:57 -0200 Subject: [PATCH 200/407] [FJSX15] Add declare statement --- .../fjsx15/flowtype/declare.sublime-syntax | 54 +++++++++++++++ .../fjsx15/flowtype/module.sublime-syntax | 68 +++++++++++++++++++ syntaxes/fjsx15/statement.sublime-syntax | 1 + 3 files changed, 123 insertions(+) create mode 100644 syntaxes/fjsx15/flowtype/declare.sublime-syntax create mode 100644 syntaxes/fjsx15/flowtype/module.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/declare.sublime-syntax b/syntaxes/fjsx15/flowtype/declare.sublime-syntax new file mode 100644 index 00000000..10e50db8 --- /dev/null +++ b/syntaxes/fjsx15/flowtype/declare.sublime-syntax @@ -0,0 +1,54 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +contexts: + main: + - match: \s*(declare)\b + captures: + 1: >- + flowtype + keyword.declaration.js.fjsx15 + set: possible-module + + possible-module: + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/module.sublime-syntax + - match: (?=\s*\S) + pop: true + # - include: Packages/Naomi/syntaxes/fjsx15/flowtype/module.sublime-syntax + # # Export object literal. + # - match: | + # (?x) + # \s*(export) + # \s*(default) + # (?=\s*{) + # captures: + # 1: keyword.control.export.js.fjsx15 + # 2: >- + # storage.modifier.js.fjsx15 + # keyword.control.export.default.js.fjsx15 + # set: flow-object + # # Norma export. + # - include: Packages/Naomi/syntaxes/fjsx15/export.sublime-syntax + # # Other statements and expected expressions. + # - include: Packages/Naomi/syntaxes/fjsx15/class.sublime-syntax + # - include: Packages/Naomi/syntaxes/fjsx15/function.sublime-syntax + # - include: Packages/Naomi/syntaxes/fjsx15/variable-declaration.sublime-syntax + + # flow-object: + # - include: Packages/Naomi/syntaxes/fjsx15/flowtype/object.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/module.sublime-syntax b/syntaxes/fjsx15/flowtype/module.sublime-syntax new file mode 100644 index 00000000..3824dc8d --- /dev/null +++ b/syntaxes/fjsx15/flowtype/module.sublime-syntax @@ -0,0 +1,68 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + +contexts: + main: + # Common JS module. + - match: (?=\s*module\s*.\s*exports) + set: [ + block, + association, + common-js-module + ] + # ES module. + - match: \s*(module) + captures: + 1: >- + flowtype + storage.type.flowtype + keyword.declaration.type-aliasing.flowtype + set: identifier + + common-js-module: + - include: Packages/Naomi/syntaxes/fjsx15/node-js.sublime-syntax#module + + association: + - match: \s*(:) + captures: + 1: >- + flowtype + keyword.operator.other.association.flowtype + pop: true + + block: + - include: Packages/Naomi/syntaxes/fjsx15/statement.sublime-syntax#block + + identifier: + - include: Packages/Naomi/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/literal/string/template.sublime-syntax + - match: | + (?xi)\a* + ({{commonIdentifier}}) + captures: + 1: >- + flowtype + entity.name.module.flowtype + pop: true diff --git a/syntaxes/fjsx15/statement.sublime-syntax b/syntaxes/fjsx15/statement.sublime-syntax index a25fcdb3..5226aa5c 100644 --- a/syntaxes/fjsx15/statement.sublime-syntax +++ b/syntaxes/fjsx15/statement.sublime-syntax @@ -24,6 +24,7 @@ variables: contexts: main: + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/declare.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type-aliasing.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/decorator.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/import.sublime-syntax From 84751d4b8acfbc3c14f5da734523c212913b59de Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 16 Dec 2017 14:22:13 -0200 Subject: [PATCH 201/407] [FJSX15] Remove dead code --- .../fjsx15/statement/bodied.sublime-syntax | 97 ------------ .../fjsx15/statement/hanging.sublime-syntax | 60 -------- .../fjsx15/statement/header.sublime-syntax | 43 ------ .../fjsx15/statement/label.sublime-syntax | 96 ------------ .../fjsx15/statement/simple.sublime-syntax | 140 ------------------ 5 files changed, 436 deletions(-) delete mode 100644 syntaxes/fjsx15/statement/bodied.sublime-syntax delete mode 100644 syntaxes/fjsx15/statement/hanging.sublime-syntax delete mode 100644 syntaxes/fjsx15/statement/header.sublime-syntax delete mode 100644 syntaxes/fjsx15/statement/label.sublime-syntax delete mode 100644 syntaxes/fjsx15/statement/simple.sublime-syntax diff --git a/syntaxes/fjsx15/statement/bodied.sublime-syntax b/syntaxes/fjsx15/statement/bodied.sublime-syntax deleted file mode 100644 index 348de0e0..00000000 --- a/syntaxes/fjsx15/statement/bodied.sublime-syntax +++ /dev/null @@ -1,97 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -contexts: - main: - # Body only. - - match: | - (?x)\s* - ((?> do - | else - | finally - | try - ))\b - captures: - 1: keyword.control.js.fjsx15 - set: optional-body - # Optional header. - - match: | - (?x)\s*\b - (catch)\b - captures: - 1: keyword.control.js.fjsx15 - set: [ - optional-body, - optional-header - ] - # Header and body. - - match: | - (?x)\s*\b - ((?> if - | elseif - | for - | while - | switch - ))\b - (?:\s+ - (await) - )? - captures: - 1: keyword.control.js.fjsx15 - 2: keyword.control.js.fjsx15 - set: [ - optional-body, - header - ] - - optional-header: - - match: (?=\s*\{) - pop: true - - match: (?=\s*\() - set: header - - header: - - include: Packages/Naomi/syntaxes/fjsx15/statement/header.sublime-syntax - - optional-body: - - match: (?=\s*(?>}|]|\))) - pop: true - # Regex right after header. - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/regex.sublime-syntax - # Body beginning. - - match: \s*(\{) - captures: - 1: punctuation.definition.control.body.begin.js.fjsx15 - set: body-content - # Other statements and expressions. - # - include: statement-and-expression - - body-content: - - match: \s*(}) - captures: - 1: punctuation.definition.control.body.end.js.fjsx15 - pop: true - - match: "" - push: - - match: (?=\s*}) - pop: true - # - include: statement-and-expression - - # statement-and-expression: - # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax diff --git a/syntaxes/fjsx15/statement/hanging.sublime-syntax b/syntaxes/fjsx15/statement/hanging.sublime-syntax deleted file mode 100644 index fb734671..00000000 --- a/syntaxes/fjsx15/statement/hanging.sublime-syntax +++ /dev/null @@ -1,60 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -contexts: - main: - - match: | - (?x)\s* - ((?> case - | default - ))\b - captures: - 1: keyword.control.js.fjsx15 - set: operator - - operator: - - match: \s*(:) - captures: - 1: keyword.operator.other.js.fjsx15 - set: optional-body - # - match: "" - # push: - # - include: statement-and-expression - - optional-body: - - match: \s*(\{) - captures: - 1: punctuation.definition.control.body.begin.js.fjsx15 - set: body-content - - match: (?=\S) - pop: true - - body-content: - - match: \s*(}) - captures: - 1: punctuation.definition.control.body.end.js.fjsx15 - pop: true - - match: "" - push: - - match: (?=\s*}) - pop: true - # - include: statement-and-expression - - # statement-and-expression: - # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax diff --git a/syntaxes/fjsx15/statement/header.sublime-syntax b/syntaxes/fjsx15/statement/header.sublime-syntax deleted file mode 100644 index c04593cc..00000000 --- a/syntaxes/fjsx15/statement/header.sublime-syntax +++ /dev/null @@ -1,43 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -contexts: - main: - - match: (?=\s*\() - set: header - - header: - - match: \s*(\() - captures: - 1: punctuation.definition.control.header.begin.js.fjsx15 - set: header-content - - header-content: - - match: \s*(\)) - captures: - 1: punctuation.definition.control.header.end.js.fjsx15 - pop: true - - match: "" - push: - - match: (?=\s*\)) - pop: true - # - include: statement-and-expression - - # statement-and-expression: - # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax diff --git a/syntaxes/fjsx15/statement/label.sublime-syntax b/syntaxes/fjsx15/statement/label.sublime-syntax deleted file mode 100644 index 32c9b60b..00000000 --- a/syntaxes/fjsx15/statement/label.sublime-syntax +++ /dev/null @@ -1,96 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - -contexts: - main: - - match: | - (?xi) - (?> ^ - | (?<=;) - )\s* - ({{commonIdentifier}}) - (? return - | throw - ))\b - captures: - 1: keyword.control.flow-break.js.fjsx15 - pop: true - - match: | - (?x)\s* - ((?> await - | default - | delete - ))\b - captures: - 1: keyword.control.js.fjsx15 - pop: true - - break-continue: - - match: | - (?x)\s* - ((?> break - | continue - ))\b - captures: - 1: keyword.control.flow-break.js.fjsx15 - set: optional-label - - optional-label: - - match: | - (?xi)\s* - ({{commonIdentifier}}) - (? \s*(\*) - | \b - ) - captures: - 1: keyword.control.js.fjsx15 - 2: >- - statement.modifier.js.fjsx15 - keyword.operator.other.generator.js.fjsx15 - pop: true From fc0eaf752a12af0acd23578eac6c256aceb7a9d1 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 16 Dec 2017 14:24:03 -0200 Subject: [PATCH 202/407] [FJSX15] Fix CommonJS module declaration --- syntaxes/fjsx15/flowtype/module.sublime-syntax | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/syntaxes/fjsx15/flowtype/module.sublime-syntax b/syntaxes/fjsx15/flowtype/module.sublime-syntax index 3824dc8d..413f218d 100644 --- a/syntaxes/fjsx15/flowtype/module.sublime-syntax +++ b/syntaxes/fjsx15/flowtype/module.sublime-syntax @@ -27,7 +27,7 @@ contexts: # Common JS module. - match: (?=\s*module\s*.\s*exports) set: [ - block, + object-literal, association, common-js-module ] @@ -51,8 +51,8 @@ contexts: keyword.operator.other.association.flowtype pop: true - block: - - include: Packages/Naomi/syntaxes/fjsx15/statement.sublime-syntax#block + object-literal: + - include: Packages/Naomi/syntaxes/fjsx15/literal/object.sublime-syntax identifier: - include: Packages/Naomi/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax From cdc7ee94bd534a841f1b436a3f689854ef30b8b4 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 16 Dec 2017 16:44:11 -0200 Subject: [PATCH 203/407] [FJSX15] Restore flow functions --- .../flowtype/function.no-pop.sublime-syntax | 50 ++++++++++++ .../fjsx15/flowtype/function.sublime-syntax | 76 +++++++++++++++++++ .../function/parameters.sublime-syntax | 51 +++++++++++++ .../function/parameters/simple.sublime-syntax | 42 ++++++++++ .../flowtype/type-expression.sublime-syntax | 5 ++ 5 files changed, 224 insertions(+) create mode 100644 syntaxes/fjsx15/flowtype/function.no-pop.sublime-syntax create mode 100644 syntaxes/fjsx15/flowtype/function.sublime-syntax create mode 100644 syntaxes/fjsx15/flowtype/function/parameters.sublime-syntax create mode 100644 syntaxes/fjsx15/flowtype/function/parameters/simple.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/function.no-pop.sublime-syntax b/syntaxes/fjsx15/flowtype/function.no-pop.sublime-syntax new file mode 100644 index 00000000..b4f048d3 --- /dev/null +++ b/syntaxes/fjsx15/flowtype/function.no-pop.sublime-syntax @@ -0,0 +1,50 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +variables: + templateArguments: | + (< + [^<>]* + \g<-1>? + [^<>]* + >) + + parameters: | + (\( + [^()]* + \g<-1>? + [^()]* + \)) + + flowFunction: | + {{parameters}} + \s*=>\s* + +contexts: + main: + - match: | + (?xi) + (?=\s* + {{templateArguments}}? + {{flowFunction}} + ) + push: declaration + + declaration: + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/function.sublime-syntax#declaration diff --git a/syntaxes/fjsx15/flowtype/function.sublime-syntax b/syntaxes/fjsx15/flowtype/function.sublime-syntax new file mode 100644 index 00000000..67e8658c --- /dev/null +++ b/syntaxes/fjsx15/flowtype/function.sublime-syntax @@ -0,0 +1,76 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +variables: + templateArguments: | + (< + [^<>]* + \g<-1>? + [^<>]* + >) + + parameters: | + (\( + [^()]* + \g<-1>? + [^()]* + \)) + + flowFunction: | + {{parameters}} + \s*=>\s* + +contexts: + main: + - match: | + (?xi) + (?=\s* + {{templateArguments}}? + {{flowFunction}} + ) + set: declaration + + declaration: + # Template parameters. + - match: (?=\s*<) + push: template-arguments + # Parameters. + - match: (?=\s*\() + set: [ + return, + parameters + ] + + template-arguments: + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/arguments.sublime-syntax + + parameters: + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/function/parameters.sublime-syntax + + return: + - match: \s*(=>) + captures: + 1: >- + flowtype + punctuation.definition.function.result.flowtype + set: optional-type-expression + + optional-type-expression: + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-type-expression.sublime-syntax + diff --git a/syntaxes/fjsx15/flowtype/function/parameters.sublime-syntax b/syntaxes/fjsx15/flowtype/function/parameters.sublime-syntax new file mode 100644 index 00000000..de037ff0 --- /dev/null +++ b/syntaxes/fjsx15/flowtype/function/parameters.sublime-syntax @@ -0,0 +1,51 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +contexts: + main: + - match: \s*(\() + captures: + 1: >- + flowtype + punctuation.definition.function.parameters.begin.flowtype + set: [ delimiters, optional-parameter ] + + delimiters: + - match: \s*(,) + captures: + 1: >- + flowtype + punctuation.definition.function.parameters.flowtype + push: optional-parameter + - match: \s*(\)) + captures: + 1: >- + flowtype + punctuation.definition.function.parameters.end.flowtype + pop: true + + optional-parameter: + # Rest. + - match: \s*(\.{3}) + captures: + 1: >- + flowtype + keyword.operator.other.rest.flowtype + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/function/parameters/simple.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-type-expression.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/function/parameters/simple.sublime-syntax b/syntaxes/fjsx15/flowtype/function/parameters/simple.sublime-syntax new file mode 100644 index 00000000..ebc8bff2 --- /dev/null +++ b/syntaxes/fjsx15/flowtype/function/parameters/simple.sublime-syntax @@ -0,0 +1,42 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + +contexts: + main: + - match: | + (?xi)\s* + ({{commonIdentifier}})(\?)? + (?=\s*:) + captures: + 1: >- + flowtype + function.parameter.js.fjsx15 + entity.name.variable.js.fjsx15 + 2: >- + flowtype + keyword.operator.other.optional.flowtype + set: optional-associated-type + + optional-associated-type: + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-associated-type.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/type-expression.sublime-syntax b/syntaxes/fjsx15/flowtype/type-expression.sublime-syntax index 9a7fe0ed..7d725534 100644 --- a/syntaxes/fjsx15/flowtype/type-expression.sublime-syntax +++ b/syntaxes/fjsx15/flowtype/type-expression.sublime-syntax @@ -24,6 +24,8 @@ variables: contexts: main: - include: comment-no-pop + # Functions need to be detected before expression groups. + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/function.sublime-syntax # Detect operators as soon as possible. - include: Packages/Naomi/syntaxes/fjsx15/flowtype/operator.sublime-syntax # Open new type expression group. @@ -45,6 +47,8 @@ contexts: open-group: - include: comment-no-pop + # Functions need to be detected before expression groups. + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/function.no-pop.sublime-syntax # Open new type expression group. - match: "{{expressionGroupBegin}}" captures: @@ -66,6 +70,7 @@ contexts: head: - include: comment-no-pop + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/function.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/flowtype/object.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/flowtype/tuple.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/literal/number.sublime-syntax From 7753d3dda63f9c56df4d5f167906e2110c911fa4 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 16 Dec 2017 17:35:56 -0200 Subject: [PATCH 204/407] [FJSX15] Allow properties to be marked as optional --- syntaxes/fjsx15/class/property.sublime-syntax | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/syntaxes/fjsx15/class/property.sublime-syntax b/syntaxes/fjsx15/class/property.sublime-syntax index 27a3932e..78f54b57 100644 --- a/syntaxes/fjsx15/class/property.sublime-syntax +++ b/syntaxes/fjsx15/class/property.sublime-syntax @@ -37,6 +37,11 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/variable.sublime-syntax optional-type-and-value: + - match: \s*(\?) + captures: + 1: >- + flowtype + keyword.operator.other.optional.flowtype # Type. - match: (?=\s*:) push: associated-type From 9209243b08f3b2323909ba8f32683be801a31ec2 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 16 Dec 2017 17:36:16 -0200 Subject: [PATCH 205/407] [FJSX15] Make type aliasing expressions optional --- syntaxes/fjsx15/flowtype/type-aliasing.sublime-syntax | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/syntaxes/fjsx15/flowtype/type-aliasing.sublime-syntax b/syntaxes/fjsx15/flowtype/type-aliasing.sublime-syntax index d6333db7..40fefcba 100644 --- a/syntaxes/fjsx15/flowtype/type-aliasing.sublime-syntax +++ b/syntaxes/fjsx15/flowtype/type-aliasing.sublime-syntax @@ -64,7 +64,7 @@ contexts: 1: >- flowtype keyword.operator.other.assignment.flowtype - set: type-expression + set: optional-type-expression - type-expression: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type-expression.sublime-syntax + optional-type-expression: + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-type-expression.sublime-syntax From 29202824e6ea29e4c744fe40ad7814c17ee6feb6 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 16 Dec 2017 18:51:29 -0200 Subject: [PATCH 206/407] [FJSX15] Add covariant and contravariant operators --- syntaxes/fjsx15/class/body.sublime-syntax | 2 ++ .../contravariant.no-pop.sublime-syntax | 26 +++++++++++++++++++ .../operator/covariant.no-pop.sublime-syntax | 26 +++++++++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 syntaxes/fjsx15/flowtype/operator/contravariant.no-pop.sublime-syntax create mode 100644 syntaxes/fjsx15/flowtype/operator/covariant.no-pop.sublime-syntax diff --git a/syntaxes/fjsx15/class/body.sublime-syntax b/syntaxes/fjsx15/class/body.sublime-syntax index 535088ff..729671b0 100644 --- a/syntaxes/fjsx15/class/body.sublime-syntax +++ b/syntaxes/fjsx15/class/body.sublime-syntax @@ -41,6 +41,8 @@ contexts: statements-and-expressions: - include: comment-no-pop + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/operator/covariant.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/operator/contravariant.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/flowtype/indexer.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/decorator.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/react-js.sublime-syntax#class-properties diff --git a/syntaxes/fjsx15/flowtype/operator/contravariant.no-pop.sublime-syntax b/syntaxes/fjsx15/flowtype/operator/contravariant.no-pop.sublime-syntax new file mode 100644 index 00000000..eb2882dc --- /dev/null +++ b/syntaxes/fjsx15/flowtype/operator/contravariant.no-pop.sublime-syntax @@ -0,0 +1,26 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +contexts: + main: + - match: \s*(-) + captures: + 1: >- + flowtype + keyword.operator.other.contravariant.flowtype diff --git a/syntaxes/fjsx15/flowtype/operator/covariant.no-pop.sublime-syntax b/syntaxes/fjsx15/flowtype/operator/covariant.no-pop.sublime-syntax new file mode 100644 index 00000000..15bff1a6 --- /dev/null +++ b/syntaxes/fjsx15/flowtype/operator/covariant.no-pop.sublime-syntax @@ -0,0 +1,26 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +contexts: + main: + - match: \s*(\+) + captures: + 1: >- + flowtype + keyword.operator.other.covariant.flowtype From 85ed94d78580976e8c883f9f31184bcfa75f908e Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 16 Dec 2017 18:51:42 -0200 Subject: [PATCH 207/407] [FJSX15] Restore interface --- .../fjsx15/flowtype/interface.sublime-syntax | 100 ++++++++++++++++++ syntaxes/fjsx15/statement.sublime-syntax | 1 + 2 files changed, 101 insertions(+) create mode 100644 syntaxes/fjsx15/flowtype/interface.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/interface.sublime-syntax b/syntaxes/fjsx15/flowtype/interface.sublime-syntax new file mode 100644 index 00000000..7f7a9c96 --- /dev/null +++ b/syntaxes/fjsx15/flowtype/interface.sublime-syntax @@ -0,0 +1,100 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + +contexts: + main: + - match: \s*(interface)\b + captures: + 1: >- + flowtype + storage.type.flowtype + keyword.declaration.interface.flowtype + set: declaration + + declaration: + - include: comment-no-pop + # Extension. + - match: \s*(extends)\b + captures: + 1: >- + flowtype + storage.modifier.flowtype + keyword.extension.flowtype + push: optional-type-expression + # Template parameters. + - match: (?=\s*<) + push: template-parameters + # Body. + - match: (?=\s*\{) + set: body + # Identifier. + - match: (?xi)\s*({{commonIdentifier}}) + captures: + 1: >- + flowtype + entity.name.interface.flowtype + + optional-type-expression: + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-type-expression.sublime-syntax + + template-parameters: + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/parameters.sublime-syntax + + body: + - include: comment + - match: \s*(\{) + captures: + 1: >- + flowtype + punctuation.definition.interface.body.begin.flowtype + set: [ body-end, statements-and-expressions ] + + body-end: + - include: comment-no-pop + - match: \s*(?>(,)|(;)) + captures: + 1: punctuation.definition.object.js.fjsx15 + 2: keyword.other.terminator.js.fjsx15 + push: statements-and-expressions + - match: \s*(}) + captures: + 1: >- + flowtype + punctuation.definition.interface.body.end.flowtype + pop: true + - match: (?=\s*\S) + push: statements-and-expressions + + statements-and-expressions: + - match: (?=\s*}) + pop: true + - include: comment-no-pop + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/operator/covariant.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/operator/contravariant.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/indexer.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/class/method.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/class/property.sublime-syntax + + comment-no-pop: + - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax diff --git a/syntaxes/fjsx15/statement.sublime-syntax b/syntaxes/fjsx15/statement.sublime-syntax index 5226aa5c..69837a16 100644 --- a/syntaxes/fjsx15/statement.sublime-syntax +++ b/syntaxes/fjsx15/statement.sublime-syntax @@ -25,6 +25,7 @@ variables: contexts: main: - include: Packages/Naomi/syntaxes/fjsx15/flowtype/declare.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/interface.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type-aliasing.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/decorator.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/import.sublime-syntax From ff370ae25517e8f5213bb7fb94f9d25e4d0e9023 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 16 Dec 2017 18:51:55 -0200 Subject: [PATCH 208/407] [FJSX15] Fix group scope --- syntaxes/fjsx15/flowtype/type-expression.sublime-syntax | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/flowtype/type-expression.sublime-syntax b/syntaxes/fjsx15/flowtype/type-expression.sublime-syntax index 7d725534..4bb68e35 100644 --- a/syntaxes/fjsx15/flowtype/type-expression.sublime-syntax +++ b/syntaxes/fjsx15/flowtype/type-expression.sublime-syntax @@ -52,7 +52,9 @@ contexts: # Open new type expression group. - match: "{{expressionGroupBegin}}" captures: - 1: punctuation.definition.expression.group.begin.flowtype + 1: >- + flowtype + punctuation.definition.expression.group.begin.flowtype push: open-group # Close the current type expression group. - include: close-group From 51e5db339b4e92a2f6d166c9b68b4ec8e301a8e5 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 16 Dec 2017 18:52:10 -0200 Subject: [PATCH 209/407] [FJSX15] Highlight methods in flow objects --- syntaxes/fjsx15/flowtype/object.sublime-syntax | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/syntaxes/fjsx15/flowtype/object.sublime-syntax b/syntaxes/fjsx15/flowtype/object.sublime-syntax index aeeb503b..a6e330d3 100644 --- a/syntaxes/fjsx15/flowtype/object.sublime-syntax +++ b/syntaxes/fjsx15/flowtype/object.sublime-syntax @@ -37,14 +37,14 @@ contexts: 2: >- flowtype punctuation.definition.object.begin.flowtype - set: [ delimiters, optional-property ] + set: [ delimiters, optional-property-or-method ] # Normal. - match: \s*({) captures: 1: >- flowtype punctuation.definition.object.begin.flowtype - set: [ delimiters, optional-property ] + set: [ delimiters, optional-property-or-method ] delimiters: - match: \s*(,|;) @@ -52,7 +52,7 @@ contexts: 1: >- flowtype punctuation.definition.object.flowtype - push: optional-property + push: optional-property-or-method # Exact. - match: \s*(\|)\s*(}) captures: @@ -71,10 +71,12 @@ contexts: punctuation.definition.object.end.flowtype pop: true - optional-property: + optional-property-or-method: - include: comment-no-pop - match: (?=\s*[|}]) pop: true + - include: Packages/Naomi/syntaxes/fjsx15/class/modifier.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/class/method.sublime-syntax - include: constant - include: variable # String property name. From 1482e8c2dc0f6770ab6dc810205d841723af03e8 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 16 Dec 2017 19:09:05 -0200 Subject: [PATCH 210/407] [FJSX15] Restore flow block comments --- .../fjsx15/comment/flowtype.sublime-syntax | 69 +++++++------------ 1 file changed, 24 insertions(+), 45 deletions(-) diff --git a/syntaxes/fjsx15/comment/flowtype.sublime-syntax b/syntaxes/fjsx15/comment/flowtype.sublime-syntax index ad10304e..f5ac2e65 100644 --- a/syntaxes/fjsx15/comment/flowtype.sublime-syntax +++ b/syntaxes/fjsx15/comment/flowtype.sublime-syntax @@ -24,16 +24,16 @@ contexts: 1: >- comment.block.flowtype punctuation.definition.comment.begin.flowtype - set: block + set: [ block-end, statements-and-expressions ] - match: \s*(/\*(?=\s*:)) captures: 1: >- comment.block.flowtype punctuation.definition.comment.begin.flowtype - set: associated-type + set: [ block-end, associated-type ] - associated-type: - - meta_content_scope: comment.block.flowtype + block-end: + - meta_scope: comment.block.flowtype - match: \s*(\*/) captures: 1: >- @@ -47,48 +47,27 @@ contexts: pop: true - match: '' pop: true + + associated-type: + - match: (?=\s*\*\/) + pop: true + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax + + statements-and-expressions: + - match: (?=\s*\*\/) + pop: true - match: "" push: - - match: (?=\s*\*\/) - pop: true + - match: \s*(;) + captures: + 1: keyword.other.terminator.js.fjsx15 - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax - - block: - - meta_content_scope: comment.block.flowtype - - match: \s*(\*/) - captures: - 1: >- - comment.block.flowtype - punctuation.definition.comment.end.js.fjsx15 - set: - # Used to fix the block comment indentation settings. - # https://forum.sublimetext.com/t/everything-you-n-ever-wanted-to-know-about-indentation-in-st3/26207/6 - - match: \s*$\n? - scope: meta.block-end.js.fjsx15 - pop: true - - match: '' + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/declare.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/interface.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type-aliasing.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/class/property.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/indexer.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/import.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/export.sublime-syntax + - match: "" pop: true - # - match: "" - # push: - # - match: (?=\s*\*\/) - # pop: true - # - match: \s*(\?)(?=\s*:) - # captures: - # 1: keyword.operator.other.optional.flowtype - # set: - # - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax - # - include: Packages/Naomi/syntaxes/fjsx15/flowtype/declare.sublime-syntax - # - include: Packages/Naomi/syntaxes/fjsx15/flowtype/field.sublime-syntax - # - include: Packages/Naomi/syntaxes/fjsx15/flowtype/interface.sublime-syntax - # - include: Packages/Naomi/syntaxes/fjsx15/flowtype/indexer.sublime-syntax - # - include: Packages/Naomi/syntaxes/fjsx15/flowtype/module.sublime-syntax - # - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type-aliasing.sublime-syntax - # - include: Packages/Naomi/syntaxes/fjsx15/import.sublime-syntax - # - include: Packages/Naomi/syntaxes/fjsx15/export.sublime-syntax - # - include: Packages/Naomi/syntaxes/fjsx15/operator/terminator.sublime-syntax - - link: - - include: Packages/Naomi/syntaxes/shared/link.sublime-syntax - - email: - - include: Packages/Naomi/syntaxes/shared/email.sublime-syntax From 6f33697c7b8d30c799d538a63c844131b0690aec Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 16 Dec 2017 19:12:40 -0200 Subject: [PATCH 211/407] [FJSX15] Make function body optional --- syntaxes/fjsx15/function.sublime-syntax | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/function.sublime-syntax b/syntaxes/fjsx15/function.sublime-syntax index d140fff1..567f6a94 100644 --- a/syntaxes/fjsx15/function.sublime-syntax +++ b/syntaxes/fjsx15/function.sublime-syntax @@ -55,7 +55,7 @@ contexts: push: template-parameters # Parameters. - match: (?=\s*\() - push: parameters + set: [ optional-body, parameters ] # Identifier. - match: | (?xi)\s* @@ -79,5 +79,10 @@ contexts: parameters: - include: Packages/Naomi/syntaxes/fjsx15/function/parameters.sublime-syntax + optional-body: + - include: body + - match: (?=\s*\S) + pop: true + body: - include: Packages/Naomi/syntaxes/fjsx15/function/body.sublime-syntax From 75f333af993eb0ceac0e817308ec6d57f79e7a01 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 16 Dec 2017 19:50:50 -0200 Subject: [PATCH 212/407] [FJSX15] Remove dead code --- .../fjsx15/flowtype/declare.sublime-syntax | 22 -- .../flowtype/type-expression.sublime-syntax | 193 ------------------ 2 files changed, 215 deletions(-) diff --git a/syntaxes/fjsx15/flowtype/declare.sublime-syntax b/syntaxes/fjsx15/flowtype/declare.sublime-syntax index 10e50db8..73f57a34 100644 --- a/syntaxes/fjsx15/flowtype/declare.sublime-syntax +++ b/syntaxes/fjsx15/flowtype/declare.sublime-syntax @@ -30,25 +30,3 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/flowtype/module.sublime-syntax - match: (?=\s*\S) pop: true - # - include: Packages/Naomi/syntaxes/fjsx15/flowtype/module.sublime-syntax - # # Export object literal. - # - match: | - # (?x) - # \s*(export) - # \s*(default) - # (?=\s*{) - # captures: - # 1: keyword.control.export.js.fjsx15 - # 2: >- - # storage.modifier.js.fjsx15 - # keyword.control.export.default.js.fjsx15 - # set: flow-object - # # Norma export. - # - include: Packages/Naomi/syntaxes/fjsx15/export.sublime-syntax - # # Other statements and expected expressions. - # - include: Packages/Naomi/syntaxes/fjsx15/class.sublime-syntax - # - include: Packages/Naomi/syntaxes/fjsx15/function.sublime-syntax - # - include: Packages/Naomi/syntaxes/fjsx15/variable-declaration.sublime-syntax - - # flow-object: - # - include: Packages/Naomi/syntaxes/fjsx15/flowtype/object.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/type-expression.sublime-syntax b/syntaxes/fjsx15/flowtype/type-expression.sublime-syntax index 4bb68e35..f5a8b253 100644 --- a/syntaxes/fjsx15/flowtype/type-expression.sublime-syntax +++ b/syntaxes/fjsx15/flowtype/type-expression.sublime-syntax @@ -96,196 +96,3 @@ contexts: - include: comment-no-pop - include: Packages/Naomi/syntaxes/fjsx15/flowtype/operator/array-shorthand.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/arguments.sublime-syntax - - # - include: operators - # # Function. - # - match: | - # (?xi) - # (?=\s* - # {{templateArguments}}? - # {{flowFunction}} - # ) - # set: [ - # optional-operator, - # function-declaration - # ] - # # Open new expression group. - # - match: | - # (?xi)\s* - # {{expressionGroupBegin}} - # captures: - # 1: punctuation.definition.expression.group.a.begin.js.fjsx15 - # set: open-b-close-a - # # Expression contents. - # - match: (?=\s*\S) - # set: [ - # optional-operator, - # type-definitions - # ] - - - # open-a-close-b: - # - include: function-no-pop - # # Open new expression group. - # - match: | - # (?xi)\s* - # {{expressionGroupBegin}} - # captures: - # 1: punctuation.definition.expression.group.a.begin.js.fjsx15 - # push: open-b-close-a - # # Close current expression group. - # - match: \s*(\)) - # captures: - # 1: punctuation.definition.expression.group.b.end.js.fjsx15 - # set: optional-operator - # # Expression contents. - # - match: (?=\s*\S) - # push: [ - # optional-operator, - # type-definitions - # ] - - # open-b-close-a: - # - include: function-no-pop - # # Open new expression group. - # - match: | - # (?xi)\s* - # {{expressionGroupBegin}} - # captures: - # 1: punctuation.definition.expression.group.b.begin.js.fjsx15 - # push: open-a-close-b - # # Close current expression group. - # - match: \s*(\)) - # captures: - # 1: punctuation.definition.expression.group.a.end.js.fjsx15 - # set: optional-operator - # # Expression contents. - # - match: (?=\s*\S) - # push: [ - # optional-operator, - # type-definitions - # ] - - # function-no-pop: - # - include: Packages/Naomi/syntaxes/fjsx15/flowtype/function.no-pop.sublime-syntax - - # function-declaration: - # - include: Packages/Naomi/syntaxes/fjsx15/flowtype/function/declaration.sublime-syntax - - # type-definitions: - # - include: comment - # - include: Packages/Naomi/syntaxes/fjsx15/flowtype/typeof.no-pop.sublime-syntax - # # Enveloped nullable. - # - match: | - # (?x) - # \s*(\?) - # \s*(\() - # captures: - # 1: >- - # flowtype - # keyword.operator.other.nullable.flowtype - # 2: >- - # flowtype - # punctuation.definition.nullable.begin.flowtype - # set: [ - # enveloped-nullable-end, - # main - # ] - # # Nullable. - # - match: \s*(\?) - # captures: - # 1: >- - # flowtype - # keyword.operator.other.nullable.flowtype - # # Utility operators. - # - match: | - # (?x)\s* - # (Class)\b - # captures: - # 1: >- - # flowtype - # keyword.operator.other.utility.flowtype - # set: template - # # Utility operators preceded by $. - # - match: | - # (?x)\s* - # (\$ - # (?> Abstract - # | Diff - # | Exact - # | Keys - # | ObjMap - # | PropertyType - # | ReadOnly(?:Array)? - # | Shape - # | Supertype - # | Subtype - # )\b - # ) - # captures: - # 1: >- - # flowtype - # keyword.operator.other.utility.flowtype - # set: template - # # Existential. - # - match: \s*(\*) - # captures: - # 1: >- - # flowtype - # keyword.operator.other.existential.flowtype - # pop: true - # # Normal type. - # - include: Packages/Naomi/syntaxes/fjsx15/flowtype/function.sublime-syntax - # - include: Packages/Naomi/syntaxes/fjsx15/literal/number.sublime-syntax - # - include: Packages/Naomi/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax - # - include: Packages/Naomi/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax - # - include: Packages/Naomi/syntaxes/fjsx15/literal/string/template.sublime-syntax - # - include: Packages/Naomi/syntaxes/fjsx15/flowtype/object.sublime-syntax - # - include: Packages/Naomi/syntaxes/fjsx15/flowtype/tuple.sublime-syntax - # - include: Packages/Naomi/syntaxes/fjsx15/flowtype/simple.sublime-syntax - - # optional-operator: - # - include: operators - # - match: (?=\s*\S) - # pop: true - - # operators: - # - include: comment - # - include: co-contravariant - # # Intersection. - # - match: | - # (?x) - # \s*(&) - # (?!(?>&|=)) - # captures: - # 1: >- - # flowtype - # keyword.operator.other.intersection.flowtype - # set: main - # # Union. - # - match: | - # (?x) - # \s*(\|) - # (?!(?>\||=|\s*})) - # captures: - # 1: >- - # flowtype - # keyword.operator.other.union.flowtype - # set: main - - # enveloped-nullable-end: - # - match: \s*(\)) - # captures: - # 1: >- - # flowtype - # punctuation.definition.nullable.end.flowtype - # pop: true - - # comment: - # - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - - # co-contravariant: - # - include: Packages/Naomi/syntaxes/fjsx15/flowtype/co-contravariant.no-pop.sublime-syntax - - # template: - # - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/parameters.sublime-syntax From f04b06d5d282f3982fe63b8254cdc62532918771 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 16 Dec 2017 19:51:45 -0200 Subject: [PATCH 213/407] [FJSX15] Break typeof and void operators apart --- syntaxes/fjsx15/operator.sublime-syntax | 3 +- ...d.sublime-syntax => typeof.sublime-syntax} | 6 ---- syntaxes/fjsx15/operator/void.sublime-syntax | 30 +++++++++++++++++++ 3 files changed, 32 insertions(+), 7 deletions(-) rename syntaxes/fjsx15/operator/{word.sublime-syntax => typeof.sublime-syntax} (85%) create mode 100644 syntaxes/fjsx15/operator/void.sublime-syntax diff --git a/syntaxes/fjsx15/operator.sublime-syntax b/syntaxes/fjsx15/operator.sublime-syntax index ae176e5b..66d2e88a 100644 --- a/syntaxes/fjsx15/operator.sublime-syntax +++ b/syntaxes/fjsx15/operator.sublime-syntax @@ -38,4 +38,5 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/operator/relational.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/shebang.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/spread.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/operator/word.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/operator/typeof.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/operator/void.sublime-syntax diff --git a/syntaxes/fjsx15/operator/word.sublime-syntax b/syntaxes/fjsx15/operator/typeof.sublime-syntax similarity index 85% rename from syntaxes/fjsx15/operator/word.sublime-syntax rename to syntaxes/fjsx15/operator/typeof.sublime-syntax index 6ed0e5f5..0a198c90 100644 --- a/syntaxes/fjsx15/operator/word.sublime-syntax +++ b/syntaxes/fjsx15/operator/typeof.sublime-syntax @@ -20,12 +20,6 @@ scope: ... contexts: main: - match: \s*(typeof)\b - captures: - 1: >- - word.js.fjsx15 - keyword.operator.other.js.fjsx15 - set: optional-expression - - match: \s*(void)\b captures: 1: >- word.js.fjsx15 diff --git a/syntaxes/fjsx15/operator/void.sublime-syntax b/syntaxes/fjsx15/operator/void.sublime-syntax new file mode 100644 index 00000000..137ec0f7 --- /dev/null +++ b/syntaxes/fjsx15/operator/void.sublime-syntax @@ -0,0 +1,30 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +contexts: + main: + - match: \s*(void)\b + captures: + 1: >- + word.js.fjsx15 + keyword.operator.other.js.fjsx15 + set: optional-expression + + optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax From 4d00bdd2f8965721e040020eabf105f167d625f9 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 16 Dec 2017 20:09:39 -0200 Subject: [PATCH 214/407] [FJSX15] Add existential type --- syntaxes/fjsx15/flowtype/simple.sublime-syntax | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/syntaxes/fjsx15/flowtype/simple.sublime-syntax b/syntaxes/fjsx15/flowtype/simple.sublime-syntax index 9b181678..e7e8fb57 100644 --- a/syntaxes/fjsx15/flowtype/simple.sublime-syntax +++ b/syntaxes/fjsx15/flowtype/simple.sublime-syntax @@ -25,6 +25,13 @@ variables: contexts: main: - include: Packages/Naomi/syntaxes/fjsx15/flowtype/namespace-path.no-pop.sublime-syntax + # Existential. + - match: \s*(\*) + captures: + 1: >- + flowtype + entity.name.type.existential.flowtype + pop: true # Predefined types. - match: | (?x)\s*\b From 04ca276bb9b4f4ce96e6bbde924c500e334c6914 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 17 Dec 2017 14:57:52 -0200 Subject: [PATCH 215/407] [FJSX15] Fix arrow function multi statement body --- syntaxes/fjsx15/arrow-function/body.sublime-syntax | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/syntaxes/fjsx15/arrow-function/body.sublime-syntax b/syntaxes/fjsx15/arrow-function/body.sublime-syntax index fdf561bf..651e6599 100644 --- a/syntaxes/fjsx15/arrow-function/body.sublime-syntax +++ b/syntaxes/fjsx15/arrow-function/body.sublime-syntax @@ -33,13 +33,9 @@ contexts: 1: >- arrow.js.fjsx15 punctuation.definition.function.body.begin.js.fjsx15 - set: [ - close-body, - optional-statements-and-expressions - ] + set: optional-statements-and-expressions - include: optional-expression - close-body: - match: \s*(}) captures: @@ -47,6 +43,8 @@ contexts: arrow.js.fjsx15 punctuation.definition.function.body.end.js.fjsx15 set: optional-expression-tail + - match: "" + push: optional-statements-and-expressions optional-statements-and-expressions: - include: Packages/Naomi/syntaxes/fjsx15/optional-statements-and-expressions.sublime-syntax From 6c5d86d8018857645a8ad3b2dfa8d0c3337a0acc Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 17 Dec 2017 16:55:49 -0200 Subject: [PATCH 216/407] [FJSX15] Fix method without identifier detection --- syntaxes/fjsx15/class/method.sublime-syntax | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/syntaxes/fjsx15/class/method.sublime-syntax b/syntaxes/fjsx15/class/method.sublime-syntax index a6cdc3b0..3bb4cdab 100644 --- a/syntaxes/fjsx15/class/method.sublime-syntax +++ b/syntaxes/fjsx15/class/method.sublime-syntax @@ -46,6 +46,10 @@ variables: contexts: main: + # Method without identifier. + - match: (?=\s*\() + set: declaration + # Normal method. - match: | (?xi) (?= From 0b47b3e559740ccb5694aa4360828b4d140a6cc6 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 17 Dec 2017 18:46:45 -0200 Subject: [PATCH 217/407] [FJSX15] Fix arrow function body end --- syntaxes/fjsx15/arrow-function/body.sublime-syntax | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/arrow-function/body.sublime-syntax b/syntaxes/fjsx15/arrow-function/body.sublime-syntax index 651e6599..93436be0 100644 --- a/syntaxes/fjsx15/arrow-function/body.sublime-syntax +++ b/syntaxes/fjsx15/arrow-function/body.sublime-syntax @@ -33,7 +33,7 @@ contexts: 1: >- arrow.js.fjsx15 punctuation.definition.function.body.begin.js.fjsx15 - set: optional-statements-and-expressions + set: close-body - include: optional-expression close-body: From 6ee08e0d8ee6540e0118ffd79577565b3b22fe5a Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 17 Dec 2017 19:03:45 -0200 Subject: [PATCH 218/407] [FJSX15] Fix scopes according to sublime core --- syntaxes/fjsx15/class.sublime-syntax | 16 +- syntaxes/fjsx15/class/method.sublime-syntax | 1 + syntaxes/fjsx15/class/modifier.sublime-syntax | 17 +- syntaxes/fjsx15/constant.sublime-syntax | 12 +- syntaxes/fjsx15/core.sublime-syntax | 154 ++++++--------- syntaxes/fjsx15/export.sublime-syntax | 16 +- .../fjsx15/flowtype/interface.sublime-syntax | 2 - .../fjsx15/flowtype/simple.sublime-syntax | 5 +- .../flowtype/type-aliasing.sublime-syntax | 4 +- syntaxes/fjsx15/function-call.sublime-syntax | 9 +- .../function-call/arguments.sublime-syntax | 6 +- syntaxes/fjsx15/function.sublime-syntax | 5 +- .../function/parameter/simple.sublime-syntax | 4 +- .../fjsx15/function/parameters.sublime-syntax | 1 + syntaxes/fjsx15/import.sublime-syntax | 12 +- syntaxes/fjsx15/jest.sublime-syntax | 4 +- syntaxes/fjsx15/node-js.sublime-syntax | 8 +- syntaxes/fjsx15/operator/other.sublime-syntax | 2 +- syntaxes/fjsx15/react-js.sublime-syntax | 20 +- syntaxes/fjsx15/statement.sublime-syntax | 33 ++-- .../variable-declaration.sublime-syntax | 83 +------- syntaxes/fjsx15/variable.sublime-syntax | 180 +++++++++++++++--- syntaxes/fjsx15/web.sublime-syntax | 6 +- 23 files changed, 299 insertions(+), 301 deletions(-) diff --git a/syntaxes/fjsx15/class.sublime-syntax b/syntaxes/fjsx15/class.sublime-syntax index ea81e5ba..9d203afc 100644 --- a/syntaxes/fjsx15/class.sublime-syntax +++ b/syntaxes/fjsx15/class.sublime-syntax @@ -26,9 +26,7 @@ contexts: main: - match: \s*(class)\b captures: - 1: >- - storage.type.js.fjsx15 - keyword.declaration.class.js.fjsx15 + 1: storage.type.class.js.fjsx15 set: declaration declaration: @@ -42,9 +40,7 @@ contexts: # Interfaces. - match: \s*(implements)\b captures: - 1: >- - storage.modifier.js.fjsx15 - keyword.other.implement.js.fjsx15 + 1: storage.modifier.js.fjsx15 push: [ optional-target-class-or-namespace, optional-template-arguments, @@ -53,9 +49,7 @@ contexts: # Extensions. - match: \s*(extends)\b captures: - 1: >- - storage.modifier.js.fjsx15 - keyword.other.inherit.js.fjsx15 + 1: storage.modifier.js.fjsx15 push: [ optional-template-arguments, target-class-or-namespace @@ -101,7 +95,5 @@ contexts: (?xi) \s*({{commonIdentifier}}) captures: - 1: >- - parent.js.fjsx15 - entity.name.class.js.fjsx15 + 1: entity.other.inherited-class.js.fjsx15 pop: true diff --git a/syntaxes/fjsx15/class/method.sublime-syntax b/syntaxes/fjsx15/class/method.sublime-syntax index 3bb4cdab..e2ab2829 100644 --- a/syntaxes/fjsx15/class/method.sublime-syntax +++ b/syntaxes/fjsx15/class/method.sublime-syntax @@ -60,6 +60,7 @@ contexts: set: declaration declaration: + - meta_scope: meta.function.declaration.js.fjsx15 - include: comment-no-pop # Body. - match: (?=\s*\{) diff --git a/syntaxes/fjsx15/class/modifier.sublime-syntax b/syntaxes/fjsx15/class/modifier.sublime-syntax index 088795c5..32bdd5e7 100644 --- a/syntaxes/fjsx15/class/modifier.sublime-syntax +++ b/syntaxes/fjsx15/class/modifier.sublime-syntax @@ -24,35 +24,26 @@ contexts: modifiers: - match: \s*(static)\b captures: - 1: >- - storage.modifier.js.fjsx15 - keyword.other.access.js.fjsx15 + 1: storage.modifier.js.fjsx15 set: modifier-trap - match: \s*(\#) captures: 1: >- storage.modifier.js.fjsx15 - keyword.other.access.js.fjsx15 set: modifier-trap - match: \s*(async)\b captures: - 1: >- - storage.modifier.js.fjsx15 - keyword.other.async.js.fjsx15 + 1: storage.modifier.js.fjsx15 set: modifier-trap - match: | (?xi)\s* (get|set)\b captures: - 1: >- - storage.modifier.js.fjsx15 - keyword.other.proxy.js.fjsx15 + 1: storage.modifier.js.fjsx15 set: modifier-trap - match: \s*(\*) captures: - 1: >- - storage.modifier.js.fjsx15 - keyword.operator.other.generator.js.fjsx15 + 1: storage.modifier.js.fjsx15 set: modifier-trap modifier-trap: diff --git a/syntaxes/fjsx15/constant.sublime-syntax b/syntaxes/fjsx15/constant.sublime-syntax index 339d500d..9eae794c 100644 --- a/syntaxes/fjsx15/constant.sublime-syntax +++ b/syntaxes/fjsx15/constant.sublime-syntax @@ -30,10 +30,8 @@ contexts: (\#)? ([_[:upper:]])\b captures: - 1: >- - storage.modifier.js.fjsx15 - keyword.operator.other.access.js.fjsx15 - 2: entity.name.constant.js.fjsx15 + 1: storage.modifier.js.fjsx15 + 2: variable.other.constant.js.fjsx15 pop: true # Two or more characters. - match: | @@ -46,8 +44,6 @@ contexts: ) ) captures: - 1: >- - storage.modifier.js.fjsx15 - keyword.operator.other.access.js.fjsx15 - 2: entity.name.constant.js.fjsx15 + 1: storage.modifier.js.fjsx15 + 2: variable.other.constant.js.fjsx15 pop: true diff --git a/syntaxes/fjsx15/core.sublime-syntax b/syntaxes/fjsx15/core.sublime-syntax index 60b4c4b8..f6e11e74 100644 --- a/syntaxes/fjsx15/core.sublime-syntax +++ b/syntaxes/fjsx15/core.sublime-syntax @@ -28,8 +28,8 @@ contexts: - include: symbol-properties # https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects - include: constants + - include: variables - include: functions - - include: function-properties - include: fundamental-objects - include: numbers-and-dates - include: text-processing @@ -56,13 +56,9 @@ contexts: | isArray ))\b captures: - 1: >- - support.core.js.fjsx15 - entity.name.class.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 - 3: >- - support.core.js.fjsx15 - entity.name.function.js.fjsx15 + 1: support.class.builtin.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.function.js.fjsx15 set: optional-template-and-arguments console-functions: @@ -85,13 +81,9 @@ contexts: ))\b ) captures: - 1: >- - support.core.js.fjsx15 - entity.name.variable.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 - 3: >- - support.core.js.fjsx15 - entity.name.function.js.fjsx15 + 1: support.type.object.console.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.function.console.js.fjsx15 set: optional-template-and-arguments math-constants: @@ -109,7 +101,7 @@ contexts: 1: >- support.core.js.fjsx15 entity.name.class.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 3: >- support.core.js.fjsx15 entity.name.constant.js.fjsx15 @@ -147,13 +139,9 @@ contexts: | trunc ))\b captures: - 1: >- - support.core.js.fjsx15 - entity.name.class.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 - 3: >- - support.core.js.fjsx15 - entity.name.function.js.fjsx15 + 1: support.class.builtin.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.function.js.fjsx15 set: optional-template-and-arguments object-functions: @@ -174,13 +162,9 @@ contexts: | setPrototypeOf ))\b captures: - 1: >- - support.core.js.fjsx15 - entity.name.class.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 - 3: >- - support.core.js.fjsx15 - entity.name.function.js.fjsx15 + 1: support.class.builtin.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.function.js.fjsx15 set: optional-template-and-arguments symbol-functions: @@ -192,13 +176,9 @@ contexts: | keyFor ))\b captures: - 1: >- - support.core.js.fjsx15 - entity.name.class.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 - 3: >- - support.core.js.fjsx15 - entity.name.function.js.fjsx15 + 1: support.class.builtin.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.function.js.fjsx15 set: optional-template-and-arguments symbol-properties: @@ -223,7 +203,7 @@ contexts: 1: >- support.core.js.fjsx15 entity.name.class.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 3: >- support.core.js.fjsx15 entity.name.constant.js.fjsx15 @@ -233,16 +213,30 @@ contexts: - match: | (?x)\s* ((?> false - | Infinity + | true + )) + captures: + 1: constant.language.boolean.js.fjsx15 + pop: true + - match: | + (?x)\s* + ((?> Infinity | NaN | null - | true | undefined )) captures: - 1: >- - support.core.js.fjsx15 - entity.name.constant.js.fjsx15 + 1: constant.language.js.fjsx15 + pop: true + + variables: + - match: \s*(super)\b + captures: + 1: variable.language.super.js.fjsx15 + pop: true + - match: \s*(this)\b + captures: + 1: variable.language.this.js.fjsx15 pop: true functions: @@ -257,9 +251,7 @@ contexts: )) (?=\s*\() captures: - 1: >- - support.core.js.fjsx15 - entity.name.function.js.fjsx15 + 1: support.function.js.fjsx15 set: optional-template-and-arguments function-properties: @@ -267,13 +259,9 @@ contexts: (?x)\s* (function)(.)(sent) captures: - 1: >- - support.core.js.fjsx15 - entity.name.variable.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 - 3: >- - support.core.js.fjsx15 - entity.name.variable.js.fjsx15 + 1: support.class.builtin.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.variable.js.fjsx15 pop: true fundamental-objects: @@ -292,9 +280,7 @@ contexts: | URIError ))\b captures: - 1: >- - support.core.js.fjsx15 - entity.name.class.js.fjsx15 + 1: support.class.builtin.js.fjsx15 set: optional-template-and-arguments numbers-and-dates: @@ -305,9 +291,7 @@ contexts: | Number ))\b captures: - 1: >- - support.core.js.fjsx15 - entity.name.class.js.fjsx15 + 1: support.class.builtin.js.fjsx15 set: optional-template-and-arguments text-processing: @@ -317,9 +301,7 @@ contexts: | String ))\b captures: - 1: >- - support.core.js.fjsx15 - entity.name.class.js.fjsx15 + 1: support.class.builtin.js.fjsx15 set: optional-template-and-arguments indexed-collections: @@ -332,9 +314,7 @@ contexts: | Uint8ClampedArray ))\b captures: - 1: >- - support.core.js.fjsx15 - entity.name.class.js.fjsx15 + 1: support.class.builtin.js.fjsx15 set: optional-template-and-arguments keyed-collections: @@ -345,9 +325,9 @@ contexts: | Weak(?>Map|Set) ))\b captures: - 1: >- - support.core.js.fjsx15 - entity.name.class.js.fjsx15 + 1: support.class.builtin.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.function.js.fjsx15 set: optional-template-and-arguments structured-data: @@ -358,9 +338,9 @@ contexts: | JSON ))\b captures: - 1: >- - support.core.js.fjsx15 - entity.name.class.js.fjsx15 + 1: support.class.builtin.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.function.js.fjsx15 set: optional-template-and-arguments control-abstraction-objects: @@ -370,9 +350,9 @@ contexts: | Promise ))\b captures: - 1: >- - support.core.js.fjsx15 - entity.name.class.js.fjsx15 + 1: support.class.builtin.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.function.js.fjsx15 set: optional-template-and-arguments reflection: @@ -382,9 +362,9 @@ contexts: | Reflect ))\b captures: - 1: >- - support.core.js.fjsx15 - entity.name.class.js.fjsx15 + 1: support.class.builtin.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.function.js.fjsx15 set: optional-template-and-arguments internationalization: @@ -399,13 +379,9 @@ contexts: ))\b )? captures: - 1: >- - support.core.js.fjsx15 - entity.name.class.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 - 3: >- - support.core.js.fjsx15 - entity.name.class.js.fjsx15 + 1: support.class.builtin.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.function.js.fjsx15 set: optional-template-and-arguments web-assembly: @@ -424,11 +400,7 @@ contexts: ))\b )? captures: - 1: >- - support.core.js.fjsx15 - entity.name.class.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 - 3: >- - support.core.js.fjsx15 - entity.name.class.js.fjsx15 + 1: support.class.builtin.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.function.js.fjsx15 set: optional-template-and-arguments diff --git a/syntaxes/fjsx15/export.sublime-syntax b/syntaxes/fjsx15/export.sublime-syntax index 7b15a674..1bc518c3 100644 --- a/syntaxes/fjsx15/export.sublime-syntax +++ b/syntaxes/fjsx15/export.sublime-syntax @@ -75,15 +75,13 @@ contexts: \s*(type) \s*({) captures: - 1: keyword.control.export.js.fjsx15 + 1: keyword.control.import-export.js.fjsx15 2: >- flowtype - storage.type.flowtype - keyword.other.access.flowtype + storage.modifier.flowtype 3: >- flowtype storage.type.flowtype - keyword.declaration.type-aliasing.flowtype 4: punctuation.definition.export.list.begin.js.fjsx15 set: types # Export object literal. @@ -93,7 +91,7 @@ contexts: \s*(default) (?=\s*{) captures: - 1: keyword.control.export.js.fjsx15 + 1: keyword.control.import-export.js.fjsx15 2: >- storage.modifier.js.fjsx15 keyword.control.export.default.js.fjsx15 @@ -105,7 +103,7 @@ contexts: \s*(default) (?=\s*from) captures: - 1: keyword.control.export.js.fjsx15 + 1: keyword.control.import-export.js.fjsx15 2: >- storage.modifier.js.fjsx15 keyword.control.export.default.js.fjsx15 @@ -127,7 +125,7 @@ contexts: ) ) captures: - 1: keyword.control.export.js.fjsx15 + 1: keyword.control.import-export.js.fjsx15 # set: statement-and-expression # Export default. - match: | @@ -135,7 +133,7 @@ contexts: \s*(export) \s*(default) captures: - 1: keyword.control.export.js.fjsx15 + 1: keyword.control.import-export.js.fjsx15 2: >- storage.modifier.js.fjsx15 keyword.control.export.default.js.fjsx15 @@ -146,7 +144,7 @@ contexts: \s*(export)\b (?!\s*\.) captures: - 1: keyword.control.export.js.fjsx15 + 1: keyword.control.import-export.js.fjsx15 set: targets comment: diff --git a/syntaxes/fjsx15/flowtype/interface.sublime-syntax b/syntaxes/fjsx15/flowtype/interface.sublime-syntax index 7f7a9c96..31dc4384 100644 --- a/syntaxes/fjsx15/flowtype/interface.sublime-syntax +++ b/syntaxes/fjsx15/flowtype/interface.sublime-syntax @@ -29,7 +29,6 @@ contexts: 1: >- flowtype storage.type.flowtype - keyword.declaration.interface.flowtype set: declaration declaration: @@ -40,7 +39,6 @@ contexts: 1: >- flowtype storage.modifier.flowtype - keyword.extension.flowtype push: optional-type-expression # Template parameters. - match: (?=\s*<) diff --git a/syntaxes/fjsx15/flowtype/simple.sublime-syntax b/syntaxes/fjsx15/flowtype/simple.sublime-syntax index e7e8fb57..529a4652 100644 --- a/syntaxes/fjsx15/flowtype/simple.sublime-syntax +++ b/syntaxes/fjsx15/flowtype/simple.sublime-syntax @@ -53,8 +53,7 @@ contexts: captures: 1: >- flowtype - support.flowtype - entity.name.type.flowtype + support.type.flowtype pop: true # Other types. - match: | @@ -63,5 +62,5 @@ contexts: captures: 1: >- flowtype - entity.name.type.flowtype + variable.other.type.flowtype pop: true diff --git a/syntaxes/fjsx15/flowtype/type-aliasing.sublime-syntax b/syntaxes/fjsx15/flowtype/type-aliasing.sublime-syntax index 40fefcba..af7a95ad 100644 --- a/syntaxes/fjsx15/flowtype/type-aliasing.sublime-syntax +++ b/syntaxes/fjsx15/flowtype/type-aliasing.sublime-syntax @@ -42,12 +42,10 @@ contexts: captures: 1: >- flowtype - storage.type.flowtype - keyword.other.access.flowtype + storage.modifier.flowtype 2: >- flowtype storage.type.flowtype - keyword.declaration.type-aliasing.flowtype set: [ punctuation, identifier diff --git a/syntaxes/fjsx15/function-call.sublime-syntax b/syntaxes/fjsx15/function-call.sublime-syntax index 1556df65..cb97553f 100644 --- a/syntaxes/fjsx15/function-call.sublime-syntax +++ b/syntaxes/fjsx15/function-call.sublime-syntax @@ -64,20 +64,17 @@ contexts: optional-modifier: - match: \s*(\#) captures: - 1: >- - storage.modifier.js.fjsx15 - keyword.other.access.js.fjsx15 + 1: storage.modifier.js.fjsx15 - match: (?=\s*\S) pop: true identifier: + - meta_scope: meta.function-call.js.fjsx15 - match: | (?xi) \s*({{commonIdentifier}}) captures: - 1: >- - function.call.js.fjsx - entity.name.variable.js.fjsx15 + 1: variable.function.js.fjsx15 pop: true template-arguments: diff --git a/syntaxes/fjsx15/function-call/arguments.sublime-syntax b/syntaxes/fjsx15/function-call/arguments.sublime-syntax index 3447bbae..8dacf654 100644 --- a/syntaxes/fjsx15/function-call/arguments.sublime-syntax +++ b/syntaxes/fjsx15/function-call/arguments.sublime-syntax @@ -22,7 +22,7 @@ contexts: - match: \s*(\() captures: 1: >- - function.call.js.fjsx15 + meta.function-call.js.fjsx15 punctuation.definition.function.arguments.begin.js.fjsx15 set: [ delimiter, optional-expression ] @@ -30,13 +30,13 @@ contexts: - match: \s*(\)) captures: 1: >- - function.call.js.fjsx15 + meta.function-call.js.fjsx15 punctuation.definition.function.arguments.end.js.fjsx15 pop: true - match: \s*(,) captures: 1: >- - function.call.js.fjsx15 + meta.function-call.js.fjsx15 punctuation.definition.function.arguments.js.fjsx15 push: optional-expression diff --git a/syntaxes/fjsx15/function.sublime-syntax b/syntaxes/fjsx15/function.sublime-syntax index 567f6a94..1cc63b9b 100644 --- a/syntaxes/fjsx15/function.sublime-syntax +++ b/syntaxes/fjsx15/function.sublime-syntax @@ -24,6 +24,7 @@ variables: contexts: main: + - include: Packages/Naomi/syntaxes/fjsx15/core.sublime-syntax#function-properties - match: | (?x) (?=\s* @@ -39,9 +40,7 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/async.no-pop.sublime-syntax - match: \s*(function) captures: - 1: >- - storage.type.js.fjsx15 - keyword.declaration.function.js.fjsx15 + 1: storage.type.function.js.fjsx15 pop: true declaration: diff --git a/syntaxes/fjsx15/function/parameter/simple.sublime-syntax b/syntaxes/fjsx15/function/parameter/simple.sublime-syntax index 3357ad45..fc5f900f 100644 --- a/syntaxes/fjsx15/function/parameter/simple.sublime-syntax +++ b/syntaxes/fjsx15/function/parameter/simple.sublime-syntax @@ -28,9 +28,7 @@ contexts: (?xi)\s* ({{commonIdentifier}}) captures: - 1: >- - function.parameter.js.fjsx15 - entity.name.variable.js.fjsx15 + 1: variable.parameter.function.js.fjsx15 set: [ optional-default-value, optional-modifier-and-type diff --git a/syntaxes/fjsx15/function/parameters.sublime-syntax b/syntaxes/fjsx15/function/parameters.sublime-syntax index 463c1d1e..bd2c977e 100644 --- a/syntaxes/fjsx15/function/parameters.sublime-syntax +++ b/syntaxes/fjsx15/function/parameters.sublime-syntax @@ -25,6 +25,7 @@ contexts: set: [ delimiters, optional-parameter ] delimiters: + - meta_scope: meta.function.declaration.js.fjsx15 - include: comment-no-pop - match: \s*(\,) captures: diff --git a/syntaxes/fjsx15/import.sublime-syntax b/syntaxes/fjsx15/import.sublime-syntax index 55093c40..f7961b3d 100644 --- a/syntaxes/fjsx15/import.sublime-syntax +++ b/syntaxes/fjsx15/import.sublime-syntax @@ -37,7 +37,7 @@ contexts: (import)\b (?=\s*\() captures: - 1: keyword.control.import.js.fjsx15 + 1: keyword.control.import-export.js.fjsx15 set: header # Import the entire module. - match: | @@ -45,7 +45,7 @@ contexts: (import)\b (?=\s*(?>"|'|`)) captures: - 1: keyword.control.import.js.fjsx15 + 1: keyword.control.import-export.js.fjsx15 set: origin-path # Other. - match: | @@ -53,11 +53,11 @@ contexts: \s*(import)\b (?!\s*\.) captures: - 1: keyword.control.import.js.fjsx15 + 1: keyword.control.import-export.js.fjsx15 set: targets header: - - include: Packages/Naomi/syntaxes/fjsx15/statement/header.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/statement.sublime-syntax#expression-only-header comment-no-pop: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax @@ -98,7 +98,7 @@ contexts: pop: true sequence: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/typeof.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/operator/typeof.sublime-syntax # Type. - match: \s*(type)\b captures: @@ -125,7 +125,7 @@ contexts: captures: 1: >- import.js.fjsx15 - entity.name.ambiguous.js.fjsx15 + variable.other.readwrite.js.fjsx15 set: optional-alias types: diff --git a/syntaxes/fjsx15/jest.sublime-syntax b/syntaxes/fjsx15/jest.sublime-syntax index 98e8e65d..a0bf2816 100644 --- a/syntaxes/fjsx15/jest.sublime-syntax +++ b/syntaxes/fjsx15/jest.sublime-syntax @@ -42,7 +42,7 @@ contexts: 1: >- support.lib.jest.fjsx15 entity.name.function.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 3: >- support.lib.jest.fjsx15 entity.name.function.js.fjsx15 @@ -82,7 +82,7 @@ contexts: 1: >- support.lib.jest.fjsx15 entity.name.function.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 3: >- support.lib.jest.fjsx15 entity.name.function.js.fjsx15 diff --git a/syntaxes/fjsx15/node-js.sublime-syntax b/syntaxes/fjsx15/node-js.sublime-syntax index d604b92d..0544a978 100644 --- a/syntaxes/fjsx15/node-js.sublime-syntax +++ b/syntaxes/fjsx15/node-js.sublime-syntax @@ -42,7 +42,7 @@ contexts: 1: >- support.env.node-js.js.fjsx15 entity.name.class.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 3: >- support.env.node-js.js.fjsx15 entity.name.variable.js.fjsx15 @@ -77,7 +77,7 @@ contexts: 1: >- support.env.node-js.js.fjsx15 entity.name.class.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 3: >- support.env.node-js.js.fjsx15 entity.name.class.js.fjsx15 @@ -108,7 +108,7 @@ contexts: 1: >- support.env.node-js.js.fjsx15 entity.name.class.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 3: >- support.env.node-js.js.fjsx15 entity.name.class.js.fjsx15 @@ -124,7 +124,7 @@ contexts: 1: >- support.env.node-js.js.fjsx15 entity.name.class.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 3: >- support.env.node-js.js.fjsx15 entity.name.class.js.fjsx15 diff --git a/syntaxes/fjsx15/operator/other.sublime-syntax b/syntaxes/fjsx15/operator/other.sublime-syntax index 265a4f25..09b2a8e2 100644 --- a/syntaxes/fjsx15/operator/other.sublime-syntax +++ b/syntaxes/fjsx15/operator/other.sublime-syntax @@ -41,7 +41,7 @@ contexts: set: optional-expression - match: \s*(\.)(?!\.) captures: - 1: keyword.operator.other.member-access.js.fjsx15 + 1: punctuation.accessor.js.fjsx15 set: optional-expression - match: \s*(\?) captures: diff --git a/syntaxes/fjsx15/react-js.sublime-syntax b/syntaxes/fjsx15/react-js.sublime-syntax index 430948b1..c5b754ce 100644 --- a/syntaxes/fjsx15/react-js.sublime-syntax +++ b/syntaxes/fjsx15/react-js.sublime-syntax @@ -57,7 +57,7 @@ contexts: 1: >- support.core.js.fjsx15 entity.name.variable.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 3: >- support.lib.react-js.fjsx15 entity.name.variable.js.fjsx15 @@ -100,11 +100,11 @@ contexts: 1: >- support.lib.react-js.fjsx15 entity.name.variable.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 3: >- support.lib.react-js.fjsx15 entity.name.variable.js.fjsx15 - 4: keyword.operator.other.member-access.js.fjsx15 + 4: punctuation.accessor.js.fjsx15 5: >- support.lib.react-js.fjsx15 entity.name.function.js.fjsx15 @@ -136,15 +136,15 @@ contexts: 1: >- support.lib.react-js.fjsx15 entity.name.variable.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 3: >- support.lib.react-js.fjsx15 entity.name.variable.js.fjsx15 - 4: keyword.operator.other.member-access.js.fjsx15 + 4: punctuation.accessor.js.fjsx15 5: >- support.lib.react-js.fjsx15 entity.name.variable.js.fjsx15 - 6: keyword.operator.other.member-access.js.fjsx15 + 6: punctuation.accessor.js.fjsx15 7: >- support.lib.react-js.fjsx15 entity.name.variable.js.fjsx15 @@ -156,7 +156,7 @@ contexts: \s*(\.)\s* (isRequired\b) captures: - 1: keyword.operator.other.member-access.js.fjsx15 + 1: punctuation.accessor.js.fjsx15 2: >- support.lib.react-js.fjsx15 entity.name.variable.js.fjsx15 @@ -177,7 +177,7 @@ contexts: 1: >- support.lib.react-js.fjsx15 entity.name.function.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 3: >- support.lib.react-js.fjsx15 entity.name.function.js.fjsx15 @@ -194,7 +194,7 @@ contexts: 1: >- support.core.fjsx15 entity.name.variable.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 3: >- support.lib.react-js.fjsx15 entity.name.function.js.fjsx15 @@ -213,7 +213,7 @@ contexts: 1: >- support.lib.react-js.fjsx15 entity.name.function.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 3: >- support.lib.react-js.fjsx15 entity.name.function.js.fjsx15 diff --git a/syntaxes/fjsx15/statement.sublime-syntax b/syntaxes/fjsx15/statement.sublime-syntax index 69837a16..6f9ff341 100644 --- a/syntaxes/fjsx15/statement.sublime-syntax +++ b/syntaxes/fjsx15/statement.sublime-syntax @@ -80,6 +80,11 @@ contexts: 1: punctuation.definition.control.header.begin.js.fjsx15 set: [ condition-end, optional-expression ] + optional-expression-only-header: + - include: expression-only-header + - match: (?=\s*\S) + pop: true + block: - match: \s*({) captures: @@ -100,7 +105,7 @@ contexts: \s*(break|continue)\b (?:\s+({{commonIdentifier}}))? captures: - 1: keyword.other.js.fjsx15 + 1: keyword.control.loop.js.fjsx15 2: entity.name.label.js.fjsx15 pop: true @@ -113,23 +118,23 @@ contexts: do-while: - match: \s*(do)\b captures: - 1: keyword.other.js.fjsx15 + 1: keyword.control.loop.js.fjsx15 pop: true - match: \s*(while)\b captures: - 1: keyword.other.js.fjsx15 + 1: keyword.control.loop.js.fjsx15 set: expression-only-header empty: - match: \s*(;) captures: - 1: keyword.other.terminator.js.fjsx15 + 1: punctuation.terminator.js.fjsx15 pop: true for: - match: \s*(for) captures: - 1: keyword.other.js.fjsx15 + 1: keyword.control.loop.js.fjsx15 set: [ for-header, optional-await @@ -138,11 +143,11 @@ contexts: if-else: - match: \s*(if)\b captures: - 1: keyword.other.js.fjsx15 + 1: keyword.control.conditional.js.fjsx15 set: expression-only-header - match: \s*(else)\b captures: - 1: keyword.other.js.fjsx15 + 1: keyword.control.conditional.js.fjsx15 pop: true label: @@ -158,31 +163,31 @@ contexts: return: - match: \s*(return)\b captures: - 1: keyword.other.js.fjsx15 + 1: keyword.control.flow.js.fjsx15 set: optional-expression throw: - match: \s*(throw)\b captures: - 1: keyword.other.js.fjsx15 + 1: keyword.control.trycatch.js.fjsx15 set: optional-expression try-catch-finally: - match: \s*(try)\b captures: - 1: keyword.other.js.fjsx15 + 1: keyword.control.trycatch.js.fjsx15 pop: true - match: \s*(catch)\b captures: - 1: keyword.other.js.fjsx15 - set: expression-only-header + 1: keyword.control.trycatch.js.fjsx15 + set: optional-expression-only-header - match: \s*(finally)\b captures: - 1: keyword.other.js.fjsx15 + 1: keyword.control.trycatch.js.fjsx15 pop: true yield: - match: \s*(yield)\b captures: - 1: keyword.other.js.fjsx15 + 1: keyword.control.flow.js.fjsx15 set: optional-expression diff --git a/syntaxes/fjsx15/variable-declaration.sublime-syntax b/syntaxes/fjsx15/variable-declaration.sublime-syntax index 0a251dba..22e918da 100644 --- a/syntaxes/fjsx15/variable-declaration.sublime-syntax +++ b/syntaxes/fjsx15/variable-declaration.sublime-syntax @@ -81,63 +81,10 @@ variables: contexts: main: - # Normal arrow function assigned to variable. - - match: | - (?x) - (?= - \s*(?>const|let|var)\b - \s*{{commonIdentifier}} - \s*= - \s*(?:async\b)? - \s*{{templateArguments}}? - \s*{{parameters}} - \s*{{type}}? - \s*=> - ) - set: [ - normal-arrow-function, - function-identifier, - keyword - ] - # Single parameter arrow function assigned to variable. - - match: | - (?x) - (?= - \s*(?>const|let|var)\b - \s*{{commonIdentifier}} - \s*= - \s*(?:async\b)? - \s*{{commonIdentifier}} - \s*{{type}}? - \s*=> - ) - set: [ - single-parameter-arrow-function, - function-identifier, - keyword - ] - # Function assigned to variable. - - match: | - (?x) - (?= - \s*(?>const|let|var)\b - \s*{{commonIdentifier}} - \s*= - \s*(?:async\b)? - \s*function - ) - set: [ - function, - function-identifier, - keyword - ] - - # Normal variable declaration. - match: | (?x) (?=\s*(?>const|let|var)\b) set: [ - optional-type, variables, keyword ] @@ -146,41 +93,13 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax keyword: - - include: comment-no-pop - match: | (?x)\s* ((?>const|let|var)) captures: - 1: >- - storage.type.js.fjsx15 - keyword.declaration.variable.js.fjsx15 - pop: true - - function: - - include: Packages/Naomi/syntaxes/fjsx15/function.sublime-syntax - - function-identifier: - - match: | - (?xi) - \s*({{commonIdentifier}}) - \s*(=) - captures: - 0: meta.function.declaration.js.fjsx15 - 1: entity.name.function.js.fjsx15 - 2: punctuation.definition.function.assignment.js.fjsx1 + 1: storage.type.js.fjsx15 pop: true - normal-arrow-function: - - include: Packages/Naomi/syntaxes/fjsx15/async.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/parameters.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/parameters.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/body.sublime-syntax - - single-parameter-arrow-function: - - include: Packages/Naomi/syntaxes/fjsx15/async.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/simple.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/body.sublime-syntax - variables: - include: comment-no-pop - include: Packages/Naomi/syntaxes/fjsx15/destructuring/array.sublime-syntax diff --git a/syntaxes/fjsx15/variable.sublime-syntax b/syntaxes/fjsx15/variable.sublime-syntax index 02ab64b7..28d7a67b 100644 --- a/syntaxes/fjsx15/variable.sublime-syntax +++ b/syntaxes/fjsx15/variable.sublime-syntax @@ -21,13 +21,163 @@ variables: commonIdentifier: | [$_[:alpha:]] [$_[:alnum:]]* + templateArguments: | + (< + [^<>]* + \g<-1>? + [^<>]* + >) + + parameters: | + (\( + [^()]* + \g<-1>? + [^()]* + \)) + + flowOperators: | + (?> &(?!&) + | \|(?!\|) + ) + + string: | + (?> '.*?' + | ".*?" + | `.*` + ) + + simpleFlowType: | + (?> {{string}} + | {{commonIdentifier}} + {{templateArguments}}? + ) + + flowFunction: | + ( + {{parameters}} + \s*=>\s* + (?> {{simpleFlowType}} + | \g<-2> + ) + ) + + complexType: | + ( + \??\s* + (?> {{simpleFlowType}} + | {{flowFunction}} + ) + \s*{{flowOperators}}? + \s*\g<-5>? + ) + + flowComment: /\*\s*:.*?\*/ + + type: | + (?> {{flowComment}} + | :{{complexType}} + ) contexts: main: - - include: support-variable - - include: common-variable + - include: function-assigned-to-variable + - include: object + - include: simple + + function-assigned-to-variable: + # Normal arrow function assigned to variable. + - match: | + (?x) + (?= + \s*{{commonIdentifier}} + \s*{{type}}? + \s*= + \s*(?:async\b)? + \s*{{templateArguments}}? + \s*{{parameters}} + \s*{{type}}? + \s*=> + ) + set: [ + normal-arrow-function, + optional-type, + function-identifier + ] + # Single parameter arrow function assigned to variable. + - match: | + (?x) + (?= + \s*{{commonIdentifier}} + \s*{{type}}? + \s*= + \s*(?:async\b)? + \s*{{commonIdentifier}} + \s*{{type}}? + \s*=> + ) + set: [ + single-parameter-arrow-function, + optional-type, + function-identifier + ] + # Function assigned to variable. + - match: | + (?x) + (?= + \s*{{commonIdentifier}} + \s*{{type}}? + \s*= + \s*(?:async\b)? + \s*function + ) + set: [ + function, + optional-type, + function-identifier + ] + + comment-no-pop: + - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - common-variable: + function: + - include: Packages/Naomi/syntaxes/fjsx15/function.sublime-syntax + + function-identifier: + - match: | + (?xi) + \s*({{commonIdentifier}}) + captures: + 0: meta.function.declaration.js.fjsx15 + 1: entity.name.function.js.fjsx15 + pop: true + + normal-arrow-function: + - include: Packages/Naomi/syntaxes/fjsx15/async.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/parameters.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/parameters.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/body.sublime-syntax + + single-parameter-arrow-function: + - include: Packages/Naomi/syntaxes/fjsx15/async.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/simple.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/body.sublime-syntax + + optional-type: + - include: comment-no-pop + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-associated-type.sublime-syntax + + object: + - match: | + (?xi)\s* + (\#)? + ({{commonIdentifier}}) + (?=\s*\.) + captures: + 1: storage.modifier.js.fjsx15 + 2: variable.other.object.js.fjsx15 + pop: true + + simple: # Single character. - match: | (?xi)\s* @@ -36,10 +186,8 @@ contexts: | [_[:alpha:]]\b )) captures: - 1: >- - storage.modifier.js.fjsx15 - keyword.operator.other.access.js.fjsx15 - 2: entity.name.variable.js.fjsx15 + 1: storage.modifier.js.fjsx15 + 2: variable.other.readwrite.js.fjsx15 pop: true # Two or more characters. - match: | @@ -52,20 +200,6 @@ contexts: ) ) captures: - 1: >- - storage.modifier.js.fjsx15 - keyword.operator.other.access.js.fjsx15 - 2: entity.name.variable.js.fjsx15 - pop: true - - support-variable: - - match: | - (?xi)\s* - ((?> super - | this - ))\b - captures: - 1: >- - support.js.fjsx15 - entity.name.variable.js.fjsx15 + 1: storage.modifier.js.fjsx15 + 2: variable.other.readwrite.js.fjsx15 pop: true diff --git a/syntaxes/fjsx15/web.sublime-syntax b/syntaxes/fjsx15/web.sublime-syntax index 33f04dbe..ccacb2d8 100644 --- a/syntaxes/fjsx15/web.sublime-syntax +++ b/syntaxes/fjsx15/web.sublime-syntax @@ -81,7 +81,7 @@ contexts: 1: >- support.core.js.fjsx15 entity.name.variable.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 3: >- support.core.js.fjsx15 entity.name.function.js.fjsx15 @@ -193,7 +193,7 @@ contexts: 1: >- support.core.js.fjsx15 entity.name.class.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 3: >- support.core.js.fjsx15 entity.name.function.js.fjsx15 @@ -253,7 +253,7 @@ contexts: 1: >- support.core.js.fjsx15 entity.name.class.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 3: >- support.core.js.fjsx15 entity.name.function.js.fjsx15 From bc1eaf211d755567306f88dda1cc77384684f3f5 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 17 Dec 2017 20:07:36 -0200 Subject: [PATCH 219/407] [FJSX15] Make functions assigned to variable overpower constant --- syntaxes/fjsx15/expression.sublime-syntax | 1 + syntaxes/fjsx15/variable-declaration.sublime-syntax | 1 + 2 files changed, 2 insertions(+) diff --git a/syntaxes/fjsx15/expression.sublime-syntax b/syntaxes/fjsx15/expression.sublime-syntax index 69ba47bd..385766a3 100644 --- a/syntaxes/fjsx15/expression.sublime-syntax +++ b/syntaxes/fjsx15/expression.sublime-syntax @@ -100,6 +100,7 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/class.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function-call.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/variable.sublime-syntax#function-assigned-to-variable - include: Packages/Naomi/syntaxes/fjsx15/constant.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/variable.sublime-syntax diff --git a/syntaxes/fjsx15/variable-declaration.sublime-syntax b/syntaxes/fjsx15/variable-declaration.sublime-syntax index 22e918da..ec793cd8 100644 --- a/syntaxes/fjsx15/variable-declaration.sublime-syntax +++ b/syntaxes/fjsx15/variable-declaration.sublime-syntax @@ -104,6 +104,7 @@ contexts: - include: comment-no-pop - include: Packages/Naomi/syntaxes/fjsx15/destructuring/array.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/destructuring/object.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/variable.sublime-syntax#function-assigned-to-variable - include: Packages/Naomi/syntaxes/fjsx15/constant.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/variable.sublime-syntax From b32f658d7145217670d4da0102a3fb43d289386d Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 17 Dec 2017 20:07:50 -0200 Subject: [PATCH 220/407] [FJSX15] Enhance object access prediction --- syntaxes/fjsx15/constant.sublime-syntax | 15 +++++++++++++++ syntaxes/fjsx15/variable.sublime-syntax | 3 +-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/syntaxes/fjsx15/constant.sublime-syntax b/syntaxes/fjsx15/constant.sublime-syntax index 9eae794c..fdd2593d 100644 --- a/syntaxes/fjsx15/constant.sublime-syntax +++ b/syntaxes/fjsx15/constant.sublime-syntax @@ -24,6 +24,21 @@ variables: contexts: main: + - include: object + - include: normal + + object: + - match: | + (?xi)\s* + (\#)? + ({{constantIdentifier}}) + (?=\s*\??\.) + captures: + 1: storage.modifier.js.fjsx15 + 2: variable.other.object.constant.js.fjsx15 + pop: true + + normal: # Single character. - match: | (?x)\s* diff --git a/syntaxes/fjsx15/variable.sublime-syntax b/syntaxes/fjsx15/variable.sublime-syntax index 28d7a67b..e628df55 100644 --- a/syntaxes/fjsx15/variable.sublime-syntax +++ b/syntaxes/fjsx15/variable.sublime-syntax @@ -80,7 +80,6 @@ variables: contexts: main: - - include: function-assigned-to-variable - include: object - include: simple @@ -171,7 +170,7 @@ contexts: (?xi)\s* (\#)? ({{commonIdentifier}}) - (?=\s*\.) + (?=\s*\??\.) captures: 1: storage.modifier.js.fjsx15 2: variable.other.object.js.fjsx15 From d9a5086e6acca6fe93e822becd9424fde1b6c051 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 17 Dec 2017 20:13:00 -0200 Subject: [PATCH 221/407] [FJSX15] Enhance function call on pipeline operator --- syntaxes/fjsx15/operator/pipe.sublime-syntax | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/syntaxes/fjsx15/operator/pipe.sublime-syntax b/syntaxes/fjsx15/operator/pipe.sublime-syntax index 7d94a5fb..049cc4af 100644 --- a/syntaxes/fjsx15/operator/pipe.sublime-syntax +++ b/syntaxes/fjsx15/operator/pipe.sublime-syntax @@ -27,21 +27,25 @@ contexts: - match: \s*(\|>) captures: 1: keyword.operator.other.pipe.js.fjsx15 - set: function-or-expression + set: target - function-or-expression: + target: - include: Packages/Naomi/syntaxes/fjsx15/arrow-function.sublime-syntax # Await keyword. - match: \s*(await)\b captures: 1: keyword.control.js.fjsx15 - pop: true + set: function-identifier + # Simple identifier. + - include: function-identifier + + function-identifier: # Simple function. - match: | (?xi)\s* ({{commonIdentifier}}) captures: - 1: entity.name.function.js.fjsx15 + 1: variable.function.js.fjsx15 pop: true # Other expressions. - match: (?=\s*\S) From 1748445ecd817cf91748460710837d5e3de6876b Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 17 Dec 2017 20:36:52 -0200 Subject: [PATCH 222/407] [FJSX15] Simplify and normalize string literal scopes --- .../string/double-quoted.sublime-syntax | 38 +++++-------- .../string/single-quoted.sublime-syntax | 38 +++++-------- .../literal/string/template.sublime-syntax | 56 +++++++------------ 3 files changed, 48 insertions(+), 84 deletions(-) diff --git a/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax b/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax index 086a447d..27923d8a 100644 --- a/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax +++ b/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax @@ -40,33 +40,23 @@ contexts: 1: >- string.quoted.double.js.fjsx15 punctuation.definition.string.begin.js.fjsx15 - with_prototype: - - match: (?- - string.quoted.double.js.fjsx15 - punctuation.definition.string.end.js.fjsx15 - set: optional-property-access - set: escape-a - - optional-property-access: - - include: Packages/Naomi/syntaxes/fjsx15/property-access.sublime-syntax - - match: (?=\S) - pop: true + set: string trap: - meta_content_scope: context.trap - escape-a: - - meta_content_scope: string.quoted.double.js.fjsx15 - - match: (?xi){{doubleQuotedEscapeSequences}} - scope: constant.character.escape.a.js.fjsx15 - set: escape-b - - escape-b: + string: - meta_content_scope: string.quoted.double.js.fjsx15 + # New line trap. + - match: (?- + string.quoted.double.js.fjsx15 + punctuation.definition.string.end.js.fjsx15 + pop: true + # Escape. - match: (?xi){{doubleQuotedEscapeSequences}} - scope: constant.character.escape.b.js.fjsx15 - set: escape-a + scope: constant.character.escape.js.fjsx15 diff --git a/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax b/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax index e52a0f61..77461540 100644 --- a/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax +++ b/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax @@ -40,33 +40,23 @@ contexts: 1: >- string.quoted.single.js.fjsx15 punctuation.definition.string.begin.js.fjsx15 - with_prototype: - - match: (?- - string.quoted.single.js.fjsx15 - punctuation.definition.string.end.js.fjsx15 - set: optional-property-access - set: escape-a - - optional-property-access: - - include: Packages/Naomi/syntaxes/fjsx15/property-access.sublime-syntax - - match: (?=\S) - pop: true + set: string trap: - meta_content_scope: context.trap - escape-a: - - meta_content_scope: string.quoted.single.js.fjsx15 - - match: (?xi){{singleQuotedEscapeSequences}} - scope: constant.character.escape.a.js.fjsx15 - set: escape-b - - escape-b: + string: - meta_content_scope: string.quoted.single.js.fjsx15 + # New line trap. + - match: (?- + string.quoted.single.js.fjsx15 + punctuation.definition.string.end.js.fjsx15 + pop: true + # Escape. - match: (?xi){{singleQuotedEscapeSequences}} - scope: constant.character.escape.b.js.fjsx15 - set: escape-a + scope: constant.character.escape.js.fjsx15 diff --git a/syntaxes/fjsx15/literal/string/template.sublime-syntax b/syntaxes/fjsx15/literal/string/template.sublime-syntax index c6f2f849..2fd5f273 100644 --- a/syntaxes/fjsx15/literal/string/template.sublime-syntax +++ b/syntaxes/fjsx15/literal/string/template.sublime-syntax @@ -44,50 +44,34 @@ contexts: \s*({{commonIdentifier}})? \s*(\`) captures: - 0: string.template.js.fjsx15 1: entity.name.function.tag.js.fjsx15 2: punctuation.definition.string.begin.js.fjsx15 - set: escape-a + set: string - escape-a: - - meta_content_scope: string.template.js.fjsx15 - - match: (?xi){{escapeSequences}} - scope: constant.character.escape.a.js.fjsx15 - set: escape-b - - include: embedded-expression - - include: template-end - - escape-b: - - meta_content_scope: string.template.js.fjsx15 + string: + - meta_scope: string.template.js.fjsx15 + # Close. + - match: \` + scope: punctuation.definition.string.end.js.fjsx15 + pop: true + # Escape. - match: (?xi){{escapeSequences}} - scope: constant.character.escape.b.js.fjsx15 - set: escape-a - - include: embedded-expression - - include: template-end - - embedded-expression: - - match: \$\{ - scope: keyword.operator.other.embedded-expression.begin.js.fjsx15 + scope: constant.character.escape.js.fjsx15 + # # Embedded expression. + - match: \s*(\$\{) + captures: + 1: punctuation.definition.template-expression.begin.js.fjsx15 push: [ close-embedded-expression, embedded-content ] close-embedded-expression: - - match: \} - scope: keyword.operator.other.embedded-expression.end.js.fjsx15 + - clear_scopes: true + - meta_scope: >- + source.js.fjsx15 + meta.template-expression.js.fjsx15 + - match: \s*(}) + captures: + 1: punctuation.definition.template-expression.end.js.fjsx15 pop: true embedded-content: - - clear_scopes: true - - meta_scope: source.js.fjsx15 - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax - - template-end: - - match: \` - scope: >- - string.template.js.fjsx15 - punctuation.definition.string.end.js.fjsx15 - set: optional-property-access - - optional-property-access: - - include: Packages/Naomi/syntaxes/fjsx15/property-access.sublime-syntax - - match: (?=\S) - pop: true From 391730bb9aeee67b2c37a57bfb430c251fc48516 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 17 Dec 2017 20:56:57 -0200 Subject: [PATCH 223/407] [FJSX15] Fix and clean operators --- syntaxes/fjsx15/operator/other.sublime-syntax | 34 +++---------------- 1 file changed, 5 insertions(+), 29 deletions(-) diff --git a/syntaxes/fjsx15/operator/other.sublime-syntax b/syntaxes/fjsx15/operator/other.sublime-syntax index 09b2a8e2..29a0e1ce 100644 --- a/syntaxes/fjsx15/operator/other.sublime-syntax +++ b/syntaxes/fjsx15/operator/other.sublime-syntax @@ -29,15 +29,15 @@ contexts: main: - match: \s*(\:{2}) captures: - 1: keyword.operator.other.bind.js.fjsx15 + 1: keyword.operator.bind.js.fjsx15 set: optional-expression - match: \s*(\?\?) captures: - 1: keyword.operator.other.nullish-coalescing.js.fjsx15 + 1: keyword.operator.nullish-coalescing.js.fjsx15 set: optional-expression - match: \s*(\?\.) captures: - 1: keyword.operator.other.optional-chain.js.fjsx15 + 1: keyword.operator.optional-chain.js.fjsx15 set: optional-expression - match: \s*(\.)(?!\.) captures: @@ -45,41 +45,17 @@ contexts: set: optional-expression - match: \s*(\?) captures: - 1: keyword.operator.other.ternary.js.fjsx15 + 1: keyword.operator.ternary.js.fjsx15 set: [ ternary-else, optional-expression ] optional-expression: - # - match: \s*123 - # scope: keyword - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax - # comment: - # - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - ternary-else: - match: \s*(:) captures: - 1: keyword.operator.other.ternary.js.fjsx15 + 1: keyword.operator.ternary.js.fjsx15 set: optional-expression - - # member-access: - # - include: comment - # # Jest “not”. - # - match: | - # (?x) - # \s*(not\b) - # (?=\s*\.) - # captures: - # 1: >- - # support.lib.jest.fjsx15 - # entity.name.function.js.fjsx15 - # pop: true - # # Other members. - # - include: Packages/Naomi/syntaxes/fjsx15/arrow-function.sublime-syntax - # - include: Packages/Naomi/syntaxes/fjsx15/jest.sublime-syntax - # - include: Packages/Naomi/syntaxes/fjsx15/function-call.sublime-syntax - # - include: Packages/Naomi/syntaxes/fjsx15/constant.sublime-syntax - # - include: Packages/Naomi/syntaxes/fjsx15/variable.sublime-syntax From 059ff61d1c3999c702f3d3a8b3af3fd9612cb1b6 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 17 Dec 2017 21:01:00 -0200 Subject: [PATCH 224/407] [FJSX15] Restore switch statements --- syntaxes/fjsx15/statement.sublime-syntax | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/statement.sublime-syntax b/syntaxes/fjsx15/statement.sublime-syntax index 6f9ff341..49b8af3e 100644 --- a/syntaxes/fjsx15/statement.sublime-syntax +++ b/syntaxes/fjsx15/statement.sublime-syntax @@ -42,6 +42,7 @@ contexts: - include: if-else - include: label - include: return + - include: switch-case - include: throw - include: try-catch-finally - include: yield @@ -157,7 +158,7 @@ contexts: \s*(:) captures: 1: entity.name.label.js.fjsx15 - 2: keyword.operator.other.js.fjsx15 + 2: punctuation.separator.js.fjsx15 set: optional-statements-and-expressions return: @@ -166,6 +167,25 @@ contexts: 1: keyword.control.flow.js.fjsx15 set: optional-expression + switch-case: + - match: \s*(switch)\b + captures: + 1: keyword.control.switch.js.fjsx15 + set: expression-only-header + - match: \s*(case)\b + captures: + 1: keyword.control.switch.js.fjsx15 + set: [ + colon, + optional-expression + ] + + colon: + - match: \s*(:) + captures: + 1: punctuation.separator.js.fjsx15 + pop: true + throw: - match: \s*(throw)\b captures: From 482f0d5978a6421bbc91267c974701935e298f03 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 17 Dec 2017 21:19:45 -0200 Subject: [PATCH 225/407] [FJSX15] Fix JSX scopes --- syntaxes/jsx1/attribute.sublime-syntax | 2 +- syntaxes/jsx1/literal/string/double-quoted.sublime-syntax | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/syntaxes/jsx1/attribute.sublime-syntax b/syntaxes/jsx1/attribute.sublime-syntax index f7ab826d..cd344ed6 100644 --- a/syntaxes/jsx1/attribute.sublime-syntax +++ b/syntaxes/jsx1/attribute.sublime-syntax @@ -28,7 +28,7 @@ contexts: (?xi)\s* ({{commonIdentifier}}) captures: - 1: entity.name.attribute.jsx.jsx1 + 1: entity.other.attribute-name.jsx.jsx1 set: optional-value optional-value: diff --git a/syntaxes/jsx1/literal/string/double-quoted.sublime-syntax b/syntaxes/jsx1/literal/string/double-quoted.sublime-syntax index eb571657..a91316ce 100644 --- a/syntaxes/jsx1/literal/string/double-quoted.sublime-syntax +++ b/syntaxes/jsx1/literal/string/double-quoted.sublime-syntax @@ -25,7 +25,7 @@ contexts: set: string string: - - meta_scope: string.quoted.single.jsx.jsx1 + - meta_scope: string.quoted.double.jsx.jsx1 - match: \s*(\") captures: 1: punctuation.definition.string.end.jsx.jsx1 From 9668fef9ac9180bc2cf4aeb3b8a8ae1e3c07f03f Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 17 Dec 2017 22:44:48 -0200 Subject: [PATCH 226/407] [FJSX15] Remove dead code --- syntaxes/fjsx15/goto.sublime-syntax | 38 ----------------------------- 1 file changed, 38 deletions(-) delete mode 100644 syntaxes/fjsx15/goto.sublime-syntax diff --git a/syntaxes/fjsx15/goto.sublime-syntax b/syntaxes/fjsx15/goto.sublime-syntax deleted file mode 100644 index 970d1a8c..00000000 --- a/syntaxes/fjsx15/goto.sublime-syntax +++ /dev/null @@ -1,38 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - -contexts: - main: - - match: \s*(goto) - captures: - 1: keyword.control.js.fjsx15 - set: label - - label: - - match: | - (?xi) - ({{commonIdentifier}}) - captures: - 1: entity.name.label.js.fjsx15 - pop: true From d1237a51f52aa83a5d0f675cc911ccec262905a1 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 17 Dec 2017 22:45:07 -0200 Subject: [PATCH 227/407] [FJSX15] Normal support object scopes --- syntaxes/fjsx15/node-js.sublime-syntax | 24 ++++++------------------ syntaxes/fjsx15/web.sublime-syntax | 24 ++++++------------------ 2 files changed, 12 insertions(+), 36 deletions(-) diff --git a/syntaxes/fjsx15/node-js.sublime-syntax b/syntaxes/fjsx15/node-js.sublime-syntax index 0544a978..df1c3e69 100644 --- a/syntaxes/fjsx15/node-js.sublime-syntax +++ b/syntaxes/fjsx15/node-js.sublime-syntax @@ -39,13 +39,9 @@ contexts: ))\b )? captures: - 1: >- - support.env.node-js.js.fjsx15 - entity.name.class.js.fjsx15 + 1: support.type.object.module.js.fjsx15 2: punctuation.accessor.js.fjsx15 - 3: >- - support.env.node-js.js.fjsx15 - entity.name.variable.js.fjsx15 + 3: support.type.object.module.js.fjsx15 pop: true process: @@ -74,13 +70,9 @@ contexts: ))\b ) captures: - 1: >- - support.env.node-js.js.fjsx15 - entity.name.class.js.fjsx15 + 1: support.type.object.module.js.fjsx15 2: punctuation.accessor.js.fjsx15 - 3: >- - support.env.node-js.js.fjsx15 - entity.name.class.js.fjsx15 + 3: support.function.js.fjsx15 set: function-arguments # Variables. - match: | @@ -105,13 +97,9 @@ contexts: ))\b )? captures: - 1: >- - support.env.node-js.js.fjsx15 - entity.name.class.js.fjsx15 + 1: support.type.object.module.js.fjsx15 2: punctuation.accessor.js.fjsx15 - 3: >- - support.env.node-js.js.fjsx15 - entity.name.class.js.fjsx15 + 3: support.variable.js.fjsx15 pop: true functions: diff --git a/syntaxes/fjsx15/web.sublime-syntax b/syntaxes/fjsx15/web.sublime-syntax index ccacb2d8..d0a26d38 100644 --- a/syntaxes/fjsx15/web.sublime-syntax +++ b/syntaxes/fjsx15/web.sublime-syntax @@ -78,13 +78,9 @@ contexts: ))\b ) captures: - 1: >- - support.core.js.fjsx15 - entity.name.variable.js.fjsx15 + 1: support.type.object.dom.js.fjsx15 2: punctuation.accessor.js.fjsx15 - 3: >- - support.core.js.fjsx15 - entity.name.function.js.fjsx15 + 3: support.function.js.fjsx15 set: optional-template-and-arguments document-properties: @@ -190,13 +186,9 @@ contexts: ))\b ) captures: - 1: >- - support.core.js.fjsx15 - entity.name.class.js.fjsx15 + 1: support.type.object.dom.js.fjsx15 2: punctuation.accessor.js.fjsx15 - 3: >- - support.core.js.fjsx15 - entity.name.function.js.fjsx15 + 3: support.variable.js.fjsx15 pop: true window-functions: @@ -250,11 +242,7 @@ contexts: ))\b ) captures: - 1: >- - support.core.js.fjsx15 - entity.name.class.js.fjsx15 + 1: support.type.object.dom.js.fjsx15 2: punctuation.accessor.js.fjsx15 - 3: >- - support.core.js.fjsx15 - entity.name.function.js.fjsx15 + 3: support.function.js.fjsx15 set: optional-template-and-arguments From f543c59889dd1843b5b1d4068579c23e3fe7b742 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 17 Dec 2017 22:45:17 -0200 Subject: [PATCH 228/407] [FJSX15] Normalize decorator scopes --- syntaxes/fjsx15/decorator.sublime-syntax | 2 +- syntaxes/fjsx15/decorator/identifier.sublime-syntax | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/syntaxes/fjsx15/decorator.sublime-syntax b/syntaxes/fjsx15/decorator.sublime-syntax index 76060f51..5541a3c0 100644 --- a/syntaxes/fjsx15/decorator.sublime-syntax +++ b/syntaxes/fjsx15/decorator.sublime-syntax @@ -29,7 +29,7 @@ contexts: \s*(@) (?={{decoratorIdentifier}}) captures: - 1: punctuation.definition.decorator.js.fjsx15 + 1: punctuation.definition.annotation.js.fjsx15 set: identifier identifier: diff --git a/syntaxes/fjsx15/decorator/identifier.sublime-syntax b/syntaxes/fjsx15/decorator/identifier.sublime-syntax index c26d407c..7203256c 100644 --- a/syntaxes/fjsx15/decorator/identifier.sublime-syntax +++ b/syntaxes/fjsx15/decorator/identifier.sublime-syntax @@ -30,7 +30,7 @@ contexts: ({{decoratorIdentifier}}) (?=\s*\() captures: - 1: entity.name.decorator.js.fjsx15 + 1: variable.annotation.js.fjsx15 set: [ possible-chain, arguments @@ -40,7 +40,7 @@ contexts: (?xi)\s* ({{decoratorIdentifier}}) captures: - 1: entity.name.decorator.js.fjsx15 + 1: variable.annotation.js.fjsx15 set: possible-chain arguments: From e1415680bcbc499e486d7e58a7f0f935659e3431 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 17 Dec 2017 23:01:28 -0200 Subject: [PATCH 229/407] [FJSX15] Normal globals' scopes --- syntaxes/fjsx15/core.sublime-syntax | 16 ++--- syntaxes/fjsx15/expression.sublime-syntax | 2 +- syntaxes/fjsx15/node-js.sublime-syntax | 12 +--- syntaxes/fjsx15/react-js.sublime-syntax | 84 ++++++----------------- 4 files changed, 29 insertions(+), 85 deletions(-) diff --git a/syntaxes/fjsx15/core.sublime-syntax b/syntaxes/fjsx15/core.sublime-syntax index f6e11e74..10345d2d 100644 --- a/syntaxes/fjsx15/core.sublime-syntax +++ b/syntaxes/fjsx15/core.sublime-syntax @@ -98,13 +98,9 @@ contexts: | SQRT(?>1_2|2) ))\b captures: - 1: >- - support.core.js.fjsx15 - entity.name.class.js.fjsx15 + 1: support.class.builtin.js.fjsx15 2: punctuation.accessor.js.fjsx15 - 3: >- - support.core.js.fjsx15 - entity.name.constant.js.fjsx15 + 3: support.constant.js.fjsx15 pop: true math-functions: @@ -200,13 +196,9 @@ contexts: | unscopables ))\b captures: - 1: >- - support.core.js.fjsx15 - entity.name.class.js.fjsx15 + 1: support.class.builtin.js.fjsx15 2: punctuation.accessor.js.fjsx15 - 3: >- - support.core.js.fjsx15 - entity.name.constant.js.fjsx15 + 3: support.variable.js.fjsx15 pop: true constants: diff --git a/syntaxes/fjsx15/expression.sublime-syntax b/syntaxes/fjsx15/expression.sublime-syntax index 385766a3..ca9b5c8b 100644 --- a/syntaxes/fjsx15/expression.sublime-syntax +++ b/syntaxes/fjsx15/expression.sublime-syntax @@ -86,11 +86,11 @@ contexts: set: optional-tail globals: - - include: Packages/Naomi/syntaxes/fjsx15/core.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/node-js.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/react-js.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/jest.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/web.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/core.sublime-syntax head: - include: comment-no-pop diff --git a/syntaxes/fjsx15/node-js.sublime-syntax b/syntaxes/fjsx15/node-js.sublime-syntax index df1c3e69..0c8e5f04 100644 --- a/syntaxes/fjsx15/node-js.sublime-syntax +++ b/syntaxes/fjsx15/node-js.sublime-syntax @@ -109,13 +109,7 @@ contexts: | require ))\b captures: - 1: >- - support.env.node-js.js.fjsx15 - entity.name.class.js.fjsx15 - 2: punctuation.accessor.js.fjsx15 - 3: >- - support.env.node-js.js.fjsx15 - entity.name.class.js.fjsx15 + 1: support.function.js.fjsx15 set: function-arguments constants: @@ -125,7 +119,5 @@ contexts: | __filename ))\b captures: - 1: >- - support.env.node-js.js.fjsx15 - entity.name.constant.js.fjsx15 + 1: support.variable.js.fjsx15 pop: true diff --git a/syntaxes/fjsx15/react-js.sublime-syntax b/syntaxes/fjsx15/react-js.sublime-syntax index c5b754ce..d5737f23 100644 --- a/syntaxes/fjsx15/react-js.sublime-syntax +++ b/syntaxes/fjsx15/react-js.sublime-syntax @@ -38,29 +38,21 @@ contexts: | state ))\b captures: - 1: >- - support.core.js.fjsx15 - entity.name.variable.js.fjsx15 + 1: support.type.object.js.fjsx15 set: optional-property-type-and-value instance-variables: - match: | - (?x)\s* - (?: - (this) - \s*(\.)\s* - ) + (?x) + \s*(this) + \s*(\.)\s* ((?> props | state ))\b captures: - 1: >- - support.core.js.fjsx15 - entity.name.variable.js.fjsx15 + 1: variable.language.this.js.fjsx15 2: punctuation.accessor.js.fjsx15 - 3: >- - support.lib.react-js.fjsx15 - entity.name.variable.js.fjsx15 + 3: support.type.object.js.fjsx15 pop: true static-variables: @@ -73,12 +65,8 @@ contexts: | propTypes ))\b captures: - 1: >- - storage.modifier.js.fjsx15 - keyword.other.access.js.fjsx15 - 2: >- - support.lib.react-js.fjsx15 - entity.name.variable.js.fjsx15 + 1: storage.modifier.js.fjsx15 + 2: support.type.object.fjsx15 set: optional-property-type-and-value proptypes: @@ -97,17 +85,11 @@ contexts: )) (?=\s*\() captures: - 1: >- - support.lib.react-js.fjsx15 - entity.name.variable.js.fjsx15 + 1: support.type.object.fjsx15 2: punctuation.accessor.js.fjsx15 - 3: >- - support.lib.react-js.fjsx15 - entity.name.variable.js.fjsx15 + 3: support.type.object.fjsx15 4: punctuation.accessor.js.fjsx15 - 5: >- - support.lib.react-js.fjsx15 - entity.name.function.js.fjsx15 + 5: support.function.fjsx15 set: arguments # Normal. - match: | @@ -133,21 +115,13 @@ contexts: (isRequired\b) )? captures: - 1: >- - support.lib.react-js.fjsx15 - entity.name.variable.js.fjsx15 + 1: support.type.object.fjsx15 2: punctuation.accessor.js.fjsx15 - 3: >- - support.lib.react-js.fjsx15 - entity.name.variable.js.fjsx15 + 3: support.type.object.fjsx15 4: punctuation.accessor.js.fjsx15 - 5: >- - support.lib.react-js.fjsx15 - entity.name.variable.js.fjsx15 + 5: support.type.object.fjsx15 6: punctuation.accessor.js.fjsx15 - 7: >- - support.lib.react-js.fjsx15 - entity.name.variable.js.fjsx15 + 7: support.variable.fjsx15 pop: true # “isRequired” after function call. - match: | @@ -157,9 +131,7 @@ contexts: (isRequired\b) captures: 1: punctuation.accessor.js.fjsx15 - 2: >- - support.lib.react-js.fjsx15 - entity.name.variable.js.fjsx15 + 2: support.variable.fjsx15 pop: true functions: @@ -174,13 +146,9 @@ contexts: | isValidElement ))\b captures: - 1: >- - support.lib.react-js.fjsx15 - entity.name.function.js.fjsx15 + 1: support.type.object.fjsx15 2: punctuation.accessor.js.fjsx15 - 3: >- - support.lib.react-js.fjsx15 - entity.name.function.js.fjsx15 + 3: support.function.fjsx15 set: arguments # Component functions. - match: | @@ -191,13 +159,9 @@ contexts: | setState ))\b captures: - 1: >- - support.core.fjsx15 - entity.name.variable.js.fjsx15 + 1: variable.language.this.js.fjsx15 2: punctuation.accessor.js.fjsx15 - 3: >- - support.lib.react-js.fjsx15 - entity.name.function.js.fjsx15 + 3: support.function.fjsx15 set: arguments react-dom-functions: @@ -210,11 +174,7 @@ contexts: | unmountComponentAtNode ))\b captures: - 1: >- - support.lib.react-js.fjsx15 - entity.name.function.js.fjsx15 + 1: support.type.object.fjsx15 2: punctuation.accessor.js.fjsx15 - 3: >- - support.lib.react-js.fjsx15 - entity.name.function.js.fjsx15 + 3: support.function.fjsx15 set: arguments From ccdfef0441038fb1cead51521ca63a5d7b46c02c Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 17 Dec 2017 23:12:18 -0200 Subject: [PATCH 230/407] [FJSX15] Fix comma scope --- syntaxes/fjsx15/operator/comma.sublime-syntax | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/operator/comma.sublime-syntax b/syntaxes/fjsx15/operator/comma.sublime-syntax index 3d16ea7d..37e1134b 100644 --- a/syntaxes/fjsx15/operator/comma.sublime-syntax +++ b/syntaxes/fjsx15/operator/comma.sublime-syntax @@ -21,7 +21,7 @@ contexts: main: - match: \s*(,) captures: - 1: keyword.operator.other.comma.js.fjsx15 + 1: punctuation.separator.comma.js.fjsx15 set: optional-expression optional-expression: From 3a29856a4602dbf5b6b4ec5b70699e7ae9d13bdc Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 17 Dec 2017 23:13:34 -0200 Subject: [PATCH 231/407] [FJSX15] Fix ASI bug on return and throw --- syntaxes/fjsx15/statement.sublime-syntax | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/syntaxes/fjsx15/statement.sublime-syntax b/syntaxes/fjsx15/statement.sublime-syntax index 49b8af3e..395ba602 100644 --- a/syntaxes/fjsx15/statement.sublime-syntax +++ b/syntaxes/fjsx15/statement.sublime-syntax @@ -72,6 +72,11 @@ contexts: - match: "" push: optional-statements-and-expressions + asi-checked-optional-expression: + - match: (?=\s*\n) + pop: true + - include: optiona-expression + optional-expression: - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax @@ -165,7 +170,7 @@ contexts: - match: \s*(return)\b captures: 1: keyword.control.flow.js.fjsx15 - set: optional-expression + set: asi-checked-optional-expression switch-case: - match: \s*(switch)\b @@ -190,7 +195,7 @@ contexts: - match: \s*(throw)\b captures: 1: keyword.control.trycatch.js.fjsx15 - set: optional-expression + set: asi-checked-optional-expression try-catch-finally: - match: \s*(try)\b From 72369103902947e594bbaa43d866d8fc568d2e88 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 17 Dec 2017 23:17:26 -0200 Subject: [PATCH 232/407] [FJSX15] Fix support function body contents --- syntaxes/fjsx15/function/support/body.sublime-syntax | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/syntaxes/fjsx15/function/support/body.sublime-syntax b/syntaxes/fjsx15/function/support/body.sublime-syntax index 8a88a7e2..48e53eac 100644 --- a/syntaxes/fjsx15/function/support/body.sublime-syntax +++ b/syntaxes/fjsx15/function/support/body.sublime-syntax @@ -34,8 +34,8 @@ contexts: punctuation.definition.function.body.end.js.fjsx15 pop: true - match: "" - push: - - match: (?=\s*}) - pop: true - # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + push: optional-statements-and-expressions + + optional-statements-and-expressions: + - include: Packages/Naomi/syntaxes/fjsx15/optional-statements-and-expressions.sublime-syntax From 67486cd1e0b99ddcd634b8d936c3872b2dc4a569 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 17 Dec 2017 23:19:17 -0200 Subject: [PATCH 233/407] [FJSX15] Fix typo in ASI checked expressions --- syntaxes/fjsx15/statement.sublime-syntax | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/statement.sublime-syntax b/syntaxes/fjsx15/statement.sublime-syntax index 395ba602..d9d5c2ec 100644 --- a/syntaxes/fjsx15/statement.sublime-syntax +++ b/syntaxes/fjsx15/statement.sublime-syntax @@ -75,7 +75,7 @@ contexts: asi-checked-optional-expression: - match: (?=\s*\n) pop: true - - include: optiona-expression + - include: optional-expression optional-expression: - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax From bea131fd4ec686695530f3c78d316d7058b69334 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 17 Dec 2017 23:30:44 -0200 Subject: [PATCH 234/407] [FJSX15] Normalize operator scopes --- syntaxes/fjsx15/operator/delete.sublime-syntax | 2 +- syntaxes/fjsx15/operator/new.sublime-syntax | 4 ++-- syntaxes/fjsx15/operator/of.sublime-syntax | 2 +- syntaxes/fjsx15/operator/pipe.sublime-syntax | 2 +- syntaxes/fjsx15/operator/rest.sublime-syntax | 2 +- syntaxes/fjsx15/operator/spread.sublime-syntax | 2 +- syntaxes/fjsx15/operator/typeof.sublime-syntax | 9 ++++----- syntaxes/fjsx15/operator/void.sublime-syntax | 2 +- 8 files changed, 12 insertions(+), 13 deletions(-) diff --git a/syntaxes/fjsx15/operator/delete.sublime-syntax b/syntaxes/fjsx15/operator/delete.sublime-syntax index 836ef5c1..cbd319ca 100644 --- a/syntaxes/fjsx15/operator/delete.sublime-syntax +++ b/syntaxes/fjsx15/operator/delete.sublime-syntax @@ -21,7 +21,7 @@ contexts: main: - match: \s*(delete) captures: - 1: keyword.other.js.fjsx15 + 1: keyword.operator.js.fjsx15 set: optional-expression optional-expression: diff --git a/syntaxes/fjsx15/operator/new.sublime-syntax b/syntaxes/fjsx15/operator/new.sublime-syntax index 6cd1c720..187c1e64 100644 --- a/syntaxes/fjsx15/operator/new.sublime-syntax +++ b/syntaxes/fjsx15/operator/new.sublime-syntax @@ -30,7 +30,7 @@ contexts: (new) (?=\s+{{commonIdentifier}}) captures: - 1: keyword.other.js.fjsx15 + 1: keyword.operator.js.fjsx15 set: [ optional-template-and-arguments, type @@ -48,7 +48,7 @@ contexts: (?xi) \s*({{commonIdentifier}}) captures: - 1: entity.name.class.js.fjsx15 + 1: variable.type.js.fjsx15 pop: true optional-template-and-arguments: diff --git a/syntaxes/fjsx15/operator/of.sublime-syntax b/syntaxes/fjsx15/operator/of.sublime-syntax index b9cc29b5..3fef974d 100644 --- a/syntaxes/fjsx15/operator/of.sublime-syntax +++ b/syntaxes/fjsx15/operator/of.sublime-syntax @@ -22,7 +22,7 @@ contexts: # Technically there’s no “of” operator, but this will simplify for loops. - match: \s*(of)\b captures: - 1: keyword.other.js.fjsx15 + 1: keyword.operator.js.fjsx15 set: optional-expression optional-expression: diff --git a/syntaxes/fjsx15/operator/pipe.sublime-syntax b/syntaxes/fjsx15/operator/pipe.sublime-syntax index 049cc4af..72c0069e 100644 --- a/syntaxes/fjsx15/operator/pipe.sublime-syntax +++ b/syntaxes/fjsx15/operator/pipe.sublime-syntax @@ -26,7 +26,7 @@ contexts: main: - match: \s*(\|>) captures: - 1: keyword.operator.other.pipe.js.fjsx15 + 1: keyword.operator.pipe.js.fjsx15 set: target target: diff --git a/syntaxes/fjsx15/operator/rest.sublime-syntax b/syntaxes/fjsx15/operator/rest.sublime-syntax index e6bfce85..eed379f7 100644 --- a/syntaxes/fjsx15/operator/rest.sublime-syntax +++ b/syntaxes/fjsx15/operator/rest.sublime-syntax @@ -21,5 +21,5 @@ contexts: main: - match: \s*(\.{3}) captures: - 1: keyword.operator.other.rest.js.fjsx15 + 1: keyword.operator.rest.js.fjsx15 pop: true diff --git a/syntaxes/fjsx15/operator/spread.sublime-syntax b/syntaxes/fjsx15/operator/spread.sublime-syntax index 6e6f1c32..803cbc8e 100644 --- a/syntaxes/fjsx15/operator/spread.sublime-syntax +++ b/syntaxes/fjsx15/operator/spread.sublime-syntax @@ -21,7 +21,7 @@ contexts: main: - match: \s*(\.{3}) captures: - 1: keyword.operator.other.spread.js.fjsx15 + 1: keyword.operator.spread.js.fjsx15 set: optional-expression optional-expression: diff --git a/syntaxes/fjsx15/operator/typeof.sublime-syntax b/syntaxes/fjsx15/operator/typeof.sublime-syntax index 0a198c90..b42bb9e6 100644 --- a/syntaxes/fjsx15/operator/typeof.sublime-syntax +++ b/syntaxes/fjsx15/operator/typeof.sublime-syntax @@ -21,10 +21,9 @@ contexts: main: - match: \s*(typeof)\b captures: - 1: >- - word.js.fjsx15 - keyword.operator.other.void.js.fjsx15 - set: optional-expression + 1: keyword.operator.typeof.js.fjsx15 + set: type-or-optional-expression - optional-expression: + type-or-optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/operator/new.sublime-syntax#type - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/operator/void.sublime-syntax b/syntaxes/fjsx15/operator/void.sublime-syntax index 137ec0f7..5533c1be 100644 --- a/syntaxes/fjsx15/operator/void.sublime-syntax +++ b/syntaxes/fjsx15/operator/void.sublime-syntax @@ -23,7 +23,7 @@ contexts: captures: 1: >- word.js.fjsx15 - keyword.operator.other.js.fjsx15 + keyword.operator.js.fjsx15 set: optional-expression optional-expression: From 40538246920cad7904932a36910883903b304810 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 17 Dec 2017 23:30:53 -0200 Subject: [PATCH 235/407] [FJSX15] Fix typos --- syntaxes/fjsx15/constant.sublime-syntax | 2 +- syntaxes/fjsx15/core.sublime-syntax | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/syntaxes/fjsx15/constant.sublime-syntax b/syntaxes/fjsx15/constant.sublime-syntax index fdd2593d..96ab279f 100644 --- a/syntaxes/fjsx15/constant.sublime-syntax +++ b/syntaxes/fjsx15/constant.sublime-syntax @@ -29,7 +29,7 @@ contexts: object: - match: | - (?xi)\s* + (?x)\s* (\#)? ({{constantIdentifier}}) (?=\s*\??\.) diff --git a/syntaxes/fjsx15/core.sublime-syntax b/syntaxes/fjsx15/core.sublime-syntax index 10345d2d..a05fcf21 100644 --- a/syntaxes/fjsx15/core.sublime-syntax +++ b/syntaxes/fjsx15/core.sublime-syntax @@ -251,7 +251,7 @@ contexts: (?x)\s* (function)(.)(sent) captures: - 1: support.class.builtin.js.fjsx15 + 1: support.type.object.js.fjsx15 2: punctuation.accessor.js.fjsx15 3: support.variable.js.fjsx15 pop: true From e6e2dae94d71215b8d862f55b33f15a77fa2f45b Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 17 Dec 2017 23:38:39 -0200 Subject: [PATCH 236/407] [FJSX15] Tone down for statements --- syntaxes/fjsx15/statement.sublime-syntax | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/statement.sublime-syntax b/syntaxes/fjsx15/statement.sublime-syntax index d9d5c2ec..632a36b8 100644 --- a/syntaxes/fjsx15/statement.sublime-syntax +++ b/syntaxes/fjsx15/statement.sublime-syntax @@ -138,7 +138,7 @@ contexts: pop: true for: - - match: \s*(for) + - match: \s*(for)\b captures: 1: keyword.control.loop.js.fjsx15 set: [ From 17af7ab663216455fe4cba49d33dfbcc52c46ee2 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 18 Dec 2017 12:07:12 -0200 Subject: [PATCH 237/407] [FJSX15] Fix fragment scope --- syntaxes/jsx1/fragment.sublime-syntax | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/syntaxes/jsx1/fragment.sublime-syntax b/syntaxes/jsx1/fragment.sublime-syntax index df5bdb7b..c87a2b5d 100644 --- a/syntaxes/jsx1/fragment.sublime-syntax +++ b/syntaxes/jsx1/fragment.sublime-syntax @@ -37,8 +37,7 @@ contexts: - match: \s*() captures: 1: punctuation.definition.tag.begin.jsx.jsx1 - 2: entity.name.tag.jsx.jsx1 - 3: punctuation.definition.tag.end.jsx.jsx1 + 2: punctuation.definition.tag.end.jsx.jsx1 pop: true # Sub tags. - match: "" From 93e03c19bd8058c47222df1bd5f14e104e8f59bb Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 18 Dec 2017 12:40:19 -0200 Subject: [PATCH 238/407] [FJSX15] Clean up arrow scopes --- .../fjsx15/arrow-function/body.sublime-syntax | 12 +++------- syntaxes/fjsx15/variable.sublime-syntax | 22 ++++++++++++++++--- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/syntaxes/fjsx15/arrow-function/body.sublime-syntax b/syntaxes/fjsx15/arrow-function/body.sublime-syntax index 93436be0..615b1cd5 100644 --- a/syntaxes/fjsx15/arrow-function/body.sublime-syntax +++ b/syntaxes/fjsx15/arrow-function/body.sublime-syntax @@ -21,27 +21,21 @@ contexts: main: - match: \s*(=>) captures: - 1: >- - arrow.js.fjsx15 - punctuation.definition.function.body.arrow.js.fjsx15 + 1: storage.type.function.arrow.js.fjsx15 set: possible-multi-statement-body possible-multi-statement-body: - include: comment-no-pop - match: \s*(\{) captures: - 1: >- - arrow.js.fjsx15 - punctuation.definition.function.body.begin.js.fjsx15 + 1: punctuation.definition.function.body.begin.js.fjsx15 set: close-body - include: optional-expression close-body: - match: \s*(}) captures: - 1: >- - arrow.js.fjsx15 - punctuation.definition.function.body.end.js.fjsx15 + 1: punctuation.definition.function.body.end.js.fjsx15 set: optional-expression-tail - match: "" push: optional-statements-and-expressions diff --git a/syntaxes/fjsx15/variable.sublime-syntax b/syntaxes/fjsx15/variable.sublime-syntax index e628df55..c9d6f1e2 100644 --- a/syntaxes/fjsx15/variable.sublime-syntax +++ b/syntaxes/fjsx15/variable.sublime-syntax @@ -99,6 +99,7 @@ contexts: ) set: [ normal-arrow-function, + assignment, optional-type, function-identifier ] @@ -116,6 +117,7 @@ contexts: ) set: [ single-parameter-arrow-function, + assignment, optional-type, function-identifier ] @@ -131,6 +133,7 @@ contexts: ) set: [ function, + assignment, optional-type, function-identifier ] @@ -139,27 +142,40 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax function: + - meta_scope: meta.function.declaration.js.fjsx15 - include: Packages/Naomi/syntaxes/fjsx15/function.sublime-syntax + assignment: + - match: \s*(=) + captures: + 1: keyword.operator.assignment.js.fjsx15 + pop: true + function-identifier: - match: | (?xi) \s*({{commonIdentifier}}) captures: - 0: meta.function.declaration.js.fjsx15 1: entity.name.function.js.fjsx15 pop: true + arrow-body: + - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/body.sublime-syntax + normal-arrow-function: + - meta_scope: meta.function.declaration.js.fjsx15 - include: Packages/Naomi/syntaxes/fjsx15/async.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/parameters.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/parameters.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/body.sublime-syntax + - match: (?=\s*=>) + set: arrow-body single-parameter-arrow-function: + - meta_scope: meta.function.declaration.js.fjsx15 - include: Packages/Naomi/syntaxes/fjsx15/async.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/simple.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/body.sublime-syntax + - match: (?=\s*=>) + set: arrow-body optional-type: - include: comment-no-pop From 6afc85e9ff7e6514371375ee5fda2d7e5d7ef638 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 18 Dec 2017 13:16:57 -0200 Subject: [PATCH 239/407] [FJSX15] Add new.target and normalize scope --- syntaxes/fjsx15/operator/new.sublime-syntax | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/syntaxes/fjsx15/operator/new.sublime-syntax b/syntaxes/fjsx15/operator/new.sublime-syntax index 187c1e64..6e14476f 100644 --- a/syntaxes/fjsx15/operator/new.sublime-syntax +++ b/syntaxes/fjsx15/operator/new.sublime-syntax @@ -24,13 +24,24 @@ variables: contexts: main: + # new.target + - match: | + (?xi) + \s*(new) + \s*(\.) + \s*(target) + captures: + 1: keyword.operator.word.new.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.constant.js.fjsx15 + pop: true # Type after new. - match: | (?xi)\s* (new) (?=\s+{{commonIdentifier}}) captures: - 1: keyword.operator.js.fjsx15 + 1: keyword.operator.word.new.js.fjsx15 set: [ optional-template-and-arguments, type @@ -38,7 +49,7 @@ contexts: # Any other expression after the keyword. - match: (?i)\s*(new)\b captures: - 1: keyword.other.js.fjsx15 + 1: keyword.operator.word.new.js.fjsx15 pop: true type: From a506497bddf9be3d7c50aef098452ef3204f8810 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 18 Dec 2017 13:21:02 -0200 Subject: [PATCH 240/407] [FJSX15] Remove ... from decorator scopes --- syntaxes/fjsx15/decorator/identifier.sublime-syntax | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/decorator/identifier.sublime-syntax b/syntaxes/fjsx15/decorator/identifier.sublime-syntax index 7203256c..85065df4 100644 --- a/syntaxes/fjsx15/decorator/identifier.sublime-syntax +++ b/syntaxes/fjsx15/decorator/identifier.sublime-syntax @@ -24,6 +24,9 @@ variables: contexts: main: + - include: decorator-identifier + + decorator-identifier: # With arguments. - match: | (?xi)\s* @@ -52,6 +55,6 @@ contexts: - match: \s*(\.) captures: 1: punctuation.definition.decorator.chain.js.fjsx15 - set: main + set: decorator-identifier - match: (?=\s*\S) pop: true From 32245b2f927da5f23d59fe66ac08d4332498ff19 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 18 Dec 2017 13:37:53 -0200 Subject: [PATCH 241/407] [FJSX15] Normalize numeric scopes --- syntaxes/fjsx15/literal/number.sublime-syntax | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/syntaxes/fjsx15/literal/number.sublime-syntax b/syntaxes/fjsx15/literal/number.sublime-syntax index 9941241d..9723219e 100644 --- a/syntaxes/fjsx15/literal/number.sublime-syntax +++ b/syntaxes/fjsx15/literal/number.sublime-syntax @@ -51,19 +51,29 @@ contexts: pop: true integer: - - match: \s*(0[bB][01_]+) + - match: \s*(0[bB])([01_]+) captures: - 1: constant.numeric.binary.js.fjsx15 + 1: >- + constant.numeric.binary.js.fjsx15 + punctuation.definition.numeric.js.fjsx15 + 2: constant.numeric.binary.js.fjsx15 pop: true - - match: \s*(0[oO][0-7]+) + - match: \s*(0[oO])([0-7]+) captures: - 1: constant.numeric.octal.js.fjsx15 + 1: >- + constant.numeric.octal.js.fjsx15 + punctuation.definition.numeric.js.fjsx15 + 2: constant.numeric.octal.js.fjsx15 pop: true - - match: (?i)\s*(0[xX][0-9a-f_]+) + - match: (?i)\s*(0[xX])([0-9a-f_]+) captures: - 1: constant.numeric.hex.js.fjsx15 + 1: >- + constant.numeric.hex.js.fjsx15 + punctuation.definition.numeric.js.fjsx15 + 2: constant.numeric.hex.js.fjsx15 pop: true - - match: \s*([1-9][0-9_]*|0) + - match: \s*([1-9][0-9_]*|0)(?:\s*(n))? captures: 1: constant.numeric.decimal.js.fjsx15 + 2: storage.type.numeric.bigint.js.fjsx15 pop: true From fbf6fc7be0d4f90300885e9e6898a438b75402ba Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 18 Dec 2017 15:16:01 -0200 Subject: [PATCH 242/407] [FJSX15] Normalize array literal scope --- syntaxes/fjsx15/literal/array.sublime-syntax | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/syntaxes/fjsx15/literal/array.sublime-syntax b/syntaxes/fjsx15/literal/array.sublime-syntax index 212ce717..fd6dac7f 100644 --- a/syntaxes/fjsx15/literal/array.sublime-syntax +++ b/syntaxes/fjsx15/literal/array.sublime-syntax @@ -21,17 +21,18 @@ contexts: main: - match: \s*(\[) captures: - 1: punctuation.definition.array.begin.js.fjsx15 + 1: punctionation.section.brackets.begin.js.fjsx15 set: [ delimiters, optional-expression ] delimiters: + - meta_scope: meta.sequence.js.fjsx15 - match: \s*(]) captures: - 1: punctuation.definition.array.end.js.fjsx15 + 1: punctionation.section.brackets.end.js.fjsx15 pop: true - match: \s*(,) captures: - 1: punctuation.definition.array.js.fjsx15 + 1: punctuation.separator.js.fjsx15 push: optional-expression optional-expression: From b65ea279b66c87c603f1c7806302f0e024dc162c Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 18 Dec 2017 15:16:11 -0200 Subject: [PATCH 243/407] [FJSX15] Normalize property scope --- syntaxes/fjsx15/property-access.sublime-syntax | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/syntaxes/fjsx15/property-access.sublime-syntax b/syntaxes/fjsx15/property-access.sublime-syntax index 238e6ffe..d8ca909b 100644 --- a/syntaxes/fjsx15/property-access.sublime-syntax +++ b/syntaxes/fjsx15/property-access.sublime-syntax @@ -21,13 +21,14 @@ contexts: main: - match: \s*(\[) captures: - 1: punctuation.other.property.access.begin.js.fjsx15 + 1: punctuation.section.brackets.begin.js.fjsx15 set: index index: + - meta_scope: meta.item-access.js.fjsx15 - match: \s*(]) captures: - 1: punctuation.other.property.access.end.js.fjsx15a + 1: punctuation.section.brackets.end.js.fjsx15a pop: true - match: "" push: optional-expression From 8e0ac29d7ca4e9fcb11f5a06c76d6d1d4d72d5bc Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 18 Dec 2017 21:27:06 -0200 Subject: [PATCH 244/407] [FJSX15] Envelop variable declaration into a meta scope --- .../variable-declaration.sublime-syntax | 84 ++++++++++++++++++- 1 file changed, 80 insertions(+), 4 deletions(-) diff --git a/syntaxes/fjsx15/variable-declaration.sublime-syntax b/syntaxes/fjsx15/variable-declaration.sublime-syntax index ec793cd8..f76719c4 100644 --- a/syntaxes/fjsx15/variable-declaration.sublime-syntax +++ b/syntaxes/fjsx15/variable-declaration.sublime-syntax @@ -22,6 +22,10 @@ variables: [$_[:alpha:]] [$_[:alnum:]]* + constantIdentifier: | + [$_[:upper:]] + [$_[:upper:][:digit:]]* + templateArguments: | (< [^<>]* @@ -85,13 +89,33 @@ contexts: (?x) (?=\s*(?>const|let|var)\b) set: [ - variables, + optional-type-and-initial-value, + variable-or-constant, keyword ] comment-no-pop: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax + optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax + + associated-type: + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax + + optional-type-and-initial-value: + - meta_scope: meta.declaration.variable.js.fjsx15 + - match: (?=\s*:) + push: associated-type + - match: \s*(,) + captures: + 1: punctuation.separator.js.fjsx15 + push: variable-or-constant + - match: (?=\s*=) + push: optional-expression + - match: (?=\s*\S) + pop: true + keyword: - match: | (?x)\s* @@ -100,14 +124,66 @@ contexts: 1: storage.type.js.fjsx15 pop: true - variables: + variable-or-constant: - include: comment-no-pop - include: Packages/Naomi/syntaxes/fjsx15/destructuring/array.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/destructuring/object.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/variable.sublime-syntax#function-assigned-to-variable - - include: Packages/Naomi/syntaxes/fjsx15/constant.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/variable.sublime-syntax + - include: constant + - include: variable optional-type: - include: comment-no-pop - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-associated-type.sublime-syntax + + constant: + # Single character. + - match: | + (?x)\s* + (\#)? + ([_[:upper:]])\b + captures: + 1: storage.modifier.js.fjsx15 + 2: entity.name.constant.js.fjsx15 + pop: true + # Two or more characters. + - match: | + (?x)\s* + (\#)? + ( + {{constantIdentifier}} + (?> \$\B + | [_[:upper:][:digit:]]\b + ) + ) + captures: + 1: storage.modifier.js.fjsx15 + 2: entity.name.constant.js.fjsx15 + pop: true + + variable: + # Single character. + - match: | + (?xi)\s* + (\#)? + ((?> \$\B + | [_[:alpha:]]\b + )) + captures: + 1: storage.modifier.js.fjsx15 + 2: entity.name.variable.js.fjsx15 + pop: true + # Two or more characters. + - match: | + (?xi)\s* + (\#)? + ( + {{commonIdentifier}} + (?> \$\B + | [_[:alnum:]]\b + ) + ) + captures: + 1: storage.modifier.js.fjsx15 + 2: entity.name.variable.js.fjsx15 + pop: true From ae7c99b002dad279f2da644f3b11104027a3ecf2 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 18 Dec 2017 22:08:25 -0200 Subject: [PATCH 245/407] [FJSX15] Normalize class meta scopes --- syntaxes/fjsx15/class/body.sublime-syntax | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/syntaxes/fjsx15/class/body.sublime-syntax b/syntaxes/fjsx15/class/body.sublime-syntax index 729671b0..7656ee1c 100644 --- a/syntaxes/fjsx15/class/body.sublime-syntax +++ b/syntaxes/fjsx15/class/body.sublime-syntax @@ -22,19 +22,20 @@ contexts: - include: comment-no-pop - match: \s*(\{) captures: - 1: punctuation.definition.class.body.begin.js.fjsx15 + 1: punctuation.section.block.begin.js.fjsx15 set: [ body-end, statements-and-expressions ] body-end: + - meta_scope: meta.class.js.fjsx15 - include: comment-no-pop - match: \s*(?>(,)|(;)) captures: - 1: punctuation.definition.object.js.fjsx15 - 2: keyword.other.terminator.js.fjsx15 + 1: punctuation.separator.comma.js.fjsx15 + 2: punctuation.terminator.js.fjsx15 push: statements-and-expressions - match: \s*(}) captures: - 1: punctuation.definition.class.body.end.js.fjsx15 + 1: punctuation.section.block.end.js.fjsx15 pop: true - match: (?=\s*\S) push: statements-and-expressions From 58c439735daa935171be6038dc78a002c0360411 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 18 Dec 2017 22:08:49 -0200 Subject: [PATCH 246/407] [FJSX15] Normalize block scopes --- syntaxes/fjsx15/statement.sublime-syntax | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/syntaxes/fjsx15/statement.sublime-syntax b/syntaxes/fjsx15/statement.sublime-syntax index 632a36b8..a6e788a6 100644 --- a/syntaxes/fjsx15/statement.sublime-syntax +++ b/syntaxes/fjsx15/statement.sublime-syntax @@ -94,13 +94,14 @@ contexts: block: - match: \s*({) captures: - 1: punctuation.definition.block.begin.js.fjsx15 + 1: punctuation.section.block.begin.js.fjsx15 set: [ block-end, optional-statements-and-expressions ] block-end: + - meta_scope: meta.block.js.fjsx15 - match: \s*(}) captures: - 1: punctuation.definition.block.end.js.fjsx15 + 1: punctuation.section.block.end.js.fjsx15 pop: true - match: "" push: optional-statements-and-expressions From 9289cb6a908f7b905b17eab8c31ffe6074f8ee69 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 18 Dec 2017 22:11:41 -0200 Subject: [PATCH 247/407] [FJSX15] Expand function.declaration in assigned variables --- syntaxes/fjsx15/variable.sublime-syntax | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/syntaxes/fjsx15/variable.sublime-syntax b/syntaxes/fjsx15/variable.sublime-syntax index e628df55..c9d6f1e2 100644 --- a/syntaxes/fjsx15/variable.sublime-syntax +++ b/syntaxes/fjsx15/variable.sublime-syntax @@ -99,6 +99,7 @@ contexts: ) set: [ normal-arrow-function, + assignment, optional-type, function-identifier ] @@ -116,6 +117,7 @@ contexts: ) set: [ single-parameter-arrow-function, + assignment, optional-type, function-identifier ] @@ -131,6 +133,7 @@ contexts: ) set: [ function, + assignment, optional-type, function-identifier ] @@ -139,27 +142,40 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax function: + - meta_scope: meta.function.declaration.js.fjsx15 - include: Packages/Naomi/syntaxes/fjsx15/function.sublime-syntax + assignment: + - match: \s*(=) + captures: + 1: keyword.operator.assignment.js.fjsx15 + pop: true + function-identifier: - match: | (?xi) \s*({{commonIdentifier}}) captures: - 0: meta.function.declaration.js.fjsx15 1: entity.name.function.js.fjsx15 pop: true + arrow-body: + - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/body.sublime-syntax + normal-arrow-function: + - meta_scope: meta.function.declaration.js.fjsx15 - include: Packages/Naomi/syntaxes/fjsx15/async.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/parameters.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/parameters.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/body.sublime-syntax + - match: (?=\s*=>) + set: arrow-body single-parameter-arrow-function: + - meta_scope: meta.function.declaration.js.fjsx15 - include: Packages/Naomi/syntaxes/fjsx15/async.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/simple.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/body.sublime-syntax + - match: (?=\s*=>) + set: arrow-body optional-type: - include: comment-no-pop From a2cc2a8e63fcb2888892312a3ae9449c501209e0 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 18 Dec 2017 22:11:59 -0200 Subject: [PATCH 248/407] [FjSX15] Add meta group --- syntaxes/fjsx15/expression.sublime-syntax | 1 + 1 file changed, 1 insertion(+) diff --git a/syntaxes/fjsx15/expression.sublime-syntax b/syntaxes/fjsx15/expression.sublime-syntax index ca9b5c8b..7d7a8f73 100644 --- a/syntaxes/fjsx15/expression.sublime-syntax +++ b/syntaxes/fjsx15/expression.sublime-syntax @@ -59,6 +59,7 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/flowtype/cast.sublime-syntax open-group: + - meta_scope: meta.group.js.fjsx15 - include: comment-no-pop # Comma operator. - match: (?=\s*,) From f01c314d48396fa18960905b292b0c58ffece72e Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 18 Dec 2017 22:12:26 -0200 Subject: [PATCH 249/407] [FjSX15] Fix chained decorators --- syntaxes/fjsx15/decorator/identifier.sublime-syntax | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/decorator/identifier.sublime-syntax b/syntaxes/fjsx15/decorator/identifier.sublime-syntax index 7203256c..85065df4 100644 --- a/syntaxes/fjsx15/decorator/identifier.sublime-syntax +++ b/syntaxes/fjsx15/decorator/identifier.sublime-syntax @@ -24,6 +24,9 @@ variables: contexts: main: + - include: decorator-identifier + + decorator-identifier: # With arguments. - match: | (?xi)\s* @@ -52,6 +55,6 @@ contexts: - match: \s*(\.) captures: 1: punctuation.definition.decorator.chain.js.fjsx15 - set: main + set: decorator-identifier - match: (?=\s*\S) pop: true From 403e1783610e47f31de950b49134be071d89c0c4 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 18 Dec 2017 22:13:06 -0200 Subject: [PATCH 250/407] [FjSX15] Normalize arrow function meta scopes --- syntaxes/fjsx15/arrow-function/body.sublime-syntax | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/syntaxes/fjsx15/arrow-function/body.sublime-syntax b/syntaxes/fjsx15/arrow-function/body.sublime-syntax index 93436be0..370b5e59 100644 --- a/syntaxes/fjsx15/arrow-function/body.sublime-syntax +++ b/syntaxes/fjsx15/arrow-function/body.sublime-syntax @@ -21,27 +21,23 @@ contexts: main: - match: \s*(=>) captures: - 1: >- - arrow.js.fjsx15 - punctuation.definition.function.body.arrow.js.fjsx15 + 0: meta.function.js.fjsx15 + 1: storage.type.function.arrow.js.fjsx15 set: possible-multi-statement-body possible-multi-statement-body: - include: comment-no-pop - match: \s*(\{) captures: - 1: >- - arrow.js.fjsx15 - punctuation.definition.function.body.begin.js.fjsx15 + 1: punctuation.section.block.begin.js.fjsx15 set: close-body - include: optional-expression close-body: + - meta_scope: meta.function.js.fjsx15 - match: \s*(}) captures: - 1: >- - arrow.js.fjsx15 - punctuation.definition.function.body.end.js.fjsx15 + 1: punctuation.section.block.end.js.fjsx15 set: optional-expression-tail - match: "" push: optional-statements-and-expressions From 9cd968d7509664eafff268c9252e39ec69de3904 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 18 Dec 2017 22:13:14 -0200 Subject: [PATCH 251/407] [FjSX15] Fix typo in interfaces --- syntaxes/fjsx15/flowtype/interface.sublime-syntax | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/flowtype/interface.sublime-syntax b/syntaxes/fjsx15/flowtype/interface.sublime-syntax index 31dc4384..11918a94 100644 --- a/syntaxes/fjsx15/flowtype/interface.sublime-syntax +++ b/syntaxes/fjsx15/flowtype/interface.sublime-syntax @@ -60,7 +60,7 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/parameters.sublime-syntax body: - - include: comment + - include: comment-no-pop - match: \s*(\{) captures: 1: >- From d942e8378e8bc177916264dbe2608ddb25a8d1ad Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 18 Dec 2017 22:13:35 -0200 Subject: [PATCH 252/407] [FjSX15] Add new.target and normalize scopes --- syntaxes/fjsx15/operator/new.sublime-syntax | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/syntaxes/fjsx15/operator/new.sublime-syntax b/syntaxes/fjsx15/operator/new.sublime-syntax index 187c1e64..6e14476f 100644 --- a/syntaxes/fjsx15/operator/new.sublime-syntax +++ b/syntaxes/fjsx15/operator/new.sublime-syntax @@ -24,13 +24,24 @@ variables: contexts: main: + # new.target + - match: | + (?xi) + \s*(new) + \s*(\.) + \s*(target) + captures: + 1: keyword.operator.word.new.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.constant.js.fjsx15 + pop: true # Type after new. - match: | (?xi)\s* (new) (?=\s+{{commonIdentifier}}) captures: - 1: keyword.operator.js.fjsx15 + 1: keyword.operator.word.new.js.fjsx15 set: [ optional-template-and-arguments, type @@ -38,7 +49,7 @@ contexts: # Any other expression after the keyword. - match: (?i)\s*(new)\b captures: - 1: keyword.other.js.fjsx15 + 1: keyword.operator.word.new.js.fjsx15 pop: true type: From f062f74b48d559d14660fb686d814c1728d6d7aa Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 18 Dec 2017 22:14:01 -0200 Subject: [PATCH 253/407] [FjSX15] Normalize generator modifier --- syntaxes/fjsx15/function.sublime-syntax | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/syntaxes/fjsx15/function.sublime-syntax b/syntaxes/fjsx15/function.sublime-syntax index 1cc63b9b..d7cd6c08 100644 --- a/syntaxes/fjsx15/function.sublime-syntax +++ b/syntaxes/fjsx15/function.sublime-syntax @@ -61,9 +61,7 @@ contexts: (\*)? (?:\s*({{commonIdentifier}}))? captures: - 1: >- - storage.modifier.js.fjsx15 - keyword.operator.other.generator.js.fjsx15 + 1: storage.modifier.js.fjsx15 2: entity.name.function.js.fjsx15 # None of the expected items matched, it probably ended. - match: (?=\s*\S) From 763461123397166f1458c929ed585d03dcc167ff Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 18 Dec 2017 22:14:25 -0200 Subject: [PATCH 254/407] [FjSX15] Normalize array literal scopes --- syntaxes/fjsx15/literal/array.sublime-syntax | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/syntaxes/fjsx15/literal/array.sublime-syntax b/syntaxes/fjsx15/literal/array.sublime-syntax index 212ce717..fd6dac7f 100644 --- a/syntaxes/fjsx15/literal/array.sublime-syntax +++ b/syntaxes/fjsx15/literal/array.sublime-syntax @@ -21,17 +21,18 @@ contexts: main: - match: \s*(\[) captures: - 1: punctuation.definition.array.begin.js.fjsx15 + 1: punctionation.section.brackets.begin.js.fjsx15 set: [ delimiters, optional-expression ] delimiters: + - meta_scope: meta.sequence.js.fjsx15 - match: \s*(]) captures: - 1: punctuation.definition.array.end.js.fjsx15 + 1: punctionation.section.brackets.end.js.fjsx15 pop: true - match: \s*(,) captures: - 1: punctuation.definition.array.js.fjsx15 + 1: punctuation.separator.js.fjsx15 push: optional-expression optional-expression: From 6080f0bbe98d929f06c6ceff29b2ff6fc8e3729e Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 18 Dec 2017 22:14:37 -0200 Subject: [PATCH 255/407] [FjSX15] Normalize numeric scopes --- syntaxes/fjsx15/literal/number.sublime-syntax | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/syntaxes/fjsx15/literal/number.sublime-syntax b/syntaxes/fjsx15/literal/number.sublime-syntax index 9941241d..9723219e 100644 --- a/syntaxes/fjsx15/literal/number.sublime-syntax +++ b/syntaxes/fjsx15/literal/number.sublime-syntax @@ -51,19 +51,29 @@ contexts: pop: true integer: - - match: \s*(0[bB][01_]+) + - match: \s*(0[bB])([01_]+) captures: - 1: constant.numeric.binary.js.fjsx15 + 1: >- + constant.numeric.binary.js.fjsx15 + punctuation.definition.numeric.js.fjsx15 + 2: constant.numeric.binary.js.fjsx15 pop: true - - match: \s*(0[oO][0-7]+) + - match: \s*(0[oO])([0-7]+) captures: - 1: constant.numeric.octal.js.fjsx15 + 1: >- + constant.numeric.octal.js.fjsx15 + punctuation.definition.numeric.js.fjsx15 + 2: constant.numeric.octal.js.fjsx15 pop: true - - match: (?i)\s*(0[xX][0-9a-f_]+) + - match: (?i)\s*(0[xX])([0-9a-f_]+) captures: - 1: constant.numeric.hex.js.fjsx15 + 1: >- + constant.numeric.hex.js.fjsx15 + punctuation.definition.numeric.js.fjsx15 + 2: constant.numeric.hex.js.fjsx15 pop: true - - match: \s*([1-9][0-9_]*|0) + - match: \s*([1-9][0-9_]*|0)(?:\s*(n))? captures: 1: constant.numeric.decimal.js.fjsx15 + 2: storage.type.numeric.bigint.js.fjsx15 pop: true From e2e0f62013a0b56c7e13659c55dfda36de038f81 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 18 Dec 2017 22:14:59 -0200 Subject: [PATCH 256/407] [FjSX15] Normalize object literal scopes --- syntaxes/fjsx15/literal/object.sublime-syntax | 7 ++++--- syntaxes/fjsx15/literal/object/property.sublime-syntax | 6 ++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/syntaxes/fjsx15/literal/object.sublime-syntax b/syntaxes/fjsx15/literal/object.sublime-syntax index 89a7d1b5..cef0a58e 100644 --- a/syntaxes/fjsx15/literal/object.sublime-syntax +++ b/syntaxes/fjsx15/literal/object.sublime-syntax @@ -29,18 +29,19 @@ variables: contexts: main: - match: \s*({) - scope: punctuation.definition.object.begin.js.fjsx15 + scope: punctuation.section.block.begin.js.fjsx15 set: [ delimiters, statements-and-expressions ] delimiters: + - meta_scope: meta.object-literal.js.fjsx15 - include: comment-no-pop - match: \s*(,) captures: - 1: punctuation.definition.object.js.fjsx15 + 1: punctuation.separator.comma.js.fjsx15 push: statements-and-expressions - match: \s*(}) captures: - 1: punctuation.definition.object.end.js.fjsx15 + 1: punctuation.section.block.end.js.fjsx15 pop: true statements-and-expressions: diff --git a/syntaxes/fjsx15/literal/object/property.sublime-syntax b/syntaxes/fjsx15/literal/object/property.sublime-syntax index 6f8769e1..800c896e 100644 --- a/syntaxes/fjsx15/literal/object/property.sublime-syntax +++ b/syntaxes/fjsx15/literal/object/property.sublime-syntax @@ -169,7 +169,7 @@ contexts: \s*(:) captures: 1: entity.name.function.js.fjsx15 - 2: punctuation.definition.function.js.fjsx15 + 2: punctuation.separator.key-value.js.fjsx15 pop: true arrow-function: @@ -250,7 +250,5 @@ contexts: associated-value: - match: \s*(:) captures: - 1: >- - object.js.fjsx15 - keyword.operator.other.association.js.fjsx15 + 1: punctuation.separator.key-value.js.fjsx15 set: optional-expression From 7c1777a1ac904d369099e302b92e7ff2236748ed Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 18 Dec 2017 22:15:52 -0200 Subject: [PATCH 257/407] [FjSX15] Normalize function body scopes --- syntaxes/fjsx15/function/body.sublime-syntax | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/syntaxes/fjsx15/function/body.sublime-syntax b/syntaxes/fjsx15/function/body.sublime-syntax index ba6add12..8baec237 100644 --- a/syntaxes/fjsx15/function/body.sublime-syntax +++ b/syntaxes/fjsx15/function/body.sublime-syntax @@ -21,16 +21,17 @@ contexts: main: - match: \s*(\{) captures: - 1: punctuation.definition.function.body.begin.js.fjsx15 + 1: punctuation.section.block.begin.js.fjsx15 set: [ close-body, optional-statements-and-expressions ] close-body: + - meta_scope: meta.function.js.fjsx15 - match: \s*(}) captures: - 1: punctuation.definition.function.body.end.js.fjsx15 + 1: punctuation.section.block.end.js.fjsx15 pop: true - match: "" push: optional-statements-and-expressions From fbe58fe018816bf83f29c6e7859b56ceed8fb6c1 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 18 Dec 2017 22:30:32 -0200 Subject: [PATCH 258/407] [FJSX15] Add method meta scope --- syntaxes/fjsx15/class/method.sublime-syntax | 6 ++- .../class/method/parameters.sublime-syntax | 45 +++++++++++++++++++ 2 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 syntaxes/fjsx15/class/method/parameters.sublime-syntax diff --git a/syntaxes/fjsx15/class/method.sublime-syntax b/syntaxes/fjsx15/class/method.sublime-syntax index e2ab2829..2e403f9e 100644 --- a/syntaxes/fjsx15/class/method.sublime-syntax +++ b/syntaxes/fjsx15/class/method.sublime-syntax @@ -60,7 +60,9 @@ contexts: set: declaration declaration: - - meta_scope: meta.function.declaration.js.fjsx15 + - meta_scope: >- + meta.function.declaration.js.fjsx15 + meta.method.js.fjsx15 - include: comment-no-pop # Body. - match: (?=\s*\{) @@ -115,7 +117,7 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/parameters.sublime-syntax parameters: - - include: Packages/Naomi/syntaxes/fjsx15/function/parameters.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/class/method/parameters.sublime-syntax support-parameters: - include: Packages/Naomi/syntaxes/fjsx15/function/support/core-parameters.sublime-syntax diff --git a/syntaxes/fjsx15/class/method/parameters.sublime-syntax b/syntaxes/fjsx15/class/method/parameters.sublime-syntax new file mode 100644 index 00000000..312aa996 --- /dev/null +++ b/syntaxes/fjsx15/class/method/parameters.sublime-syntax @@ -0,0 +1,45 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +contexts: + main: + - match: \s*(\() + captures: + 1: punctuation.section.group.begin.js.fjsx15 + set: [ delimiters, optional-parameter ] + + delimiters: + - meta_scope: >- + meta.function.declaration.js.fjsx15 + meta.method.js.fjsx15 + - include: comment-no-pop + - match: \s*(\,) + captures: + 1: punctuation.separator.js.fjsx15 + push: optional-parameter + - match: \s*(\)) + captures: + 1: punctuation.section.group.end.js.fjsx15 + set: optional-return-type + + optional-parameter: + - include: Packages/Naomi/syntaxes/fjsx15/function/parameters.sublime-syntax#optional-parameter + + optional-return-type: + - include: Packages/Naomi/syntaxes/fjsx15/function/parameters.sublime-syntax#optional-return-type From 2f78b62f7850f1de3f6689e392e757e7b6e61682 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 18 Dec 2017 22:31:47 -0200 Subject: [PATCH 259/407] [FJSX15] Remove support parameter, body and arguments --- syntaxes/fjsx15/class/method.sublime-syntax | 4 +- .../support/react-js-method.sublime-syntax | 4 +- syntaxes/fjsx15/core.sublime-syntax | 2 +- .../core-arguments.no-pop.sublime-syntax | 26 ---------- .../support/core-arguments.sublime-syntax | 44 ---------------- .../support/jest-arguments.sublime-syntax | 44 ---------------- .../support/react-js-arguments.sublime-syntax | 44 ---------------- .../function/support/body.sublime-syntax | 41 --------------- .../support/core-parameters.sublime-syntax | 51 ------------------- .../support/react-js-body.sublime-syntax | 41 --------------- .../react-js-parameters.sublime-syntax | 50 ------------------ syntaxes/fjsx15/jest.sublime-syntax | 2 +- syntaxes/fjsx15/node-js.sublime-syntax | 2 +- syntaxes/fjsx15/react-js.sublime-syntax | 2 +- syntaxes/fjsx15/web.sublime-syntax | 2 +- 15 files changed, 9 insertions(+), 350 deletions(-) delete mode 100644 syntaxes/fjsx15/function-call/support/core-arguments.no-pop.sublime-syntax delete mode 100644 syntaxes/fjsx15/function-call/support/core-arguments.sublime-syntax delete mode 100644 syntaxes/fjsx15/function-call/support/jest-arguments.sublime-syntax delete mode 100644 syntaxes/fjsx15/function-call/support/react-js-arguments.sublime-syntax delete mode 100644 syntaxes/fjsx15/function/support/body.sublime-syntax delete mode 100644 syntaxes/fjsx15/function/support/core-parameters.sublime-syntax delete mode 100644 syntaxes/fjsx15/function/support/react-js-body.sublime-syntax delete mode 100644 syntaxes/fjsx15/function/support/react-js-parameters.sublime-syntax diff --git a/syntaxes/fjsx15/class/method.sublime-syntax b/syntaxes/fjsx15/class/method.sublime-syntax index 2e403f9e..e4c91281 100644 --- a/syntaxes/fjsx15/class/method.sublime-syntax +++ b/syntaxes/fjsx15/class/method.sublime-syntax @@ -120,7 +120,7 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/class/method/parameters.sublime-syntax support-parameters: - - include: Packages/Naomi/syntaxes/fjsx15/function/support/core-parameters.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/class/method/parameters.sublime-syntax body: - include: Packages/Naomi/syntaxes/fjsx15/function/body.sublime-syntax @@ -131,7 +131,7 @@ contexts: pop: true optional-support-body: - - include: Packages/Naomi/syntaxes/fjsx15/function/support/body.sublime-syntax + - include: body - match: (?=\s*\S) pop: true diff --git a/syntaxes/fjsx15/class/support/react-js-method.sublime-syntax b/syntaxes/fjsx15/class/support/react-js-method.sublime-syntax index 94a63898..3e29a6da 100644 --- a/syntaxes/fjsx15/class/support/react-js-method.sublime-syntax +++ b/syntaxes/fjsx15/class/support/react-js-method.sublime-syntax @@ -54,7 +54,7 @@ contexts: pop: true parameters: - - include: Packages/Naomi/syntaxes/fjsx15/function/support/react-js-parameters.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/function/parameters.sublime-syntax body: - - include: Packages/Naomi/syntaxes/fjsx15/function/support/react-js-body.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/function/body.sublime-syntax diff --git a/syntaxes/fjsx15/core.sublime-syntax b/syntaxes/fjsx15/core.sublime-syntax index a05fcf21..21d0a216 100644 --- a/syntaxes/fjsx15/core.sublime-syntax +++ b/syntaxes/fjsx15/core.sublime-syntax @@ -43,7 +43,7 @@ contexts: optional-template-and-arguments: - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/arguments.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/function-call/support/core-arguments.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/function-call/arguments.sublime-syntax - match: (?=\s*\S) pop: true diff --git a/syntaxes/fjsx15/function-call/support/core-arguments.no-pop.sublime-syntax b/syntaxes/fjsx15/function-call/support/core-arguments.no-pop.sublime-syntax deleted file mode 100644 index fa94f1f0..00000000 --- a/syntaxes/fjsx15/function-call/support/core-arguments.no-pop.sublime-syntax +++ /dev/null @@ -1,26 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -contexts: - main: - - match: (?=\s*\() - push: arguments - - arguments: - - include: Packages/Naomi/syntaxes/fjsx15/function-call/support/core-arguments.sublime-syntax diff --git a/syntaxes/fjsx15/function-call/support/core-arguments.sublime-syntax b/syntaxes/fjsx15/function-call/support/core-arguments.sublime-syntax deleted file mode 100644 index 15537908..00000000 --- a/syntaxes/fjsx15/function-call/support/core-arguments.sublime-syntax +++ /dev/null @@ -1,44 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -contexts: - main: - - match: \s*(\() - captures: - 1: >- - support.core.js.fjsx15 - punctuation.definition.function.arguments.begin.js.fjsx15 - set: [ delimiter, optional-expression ] - - delimiter: - - match: \s*(\)) - captures: - 1: >- - support.core.js.fjsx15 - punctuation.definition.function.arguments.end.js.fjsx15 - pop: true - - match: \s*(,) - captures: - 1: >- - support.core.js.fjsx15 - punctuation.definition.function.arguments.js.fjsx15 - push: optional-expression - - optional-expression: - - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/function-call/support/jest-arguments.sublime-syntax b/syntaxes/fjsx15/function-call/support/jest-arguments.sublime-syntax deleted file mode 100644 index d355145c..00000000 --- a/syntaxes/fjsx15/function-call/support/jest-arguments.sublime-syntax +++ /dev/null @@ -1,44 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -contexts: - main: - - match: \s*(\() - captures: - 1: >- - support.lib.jest.fjsx15 - punctuation.definition.function.arguments.begin.js.fjsx15 - set: [ delimiter, optional-expression ] - - delimiter: - - match: \s*(\)) - captures: - 1: >- - support.lib.jest.fjsx15 - punctuation.definition.function.arguments.end.js.fjsx15 - pop: true - - match: \s*(,) - captures: - 1: >- - support.lib.jest.fjsx15 - punctuation.definition.function.arguments.js.fjsx15 - push: optional-expression - - optional-expression: - - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/function-call/support/react-js-arguments.sublime-syntax b/syntaxes/fjsx15/function-call/support/react-js-arguments.sublime-syntax deleted file mode 100644 index 57762a66..00000000 --- a/syntaxes/fjsx15/function-call/support/react-js-arguments.sublime-syntax +++ /dev/null @@ -1,44 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -contexts: - main: - - match: \s*(\() - captures: - 1: >- - support.lib.react-js.fjsx15 - punctuation.definition.function.arguments.begin.js.fjsx15 - set: [ delimiter, optional-expression ] - - delimiter: - - match: \s*(\)) - captures: - 1: >- - support.lib.react-js.fjsx15 - punctuation.definition.function.arguments.end.js.fjsx15 - pop: true - - match: \s*(,) - captures: - 1: >- - support.lib.react-js.fjsx15 - punctuation.definition.function.arguments.js.fjsx15 - push: optional-expression - - optional-expression: - - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/function/support/body.sublime-syntax b/syntaxes/fjsx15/function/support/body.sublime-syntax deleted file mode 100644 index 48e53eac..00000000 --- a/syntaxes/fjsx15/function/support/body.sublime-syntax +++ /dev/null @@ -1,41 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -contexts: - main: - - match: \s*(\{) - captures: - 1: >- - support.core.js.fjsx15 - punctuation.definition.function.body.begin.js.fjsx15 - set: body-content - - body-content: - - match: \s*(}) - captures: - 1: >- - support.core.js.fjsx15 - punctuation.definition.function.body.end.js.fjsx15 - pop: true - - match: "" - push: optional-statements-and-expressions - - optional-statements-and-expressions: - - include: Packages/Naomi/syntaxes/fjsx15/optional-statements-and-expressions.sublime-syntax - diff --git a/syntaxes/fjsx15/function/support/core-parameters.sublime-syntax b/syntaxes/fjsx15/function/support/core-parameters.sublime-syntax deleted file mode 100644 index 8245cf5e..00000000 --- a/syntaxes/fjsx15/function/support/core-parameters.sublime-syntax +++ /dev/null @@ -1,51 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -contexts: - main: - - match: \s*(\() - captures: - 1: >- - support.core.js.fjsx15 - punctuation.definition.function.parameters.begin.js.fjsx15 - set: [ delimiters, optional-parameter ] - - delimiters: - - include: comment-no-pop - - match: \s*(\,) - captures: - 1: >- - support.core.js.fjsx15 - punctuation.definition.function.parameters.js.fjsx15 - push: optional-parameter - - match: \s*(\)) - captures: - 1: >- - support.core.js.fjsx15 - punctuation.definition.function.parameters.end.js.fjsx15 - set: optional-return-type - - optional-parameter: - - include: Packages/Naomi/syntaxes/fjsx15/function/parameters.sublime-syntax#optional-parameter - - comment-no-pop: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - - optional-return-type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-associated-type.sublime-syntax diff --git a/syntaxes/fjsx15/function/support/react-js-body.sublime-syntax b/syntaxes/fjsx15/function/support/react-js-body.sublime-syntax deleted file mode 100644 index af8b7fa3..00000000 --- a/syntaxes/fjsx15/function/support/react-js-body.sublime-syntax +++ /dev/null @@ -1,41 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -contexts: - main: - - match: \s*(\{) - captures: - 1: >- - support.lib.react-js.js.fjsx15 - punctuation.definition.function.body.begin.js.fjsx15 - set: body-content - - body-content: - - match: \s*(}) - captures: - 1: >- - support.lib.react-js.js.fjsx15 - punctuation.definition.function.body.end.js.fjsx15 - pop: true - - match: "" - push: - - match: (?=\s*}) - pop: true - # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax - diff --git a/syntaxes/fjsx15/function/support/react-js-parameters.sublime-syntax b/syntaxes/fjsx15/function/support/react-js-parameters.sublime-syntax deleted file mode 100644 index bf1ae185..00000000 --- a/syntaxes/fjsx15/function/support/react-js-parameters.sublime-syntax +++ /dev/null @@ -1,50 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -contexts: - main: - - match: \s*(\() - captures: - 1: >- - support.lib.react-js.js.fjsx15 - punctuation.definition.function.parameters.begin.js.fjsx15 - set: [ delimiters, optional-parameter ] - - delimiters: - - match: \s*(\,) - captures: - 1: >- - support.lib.react-js.js.fjsx15 - punctuation.definition.function.parameters.js.fjsx15 - push: optional-parameter - - match: \s*(\)) - captures: - 1: >- - support.lib.react-js.js.fjsx15 - punctuation.definition.function.parameters.end.js.fjsx15 - set: optional-return-type - - optional-parameter: - - include: Packages/Naomi/syntaxes/fjsx15/function/parameters.sublime-syntax#optional-parameter - - comment-no-pop: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - - optional-return-type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-associated-type.sublime-syntax diff --git a/syntaxes/fjsx15/jest.sublime-syntax b/syntaxes/fjsx15/jest.sublime-syntax index a0bf2816..4188a152 100644 --- a/syntaxes/fjsx15/jest.sublime-syntax +++ b/syntaxes/fjsx15/jest.sublime-syntax @@ -23,7 +23,7 @@ contexts: - include: matchers arguments: - - include: Packages/Naomi/syntaxes/fjsx15/function-call/support/jest-arguments.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/function-call/arguments.sublime-syntax core: - match: | diff --git a/syntaxes/fjsx15/node-js.sublime-syntax b/syntaxes/fjsx15/node-js.sublime-syntax index 0c8e5f04..5c3e3a1f 100644 --- a/syntaxes/fjsx15/node-js.sublime-syntax +++ b/syntaxes/fjsx15/node-js.sublime-syntax @@ -26,7 +26,7 @@ contexts: - include: constants function-arguments: - - include: Packages/Naomi/syntaxes/fjsx15/function-call/support/core-arguments.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/function-call/arguments.sublime-syntax module: - match: | diff --git a/syntaxes/fjsx15/react-js.sublime-syntax b/syntaxes/fjsx15/react-js.sublime-syntax index d5737f23..9739c012 100644 --- a/syntaxes/fjsx15/react-js.sublime-syntax +++ b/syntaxes/fjsx15/react-js.sublime-syntax @@ -26,7 +26,7 @@ contexts: - include: react-dom-functions arguments: - - include: Packages/Naomi/syntaxes/fjsx15/function-call/support/react-js-arguments.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/function-call/arguments.sublime-syntax optional-property-type-and-value: - include: Packages/Naomi/syntaxes/fjsx15/class/property.sublime-syntax#optional-type-and-value diff --git a/syntaxes/fjsx15/web.sublime-syntax b/syntaxes/fjsx15/web.sublime-syntax index d0a26d38..9b59a846 100644 --- a/syntaxes/fjsx15/web.sublime-syntax +++ b/syntaxes/fjsx15/web.sublime-syntax @@ -25,7 +25,7 @@ contexts: optional-template-and-arguments: - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/arguments.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/function-call/support/core-arguments.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/function-call/arguments.sublime-syntax - match: (?=\s*\S) pop: true From 116cdc43cb4590cc37db9d7e3da503a072efc461 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 18 Dec 2017 22:32:05 -0200 Subject: [PATCH 260/407] [FJSX15] Normalize parameters scope --- syntaxes/fjsx15/function/parameters.sublime-syntax | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/syntaxes/fjsx15/function/parameters.sublime-syntax b/syntaxes/fjsx15/function/parameters.sublime-syntax index bd2c977e..82a133cc 100644 --- a/syntaxes/fjsx15/function/parameters.sublime-syntax +++ b/syntaxes/fjsx15/function/parameters.sublime-syntax @@ -21,7 +21,7 @@ contexts: main: - match: \s*(\() captures: - 1: punctuation.definition.function.parameters.begin.js.fjsx15 + 1: punctuation.section.group.begin.js.fjsx15 set: [ delimiters, optional-parameter ] delimiters: @@ -29,11 +29,11 @@ contexts: - include: comment-no-pop - match: \s*(\,) captures: - 1: punctuation.definition.function.parameters.js.fjsx15 + 1: punctuation.separator.js.fjsx15 push: optional-parameter - match: \s*(\)) captures: - 1: punctuation.definition.function.parameters.end.js.fjsx15 + 1: punctuation.section.group.end.js.fjsx15 set: optional-return-type optional-parameter: From c5d6e8ed240f48399203b2e193925196aef9f8a9 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 18 Dec 2017 22:32:21 -0200 Subject: [PATCH 261/407] [FJSX15] Normalize constructor scope --- syntaxes/fjsx15/class/method.sublime-syntax | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/syntaxes/fjsx15/class/method.sublime-syntax b/syntaxes/fjsx15/class/method.sublime-syntax index e4c91281..56d98344 100644 --- a/syntaxes/fjsx15/class/method.sublime-syntax +++ b/syntaxes/fjsx15/class/method.sublime-syntax @@ -81,9 +81,7 @@ contexts: (?x) \s*(constructor)\b captures: - 1: >- - support.js.fjsx15 - entity.name.function.js.fjsx15 + 1: entity.name.function.constructor.js.fjsx15 set: [ optional-support-body, support-parameters From 34f7af94d91d5d53aaf0d62aa6b29faa5738afff Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 18 Dec 2017 22:35:23 -0200 Subject: [PATCH 262/407] [FJSX15] Expand method meta scope --- syntaxes/fjsx15/class/method.sublime-syntax | 2 +- .../fjsx15/class/method/body.sublime-syntax | 42 +++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 syntaxes/fjsx15/class/method/body.sublime-syntax diff --git a/syntaxes/fjsx15/class/method.sublime-syntax b/syntaxes/fjsx15/class/method.sublime-syntax index 56d98344..f9a17bcd 100644 --- a/syntaxes/fjsx15/class/method.sublime-syntax +++ b/syntaxes/fjsx15/class/method.sublime-syntax @@ -121,7 +121,7 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/class/method/parameters.sublime-syntax body: - - include: Packages/Naomi/syntaxes/fjsx15/function/body.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/class/method/body.sublime-syntax optional-body: - include: body diff --git a/syntaxes/fjsx15/class/method/body.sublime-syntax b/syntaxes/fjsx15/class/method/body.sublime-syntax new file mode 100644 index 00000000..b0ad80b2 --- /dev/null +++ b/syntaxes/fjsx15/class/method/body.sublime-syntax @@ -0,0 +1,42 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +contexts: + main: + - match: \s*(\{) + captures: + 1: punctuation.section.block.begin.js.fjsx15 + set: [ + close-body, + optional-statements-and-expressions + ] + + close-body: + - meta_scope: >- + meta.function.js.fjsx15 + meta.method.js.fjsx15 + - match: \s*(}) + captures: + 1: punctuation.section.block.end.js.fjsx15 + pop: true + - match: "" + push: optional-statements-and-expressions + + optional-statements-and-expressions: + - include: Packages/Naomi/syntaxes/fjsx15/optional-statements-and-expressions.sublime-syntax From f80e5d54500c7e991d386239daa391d9f4b755e0 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 23 Dec 2017 16:33:33 -0200 Subject: [PATCH 263/407] [FJSX15] Fix operators order --- syntaxes/fjsx15/operator.sublime-syntax | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/syntaxes/fjsx15/operator.sublime-syntax b/syntaxes/fjsx15/operator.sublime-syntax index 66d2e88a..17ea3fa5 100644 --- a/syntaxes/fjsx15/operator.sublime-syntax +++ b/syntaxes/fjsx15/operator.sublime-syntax @@ -22,13 +22,14 @@ contexts: # It is impossible to detect multiline arrow functions, but we can still # detect its body as if it were an operator. - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/body.sublime-syntax - # Actual operators. + # Position dependent operators. - include: Packages/Naomi/syntaxes/fjsx15/operator/pipe.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/operator/arithmetic.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/operator/comparison.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/assignment.sublime-syntax + # Position independent operators. + - include: Packages/Naomi/syntaxes/fjsx15/operator/arithmetic.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/await.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/bitwise.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/operator/comparison.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/delete.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/in.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/logical.sublime-syntax From ca7396182fd2459d71f013352855efdaafea2627 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 23 Dec 2017 16:52:03 -0200 Subject: [PATCH 264/407] [FJSX15] Normalize function meta scopes --- syntaxes/fjsx15/expression.sublime-syntax | 2 +- .../fjsx15/function-expression.sublime-syntax | 80 +++++++++++++++++++ syntaxes/fjsx15/function.sublime-syntax | 11 +-- .../fjsx15/function/parameters.sublime-syntax | 1 - 4 files changed, 85 insertions(+), 9 deletions(-) create mode 100644 syntaxes/fjsx15/function-expression.sublime-syntax diff --git a/syntaxes/fjsx15/expression.sublime-syntax b/syntaxes/fjsx15/expression.sublime-syntax index 7d7a8f73..d4411a19 100644 --- a/syntaxes/fjsx15/expression.sublime-syntax +++ b/syntaxes/fjsx15/expression.sublime-syntax @@ -99,7 +99,7 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/jsx1.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/literal.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/class.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/function.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/function-expression.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function-call.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/variable.sublime-syntax#function-assigned-to-variable - include: Packages/Naomi/syntaxes/fjsx15/constant.sublime-syntax diff --git a/syntaxes/fjsx15/function-expression.sublime-syntax b/syntaxes/fjsx15/function-expression.sublime-syntax new file mode 100644 index 00000000..81a6f661 --- /dev/null +++ b/syntaxes/fjsx15/function-expression.sublime-syntax @@ -0,0 +1,80 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + +contexts: + main: + - include: Packages/Naomi/syntaxes/fjsx15/core.sublime-syntax#function-properties + - match: | + (?x) + (?=\s* + (?:async\s+)? + function\b + ) + set: [ + declaration, + keyword + ] + + keyword: + - include: Packages/Naomi/syntaxes/fjsx15/async.no-pop.sublime-syntax + - match: \s*(function) + captures: + 1: storage.type.function.js.fjsx15 + pop: true + + declaration: + - meta_scope: meta.function.js.fjsx15 + - include: comment-no-pop + # Body. + - match: (?=\s*\{) + set: body + # Template parameters. + - match: (?=\s*<) + push: template-parameters + # Parameters. + - match: (?=\s*\() + push: parameters + # Identifier. + - match: | + (?xi)\s* + (\*)? + (?:\s*({{commonIdentifier}}))? + captures: + 1: storage.modifier.js.fjsx15 + 2: entity.name.function.js.fjsx15 + # None of the expected items matched, it probably ended. + - match: (?=\s*\S) + pop: true + + comment-no-pop: + - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax + + template-parameters: + - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/parameters.sublime-syntax + + parameters: + - include: Packages/Naomi/syntaxes/fjsx15/function/parameters.sublime-syntax + + body: + - include: Packages/Naomi/syntaxes/fjsx15/function/body.sublime-syntax diff --git a/syntaxes/fjsx15/function.sublime-syntax b/syntaxes/fjsx15/function.sublime-syntax index d7cd6c08..613c0a0f 100644 --- a/syntaxes/fjsx15/function.sublime-syntax +++ b/syntaxes/fjsx15/function.sublime-syntax @@ -44,7 +44,9 @@ contexts: pop: true declaration: - - meta_scope: meta.function.declaration.js.fjsx15 + - meta_scope: >- + meta.declaration.function.js.fjsx15 + meta.function.js.fjsx15 - include: comment-no-pop # Body. - match: (?=\s*\{) @@ -54,7 +56,7 @@ contexts: push: template-parameters # Parameters. - match: (?=\s*\() - set: [ optional-body, parameters ] + push: parameters # Identifier. - match: | (?xi)\s* @@ -76,10 +78,5 @@ contexts: parameters: - include: Packages/Naomi/syntaxes/fjsx15/function/parameters.sublime-syntax - optional-body: - - include: body - - match: (?=\s*\S) - pop: true - body: - include: Packages/Naomi/syntaxes/fjsx15/function/body.sublime-syntax diff --git a/syntaxes/fjsx15/function/parameters.sublime-syntax b/syntaxes/fjsx15/function/parameters.sublime-syntax index 82a133cc..99ebb2af 100644 --- a/syntaxes/fjsx15/function/parameters.sublime-syntax +++ b/syntaxes/fjsx15/function/parameters.sublime-syntax @@ -25,7 +25,6 @@ contexts: set: [ delimiters, optional-parameter ] delimiters: - - meta_scope: meta.function.declaration.js.fjsx15 - include: comment-no-pop - match: \s*(\,) captures: From 59d1c882b42d1916eb89e7d3549356015b040359 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 23 Dec 2017 17:16:17 -0200 Subject: [PATCH 265/407] [FJSX15] Simplify arrow functions and normalize their scopes --- syntaxes/fjsx15/arrow-function.no-pop.sublime-syntax | 11 ++++------- syntaxes/fjsx15/arrow-function.sublime-syntax | 4 +++- syntaxes/fjsx15/arrow-function/body.sublime-syntax | 1 - .../parameters.no-pop.sublime-syntax | 2 +- 4 files changed, 8 insertions(+), 10 deletions(-) rename syntaxes/fjsx15/{arrow-function => function}/parameters.no-pop.sublime-syntax (88%) diff --git a/syntaxes/fjsx15/arrow-function.no-pop.sublime-syntax b/syntaxes/fjsx15/arrow-function.no-pop.sublime-syntax index 00a77011..251a54de 100644 --- a/syntaxes/fjsx15/arrow-function.no-pop.sublime-syntax +++ b/syntaxes/fjsx15/arrow-function.no-pop.sublime-syntax @@ -106,12 +106,9 @@ contexts: push: single-parameter-arrow-function normal-arrow-function: - - include: Packages/Naomi/syntaxes/fjsx15/async.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/parameters.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/parameters.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/body.sublime-syntax + - meta_scope: meta.function.js.fjsx15 + - include: Packages/Naomi/syntaxes/fjsx15/arrow-function.sublime-syntax#normal-arrow-function single-parameter-arrow-function: - - include: Packages/Naomi/syntaxes/fjsx15/async.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/simple.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/body.sublime-syntax + - meta_scope: meta.function.js.fjsx15 + - include: Packages/Naomi/syntaxes/fjsx15/arrow-function.sublime-syntax#single-parameter-arrow-function diff --git a/syntaxes/fjsx15/arrow-function.sublime-syntax b/syntaxes/fjsx15/arrow-function.sublime-syntax index 44886c46..bd3de9bc 100644 --- a/syntaxes/fjsx15/arrow-function.sublime-syntax +++ b/syntaxes/fjsx15/arrow-function.sublime-syntax @@ -104,12 +104,14 @@ contexts: set: single-parameter-arrow-function normal-arrow-function: + - meta_scope: meta.function.js.fjsx15 - include: Packages/Naomi/syntaxes/fjsx15/async.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/parameters.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/parameters.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/function/parameters.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/body.sublime-syntax single-parameter-arrow-function: + - meta_scope: meta.function.js.fjsx15 - include: Packages/Naomi/syntaxes/fjsx15/async.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/simple.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/body.sublime-syntax diff --git a/syntaxes/fjsx15/arrow-function/body.sublime-syntax b/syntaxes/fjsx15/arrow-function/body.sublime-syntax index 370b5e59..fe34b893 100644 --- a/syntaxes/fjsx15/arrow-function/body.sublime-syntax +++ b/syntaxes/fjsx15/arrow-function/body.sublime-syntax @@ -21,7 +21,6 @@ contexts: main: - match: \s*(=>) captures: - 0: meta.function.js.fjsx15 1: storage.type.function.arrow.js.fjsx15 set: possible-multi-statement-body diff --git a/syntaxes/fjsx15/arrow-function/parameters.no-pop.sublime-syntax b/syntaxes/fjsx15/function/parameters.no-pop.sublime-syntax similarity index 88% rename from syntaxes/fjsx15/arrow-function/parameters.no-pop.sublime-syntax rename to syntaxes/fjsx15/function/parameters.no-pop.sublime-syntax index fdec957b..3fb63dbe 100644 --- a/syntaxes/fjsx15/arrow-function/parameters.no-pop.sublime-syntax +++ b/syntaxes/fjsx15/function/parameters.no-pop.sublime-syntax @@ -23,4 +23,4 @@ contexts: push: parameters parameters: - - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/parameters.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/function/parameters.sublime-syntax From 19fedb1740d9800813307357ab5c6d716ad0ed7c Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 23 Dec 2017 17:24:40 -0200 Subject: [PATCH 266/407] [FJSX15] Simplify and normalize method scopes --- syntaxes/fjsx15/class/method.sublime-syntax | 13 +++--- .../fjsx15/class/method/body.sublime-syntax | 42 ----------------- .../class/method/parameters.sublime-syntax | 45 ------------------- 3 files changed, 5 insertions(+), 95 deletions(-) delete mode 100644 syntaxes/fjsx15/class/method/body.sublime-syntax delete mode 100644 syntaxes/fjsx15/class/method/parameters.sublime-syntax diff --git a/syntaxes/fjsx15/class/method.sublime-syntax b/syntaxes/fjsx15/class/method.sublime-syntax index f9a17bcd..aaf64848 100644 --- a/syntaxes/fjsx15/class/method.sublime-syntax +++ b/syntaxes/fjsx15/class/method.sublime-syntax @@ -61,8 +61,8 @@ contexts: declaration: - meta_scope: >- - meta.function.declaration.js.fjsx15 - meta.method.js.fjsx15 + meta.declaration.function.method.js.fjsx15 + meta.function.js.fjsx15 - include: comment-no-pop # Body. - match: (?=\s*\{) @@ -72,10 +72,7 @@ contexts: push: template-parameters # Parameters. - match: (?=\s*\() - set: [ - optional-body, - parameters - ] + push: parameters # Support identifier. - match: | (?x) @@ -115,13 +112,13 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/parameters.sublime-syntax parameters: - - include: Packages/Naomi/syntaxes/fjsx15/class/method/parameters.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/function/parameters.sublime-syntax support-parameters: - include: Packages/Naomi/syntaxes/fjsx15/class/method/parameters.sublime-syntax body: - - include: Packages/Naomi/syntaxes/fjsx15/class/method/body.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/function/body.sublime-syntax optional-body: - include: body diff --git a/syntaxes/fjsx15/class/method/body.sublime-syntax b/syntaxes/fjsx15/class/method/body.sublime-syntax deleted file mode 100644 index b0ad80b2..00000000 --- a/syntaxes/fjsx15/class/method/body.sublime-syntax +++ /dev/null @@ -1,42 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -contexts: - main: - - match: \s*(\{) - captures: - 1: punctuation.section.block.begin.js.fjsx15 - set: [ - close-body, - optional-statements-and-expressions - ] - - close-body: - - meta_scope: >- - meta.function.js.fjsx15 - meta.method.js.fjsx15 - - match: \s*(}) - captures: - 1: punctuation.section.block.end.js.fjsx15 - pop: true - - match: "" - push: optional-statements-and-expressions - - optional-statements-and-expressions: - - include: Packages/Naomi/syntaxes/fjsx15/optional-statements-and-expressions.sublime-syntax diff --git a/syntaxes/fjsx15/class/method/parameters.sublime-syntax b/syntaxes/fjsx15/class/method/parameters.sublime-syntax deleted file mode 100644 index 312aa996..00000000 --- a/syntaxes/fjsx15/class/method/parameters.sublime-syntax +++ /dev/null @@ -1,45 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -contexts: - main: - - match: \s*(\() - captures: - 1: punctuation.section.group.begin.js.fjsx15 - set: [ delimiters, optional-parameter ] - - delimiters: - - meta_scope: >- - meta.function.declaration.js.fjsx15 - meta.method.js.fjsx15 - - include: comment-no-pop - - match: \s*(\,) - captures: - 1: punctuation.separator.js.fjsx15 - push: optional-parameter - - match: \s*(\)) - captures: - 1: punctuation.section.group.end.js.fjsx15 - set: optional-return-type - - optional-parameter: - - include: Packages/Naomi/syntaxes/fjsx15/function/parameters.sublime-syntax#optional-parameter - - optional-return-type: - - include: Packages/Naomi/syntaxes/fjsx15/function/parameters.sublime-syntax#optional-return-type From c61ff08b564d800643a534d3b2c337631a8f5e73 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 23 Dec 2017 18:08:27 -0200 Subject: [PATCH 267/407] [FJSX15] Expose expression escape pattern --- syntaxes/fjsx15/optional-expression.sublime-syntax | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/optional-expression.sublime-syntax b/syntaxes/fjsx15/optional-expression.sublime-syntax index be1d3e3c..781f6ada 100644 --- a/syntaxes/fjsx15/optional-expression.sublime-syntax +++ b/syntaxes/fjsx15/optional-expression.sublime-syntax @@ -19,6 +19,9 @@ scope: ... contexts: main: + - include: expression-escape + - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax + + expression-escape: - match: (?=\s*[,;:)\]}]) pop: true - - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax From 1e52741be28f53b2b9acc9f936558f6b1fa1696e Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 23 Dec 2017 18:08:50 -0200 Subject: [PATCH 268/407] [FJSX15] Simplify function call and normalize scopes --- syntaxes/fjsx15/function-call.sublime-syntax | 13 ++++++++++++- .../fjsx15/function-call/arguments.sublime-syntax | 12 +++--------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/syntaxes/fjsx15/function-call.sublime-syntax b/syntaxes/fjsx15/function-call.sublime-syntax index cb97553f..4e976669 100644 --- a/syntaxes/fjsx15/function-call.sublime-syntax +++ b/syntaxes/fjsx15/function-call.sublime-syntax @@ -30,7 +30,6 @@ variables: >) contexts: - # There’s no need to highlight the arguments, the expression loop will do it. main: # Template function call. - match: | @@ -43,6 +42,8 @@ contexts: \s*\( ) set: [ + meta-scope, + arguments, template-arguments, identifier, optional-modifier @@ -57,6 +58,8 @@ contexts: \s*\( ) set: [ + meta-scope, + arguments, identifier, optional-modifier ] @@ -79,3 +82,11 @@ contexts: template-arguments: - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/arguments.sublime-syntax + + arguments: + - include: Packages/Naomi/syntaxes/fjsx15/function-call/arguments.sublime-syntax + + meta-scope: + - meta_scope: meta.function-call.js.fjsx15 + - match: "" + pop: true diff --git a/syntaxes/fjsx15/function-call/arguments.sublime-syntax b/syntaxes/fjsx15/function-call/arguments.sublime-syntax index 8dacf654..cce2d089 100644 --- a/syntaxes/fjsx15/function-call/arguments.sublime-syntax +++ b/syntaxes/fjsx15/function-call/arguments.sublime-syntax @@ -21,23 +21,17 @@ contexts: main: - match: \s*(\() captures: - 1: >- - meta.function-call.js.fjsx15 - punctuation.definition.function.arguments.begin.js.fjsx15 + 1: punctuation.section.group.begin.js.fjsx15 set: [ delimiter, optional-expression ] delimiter: - match: \s*(\)) captures: - 1: >- - meta.function-call.js.fjsx15 - punctuation.definition.function.arguments.end.js.fjsx15 + 1: punctuation.section.group.end.js.fjsx15 pop: true - match: \s*(,) captures: - 1: >- - meta.function-call.js.fjsx15 - punctuation.definition.function.arguments.js.fjsx15 + 1: punctuation.separator.comma.js.fjsx15 push: optional-expression optional-expression: From 5cb4af0c9a2edaff9b0d5d55122b868ff632080d Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 23 Dec 2017 18:09:00 -0200 Subject: [PATCH 269/407] [FJSX15] Simplify and normalize decorators --- syntaxes/fjsx15/decorator.sublime-syntax | 43 ++++++++++++- .../fjsx15/decorator/arguments.sublime-syntax | 38 ------------ .../decorator/identifier.sublime-syntax | 60 ------------------- 3 files changed, 40 insertions(+), 101 deletions(-) delete mode 100644 syntaxes/fjsx15/decorator/arguments.sublime-syntax delete mode 100644 syntaxes/fjsx15/decorator/identifier.sublime-syntax diff --git a/syntaxes/fjsx15/decorator.sublime-syntax b/syntaxes/fjsx15/decorator.sublime-syntax index 5541a3c0..24f6064b 100644 --- a/syntaxes/fjsx15/decorator.sublime-syntax +++ b/syntaxes/fjsx15/decorator.sublime-syntax @@ -30,7 +30,44 @@ contexts: (?={{decoratorIdentifier}}) captures: 1: punctuation.definition.annotation.js.fjsx15 - set: identifier + set: decorator-identifier - identifier: - - include: Packages/Naomi/syntaxes/fjsx15/decorator/identifier.sublime-syntax + decorator-identifier: + - meta_scope: meta.annotation.js.fjsx15 + # With arguments. + - match: | + (?xi)\s* + ({{decoratorIdentifier}}) + (?=\s*\() + captures: + 1: variable.annotation.js.fjsx15 + set: [ + possible-chain, + meta-scope, + arguments + ] + # Without arguments. + - match: | + (?xi)\s* + ({{decoratorIdentifier}}) + captures: + 1: variable.annotation.js.fjsx15 + set: possible-chain + + arguments: + - include: Packages/Naomi/syntaxes/fjsx15/function-call/arguments.sublime-syntax + + # The decorator might be followed by a chain of function calls and we want to + # to highlight them as decorators too. + possible-chain: + - match: \s*(\.) + captures: + 1: punctuation.definition.decorator.chain.js.fjsx15 + set: decorator-identifier + - match: (?=\s*\S) + pop: true + + meta-scope: + - meta_scope: meta.annotation.js.fjsx15 + - match: "" + pop: true diff --git a/syntaxes/fjsx15/decorator/arguments.sublime-syntax b/syntaxes/fjsx15/decorator/arguments.sublime-syntax deleted file mode 100644 index 58590979..00000000 --- a/syntaxes/fjsx15/decorator/arguments.sublime-syntax +++ /dev/null @@ -1,38 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -contexts: - main: - - match: \s*(\() - captures: - 1: punctuation.definition.decorator.arguments.begin.js.fjsx15 - set: [ delimiters, optional-expression ] - - delimiters: - - match: \s*(\,) - captures: - 1: punctuation.definition.decorator.arguments.js.fjsx15 - push: optional-expression - - match: \s*(\)) - captures: - 1: punctuation.definition.decorator.arguments.end.js.fjsx15 - pop: true - - optional-expression: - - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/decorator/identifier.sublime-syntax b/syntaxes/fjsx15/decorator/identifier.sublime-syntax deleted file mode 100644 index 85065df4..00000000 --- a/syntaxes/fjsx15/decorator/identifier.sublime-syntax +++ /dev/null @@ -1,60 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -variables: - decoratorIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - -contexts: - main: - - include: decorator-identifier - - decorator-identifier: - # With arguments. - - match: | - (?xi)\s* - ({{decoratorIdentifier}}) - (?=\s*\() - captures: - 1: variable.annotation.js.fjsx15 - set: [ - possible-chain, - arguments - ] - # Without arguments. - - match: | - (?xi)\s* - ({{decoratorIdentifier}}) - captures: - 1: variable.annotation.js.fjsx15 - set: possible-chain - - arguments: - - include: Packages/Naomi/syntaxes/fjsx15/decorator/arguments.sublime-syntax - - # The decorator might be followed by a chain of function calls and we want to - # to highlight them as decorators too. - possible-chain: - - match: \s*(\.) - captures: - 1: punctuation.definition.decorator.chain.js.fjsx15 - set: decorator-identifier - - match: (?=\s*\S) - pop: true From cfdadbc92986e6fb71ccdc225a7421e37eb81e1d Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 23 Dec 2017 18:16:25 -0200 Subject: [PATCH 270/407] [FJSX15] Fix reference to paramters --- syntaxes/fjsx15/class/method.sublime-syntax | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/class/method.sublime-syntax b/syntaxes/fjsx15/class/method.sublime-syntax index aaf64848..c71ee01b 100644 --- a/syntaxes/fjsx15/class/method.sublime-syntax +++ b/syntaxes/fjsx15/class/method.sublime-syntax @@ -115,7 +115,7 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/function/parameters.sublime-syntax support-parameters: - - include: Packages/Naomi/syntaxes/fjsx15/class/method/parameters.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/function/parameters.sublime-syntax body: - include: Packages/Naomi/syntaxes/fjsx15/function/body.sublime-syntax From 58cf21472c4def765906d951f919af4178588ec0 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 23 Dec 2017 20:18:22 -0200 Subject: [PATCH 271/407] [FJSX15] Use the core regex --- .../literal/string/regex.sublime-syntax | 28 +++++-------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/syntaxes/fjsx15/literal/string/regex.sublime-syntax b/syntaxes/fjsx15/literal/string/regex.sublime-syntax index 10383e62..5ab225a9 100644 --- a/syntaxes/fjsx15/literal/string/regex.sublime-syntax +++ b/syntaxes/fjsx15/literal/string/regex.sublime-syntax @@ -27,31 +27,17 @@ contexts: (?- - string.unquoted.regex.js.fjsx15 - punctuation.definition.string.begin.js.fjsx15 - set: escape-a + scope: punctuation.definition.string.begin.js.fjsx15 + set: regex + + regex: + - meta_scope: string.regexp.js.fjsx15 + - include: Packages/JavaScript/Regular Expressions (JavaScript).sublime-syntax + - include: regex-end regex-end: - match: (/)([a-z]{0,5}) captures: - 0: string.unquoted.regex.js.fjsx15 1: punctuation.definition.string.end.js.fjsx15 2: regex.flag.js.fjsx15 pop: true - - escape-a: - - meta_content_scope: string.unquoted.regex.js.fjsx15 - - match: \\. - scope: constant.character.escape.a.js.fjsx15 - set: escape-b - # If the slash was not consumed before, it is probably the end of the regex. - - include: regex-end - - escape-b: - - meta_content_scope: string.unquoted.regex.js.fjsx15 - - match: \\. - scope: constant.character.escape.b.js.fjsx15 - set: escape-a - # If the slash was not consumed before, it is probably the end of the regex. - - include: regex-end From 6fe37ebdb58b66eff265e437cbb2b2b60fe9df60 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 23 Dec 2017 20:18:48 -0200 Subject: [PATCH 272/407] [FJSX15] Normalize flow types --- .../fjsx15/flowtype/simple.sublime-syntax | 12 +++------- .../template/parameters.sublime-syntax | 13 ++++------- .../flowtype/type-aliasing.sublime-syntax | 22 ++++++++++++++----- 3 files changed, 24 insertions(+), 23 deletions(-) diff --git a/syntaxes/fjsx15/flowtype/simple.sublime-syntax b/syntaxes/fjsx15/flowtype/simple.sublime-syntax index 529a4652..187e3875 100644 --- a/syntaxes/fjsx15/flowtype/simple.sublime-syntax +++ b/syntaxes/fjsx15/flowtype/simple.sublime-syntax @@ -28,9 +28,7 @@ contexts: # Existential. - match: \s*(\*) captures: - 1: >- - flowtype - entity.name.type.existential.flowtype + 1: entity.name.type.existential.flowtype pop: true # Predefined types. - match: | @@ -51,16 +49,12 @@ contexts: | void ))\b captures: - 1: >- - flowtype - support.type.flowtype + 1: support.type.flowtype pop: true # Other types. - match: | (?xi)\s* ({{commonIdentifier}}) captures: - 1: >- - flowtype - variable.other.type.flowtype + 1: variable.other.type.flowtype pop: true diff --git a/syntaxes/fjsx15/flowtype/template/parameters.sublime-syntax b/syntaxes/fjsx15/flowtype/template/parameters.sublime-syntax index 47d09a75..b7ce1afb 100644 --- a/syntaxes/fjsx15/flowtype/template/parameters.sublime-syntax +++ b/syntaxes/fjsx15/flowtype/template/parameters.sublime-syntax @@ -21,23 +21,18 @@ contexts: main: - match: \s*(<) captures: - 1: >- - flowtype - punctuation.definition.template.parameters.begin.flowtype + 1: punctuation.definition.generic.begin.flowtype set: [ delimiters, optional-type-expression ] delimiters: + - meta_scope: meta.generic.flowtype - match: \s*(,) captures: - 1: >- - flowtype - punctuation.definition.template.parameters.flowtype + 1: punctuation.separator.comma.flowtype push: optional-type-expression - match: \s*(>) captures: - 1: >- - flowtype - punctuation.definition.template.parameters.end.flowtype + 1: punctuation.definition.generic.end.flowtype pop: true optional-type-expression: diff --git a/syntaxes/fjsx15/flowtype/type-aliasing.sublime-syntax b/syntaxes/fjsx15/flowtype/type-aliasing.sublime-syntax index af7a95ad..3f35c189 100644 --- a/syntaxes/fjsx15/flowtype/type-aliasing.sublime-syntax +++ b/syntaxes/fjsx15/flowtype/type-aliasing.sublime-syntax @@ -52,17 +52,29 @@ contexts: ] identifier: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/simple.sublime-syntax + - match: | + (?xi)\s* + ({{commonIdentifier}}) + captures: + 1: entity.name.type.flowtype + pop: true punctuation: + - meta_scope: meta.declaration.type.flowtype - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/parameters.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.no-pop.sublime-syntax - match: \s*(=) captures: - 1: >- - flowtype - keyword.operator.other.assignment.flowtype - set: optional-type-expression + 1: keyword.operator.other.assignment.flowtype + set: [ + meta-scope, + optional-type-expression + ] optional-type-expression: - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-type-expression.sublime-syntax + + meta-scope: + - meta_scope: meta.declaration.type.flowtype + - match: "" + pop: true From 5c21a1f4f5b155e7468f51aa559cb269032934d7 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 23 Dec 2017 20:18:48 -0200 Subject: [PATCH 273/407] [FJSX15] Normalize new and typeof operators --- syntaxes/fjsx15/operator/new.sublime-syntax | 25 ++++++++++++++++--- .../fjsx15/operator/typeof.sublime-syntax | 23 +++++++++++++---- 2 files changed, 40 insertions(+), 8 deletions(-) diff --git a/syntaxes/fjsx15/operator/new.sublime-syntax b/syntaxes/fjsx15/operator/new.sublime-syntax index 6e14476f..c9d30937 100644 --- a/syntaxes/fjsx15/operator/new.sublime-syntax +++ b/syntaxes/fjsx15/operator/new.sublime-syntax @@ -43,15 +43,32 @@ contexts: captures: 1: keyword.operator.word.new.js.fjsx15 set: [ - optional-template-and-arguments, + meta-instance-call-constructor-scope, + optional-arguments, type ] # Any other expression after the keyword. - match: (?i)\s*(new)\b captures: 1: keyword.operator.word.new.js.fjsx15 + set: [ + meta-instance-scope, + optional-expression + ] + + escape: + - match: "" pop: true + meta-instance-scope: + - meta_scope: meta.instance.js.fjsx15 + - include: escape + + meta-instance-call-constructor-scope: + - meta_scope: meta.instance.js.fjsx15 + - meta_content_scope: meta.function-call.constructor.js.fjsx15 + - include: escape + type: - include: Packages/Naomi/syntaxes/fjsx15/core.sublime-syntax # Other constructors. @@ -62,8 +79,10 @@ contexts: 1: variable.type.js.fjsx15 pop: true - optional-template-and-arguments: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/arguments.no-pop.sublime-syntax + optional-arguments: - include: Packages/Naomi/syntaxes/fjsx15/function-call/arguments.sublime-syntax - match: (?=\s*\S) pop: true + + optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/operator/typeof.sublime-syntax b/syntaxes/fjsx15/operator/typeof.sublime-syntax index b42bb9e6..418b2899 100644 --- a/syntaxes/fjsx15/operator/typeof.sublime-syntax +++ b/syntaxes/fjsx15/operator/typeof.sublime-syntax @@ -17,13 +17,26 @@ hidden: true scope: ... +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + contexts: main: - - match: \s*(typeof)\b + # Type after typeof. + - match: | + (?xi)\s* + (typeof) + (?=\s+{{commonIdentifier}}) + captures: + 1: keyword.operator.word.typeof.js.fjsx15 + set: type + # Any other expression after the keyword. + - match: (?i)\s*(typeof)\b captures: - 1: keyword.operator.typeof.js.fjsx15 - set: type-or-optional-expression + 1: keyword.operator.word.typeof.js.fjsx15 + pop: true - type-or-optional-expression: + type: - include: Packages/Naomi/syntaxes/fjsx15/operator/new.sublime-syntax#type - - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax From 949e6332d3e54d2a2288c83488fe842bdd343bc3 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 24 Dec 2017 14:06:37 -0200 Subject: [PATCH 274/407] [FJSX15] Fix decorator duplicated scope --- syntaxes/fjsx15/decorator.sublime-syntax | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/syntaxes/fjsx15/decorator.sublime-syntax b/syntaxes/fjsx15/decorator.sublime-syntax index 24f6064b..c5be8100 100644 --- a/syntaxes/fjsx15/decorator.sublime-syntax +++ b/syntaxes/fjsx15/decorator.sublime-syntax @@ -29,11 +29,12 @@ contexts: \s*(@) (?={{decoratorIdentifier}}) captures: - 1: punctuation.definition.annotation.js.fjsx15 + 1: >- + meta.annotation.js.fjsx15 + punctuation.definition.annotation.js.fjsx15 set: decorator-identifier decorator-identifier: - - meta_scope: meta.annotation.js.fjsx15 # With arguments. - match: | (?xi)\s* From 8e8d396f025df6d50541c2873c2af45ac685cca5 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 24 Dec 2017 14:07:11 -0200 Subject: [PATCH 275/407] [FJSX15] Fix function call duplicated scope --- syntaxes/fjsx15/function-call.sublime-syntax | 1 - 1 file changed, 1 deletion(-) diff --git a/syntaxes/fjsx15/function-call.sublime-syntax b/syntaxes/fjsx15/function-call.sublime-syntax index 4e976669..5102f52b 100644 --- a/syntaxes/fjsx15/function-call.sublime-syntax +++ b/syntaxes/fjsx15/function-call.sublime-syntax @@ -72,7 +72,6 @@ contexts: pop: true identifier: - - meta_scope: meta.function-call.js.fjsx15 - match: | (?xi) \s*({{commonIdentifier}}) From 7628d6cc86c0e59284443834cddfb73e179e7a0d Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 24 Dec 2017 14:07:36 -0200 Subject: [PATCH 276/407] [FJSX15] Add meta scope to pipe functions --- syntaxes/fjsx15/operator/pipe.sublime-syntax | 23 +++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/syntaxes/fjsx15/operator/pipe.sublime-syntax b/syntaxes/fjsx15/operator/pipe.sublime-syntax index 72c0069e..04dacd9b 100644 --- a/syntaxes/fjsx15/operator/pipe.sublime-syntax +++ b/syntaxes/fjsx15/operator/pipe.sublime-syntax @@ -29,15 +29,26 @@ contexts: 1: keyword.operator.pipe.js.fjsx15 set: target + other-expressions: + - match: (?=\s*\S) + pop: true + target: - include: Packages/Naomi/syntaxes/fjsx15/arrow-function.sublime-syntax # Await keyword. - match: \s*(await)\b captures: - 1: keyword.control.js.fjsx15 + 1: keyword.control.flow.js.fjsx15 set: function-identifier # Simple identifier. - - include: function-identifier + - match: | + (?xi) + (?= + \s*{{commonIdentifier}}\s* + (?>\|>|$) + ) + set: function-identifier + - include: other-expressions function-identifier: # Simple function. @@ -45,8 +56,8 @@ contexts: (?xi)\s* ({{commonIdentifier}}) captures: - 1: variable.function.js.fjsx15 - pop: true - # Other expressions. - - match: (?=\s*\S) + 1: >- + meta.function-call.js.fjsx15 + variable.function.js.fjsx15 pop: true + - include: other-expressions From 79b2530c5437c3f58cea1a903dc969a5af81e449 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 24 Dec 2017 14:08:07 -0200 Subject: [PATCH 277/407] [FJSX15] Add meta scope to function parameters --- .../fjsx15/function/parameter/simple.sublime-syntax | 11 +++++++++++ syntaxes/fjsx15/function/parameters.sublime-syntax | 1 + 2 files changed, 12 insertions(+) diff --git a/syntaxes/fjsx15/function/parameter/simple.sublime-syntax b/syntaxes/fjsx15/function/parameter/simple.sublime-syntax index fc5f900f..c4324df5 100644 --- a/syntaxes/fjsx15/function/parameter/simple.sublime-syntax +++ b/syntaxes/fjsx15/function/parameter/simple.sublime-syntax @@ -24,21 +24,32 @@ variables: contexts: main: + # With default value. - match: | (?xi)\s* ({{commonIdentifier}}) + (?=\s*=) captures: 1: variable.parameter.function.js.fjsx15 set: [ optional-default-value, optional-modifier-and-type ] + # Normal parameter. + - match: | + (?xi)\s* + ({{commonIdentifier}}) + captures: + 0: meta.function.parameter.js.fjsx15 + 1: variable.parameter.function.js.fjsx15 + set: optional-modifier-and-type optional-modifier-and-type: - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-modifier.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-associated-type.sublime-syntax optional-default-value: + - meta_scope: meta.function.parameter.optional.js.fjsx15 - match: (?=\s*(?>,|=>)) pop: true - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/function/parameters.sublime-syntax b/syntaxes/fjsx15/function/parameters.sublime-syntax index 99ebb2af..e9319f8e 100644 --- a/syntaxes/fjsx15/function/parameters.sublime-syntax +++ b/syntaxes/fjsx15/function/parameters.sublime-syntax @@ -25,6 +25,7 @@ contexts: set: [ delimiters, optional-parameter ] delimiters: + - meta_scope: meta.function.parameters.js.fjsx15 - include: comment-no-pop - match: \s*(\,) captures: From fb98e4fed39b59917697465713a8dbec79a027d1 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 24 Dec 2017 14:08:17 -0200 Subject: [PATCH 278/407] [FJSX15] Change parameter comma scope --- syntaxes/fjsx15/function/parameters.sublime-syntax | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/function/parameters.sublime-syntax b/syntaxes/fjsx15/function/parameters.sublime-syntax index e9319f8e..59c7c388 100644 --- a/syntaxes/fjsx15/function/parameters.sublime-syntax +++ b/syntaxes/fjsx15/function/parameters.sublime-syntax @@ -29,7 +29,7 @@ contexts: - include: comment-no-pop - match: \s*(\,) captures: - 1: punctuation.separator.js.fjsx15 + 1: punctuation.separator.comma.js.fjsx15 push: optional-parameter - match: \s*(\)) captures: From c7eb271834bef8235ad2328ea560a78b9879c2ed Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 24 Dec 2017 16:35:48 -0200 Subject: [PATCH 279/407] [FJSX15] Enhance optional paramter prediction --- .../function/parameter/simple.sublime-syntax | 66 ++++++++++++++++++- 1 file changed, 64 insertions(+), 2 deletions(-) diff --git a/syntaxes/fjsx15/function/parameter/simple.sublime-syntax b/syntaxes/fjsx15/function/parameter/simple.sublime-syntax index c4324df5..61ccae46 100644 --- a/syntaxes/fjsx15/function/parameter/simple.sublime-syntax +++ b/syntaxes/fjsx15/function/parameter/simple.sublime-syntax @@ -21,6 +21,62 @@ variables: commonIdentifier: | [$_[:alpha:]] [$_[:alnum:]]* + templateArguments: | + (< + [^<>]* + \g<-1>? + [^<>]* + >) + + parameters: | + (\( + [^()]* + \g<-1>? + [^()]* + \)) + + flowOperators: | + (?> &(?!&) + | \|(?!\|) + ) + + string: | + (?> '.*?' + | ".*?" + | `.*` + ) + + simpleFlowType: | + (?> {{string}} + | {{commonIdentifier}} + {{templateArguments}}? + ) + + flowFunction: | + ( + {{parameters}} + \s*=>\s* + (?> {{simpleFlowType}} + | \g<-2> + ) + ) + + complexType: | + ( + \??\s* + (?> {{simpleFlowType}} + | {{flowFunction}} + ) + \s*{{flowOperators}}? + \s*\g<-5>? + ) + + flowComment: /\*\s*:.*?\*/ + + type: | + (?> {{flowComment}} + | :{{complexType}} + ) contexts: main: @@ -28,7 +84,10 @@ contexts: - match: | (?xi)\s* ({{commonIdentifier}}) - (?=\s*=) + (?= + \s*{{type}}? + \s*= + ) captures: 1: variable.parameter.function.js.fjsx15 set: [ @@ -49,7 +108,10 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-associated-type.sublime-syntax optional-default-value: - - meta_scope: meta.function.parameter.optional.js.fjsx15 + - meta_scope: >- + meta.function.parameter.js.fjsx15 + meta.function.parameter.optional.js.fjsx15 - match: (?=\s*(?>,|=>)) pop: true + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax From 88369b3c442f1c002ff0ab75e08a3be5e8edd87f Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 24 Dec 2017 16:38:37 -0200 Subject: [PATCH 280/407] [FJSX15] Expand optional parameter meta scope --- syntaxes/fjsx15/function/parameter/simple.sublime-syntax | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/syntaxes/fjsx15/function/parameter/simple.sublime-syntax b/syntaxes/fjsx15/function/parameter/simple.sublime-syntax index 61ccae46..e19987e6 100644 --- a/syntaxes/fjsx15/function/parameter/simple.sublime-syntax +++ b/syntaxes/fjsx15/function/parameter/simple.sublime-syntax @@ -111,7 +111,10 @@ contexts: - meta_scope: >- meta.function.parameter.js.fjsx15 meta.function.parameter.optional.js.fjsx15 - - match: (?=\s*(?>,|=>)) + - match: (?=\s*(?>[,;:)\]}]|=>)) pop: true - - - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax + - match: "" + push: + - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax + - match: "" + pop: true From f9158e25ce3195183153761571a52303f24ba8ec Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 24 Dec 2017 16:41:38 -0200 Subject: [PATCH 281/407] [FJSX15] Fix object literal key meta scope --- .../literal/object/property.sublime-syntax | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/syntaxes/fjsx15/literal/object/property.sublime-syntax b/syntaxes/fjsx15/literal/object/property.sublime-syntax index 800c896e..3a18188b 100644 --- a/syntaxes/fjsx15/literal/object/property.sublime-syntax +++ b/syntaxes/fjsx15/literal/object/property.sublime-syntax @@ -152,16 +152,26 @@ contexts: 1: punctuation.definition.object.computed-property.begin.js.fjsx15 set: [ associated-value, + key-meta-scope, computed-property-end, optional-expression ] # String. - match: (?=\s*['"`]) - set: [ associated-value, string ] + set: [ + associated-value, + key-meta-scope, + string + ] # Simple property. - include: constant - include: variable + key-meta-scope: + - meta_scope: meta.object-literal.key.js.fjsx15 + - match: "" + pop: true + method-identifier: - match: | (?xi) @@ -199,7 +209,7 @@ contexts: ([_[:upper:]])\b captures: 1: >- - object.property.js.fjsx15 + meta.object-literal.key.js.fjsx15 entity.name.constant.js.fjsx15 set: associated-value # Two or more characters. @@ -213,7 +223,7 @@ contexts: ) captures: 1: >- - object.property.js.fjsx15 + meta.object-literal.key.js.fjsx15 entity.name.constant.js.fjsx15 set: associated-value @@ -226,7 +236,7 @@ contexts: )) captures: 1: >- - object.property.js.fjsx15 + meta.object-literal.key.js.fjsx15 entity.name.variable.js.fjsx15 set: associated-value # Two or more characters. @@ -240,7 +250,7 @@ contexts: ) captures: 1: >- - object.property.js.fjsx15 + meta.object-literal.key.js.fjsx15 entity.name.variable.js.fjsx15 set: associated-value From 02c63a3b8c3fb1daf87d6f4c25116ff3c9f404df Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 25 Dec 2017 14:03:28 -0200 Subject: [PATCH 282/407] [FJSX15] Normalize jest scopes --- syntaxes/fjsx15/jest.sublime-syntax | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/syntaxes/fjsx15/jest.sublime-syntax b/syntaxes/fjsx15/jest.sublime-syntax index 4188a152..a94c632a 100644 --- a/syntaxes/fjsx15/jest.sublime-syntax +++ b/syntaxes/fjsx15/jest.sublime-syntax @@ -39,13 +39,9 @@ contexts: (?:(.)((?>only|skip)))? (?=\s*\() captures: - 1: >- - support.lib.jest.fjsx15 - entity.name.function.js.fjsx15 + 1: support.function.fjsx15 2: punctuation.accessor.js.fjsx15 - 3: >- - support.lib.jest.fjsx15 - entity.name.function.js.fjsx15 + 3: support.function.fjsx15 set: arguments matchers: @@ -79,11 +75,7 @@ contexts: )\b (?=\s*\() captures: - 1: >- - support.lib.jest.fjsx15 - entity.name.function.js.fjsx15 + 1: support.function.fjsx15 2: punctuation.accessor.js.fjsx15 - 3: >- - support.lib.jest.fjsx15 - entity.name.function.js.fjsx15 + 3: support.function.fjsx15 set: arguments From a67ba754553291ff9cb2b14790758cba56e31a0c Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 25 Dec 2017 14:17:17 -0200 Subject: [PATCH 283/407] [FJSX15] Extract flow to its own directory --- syntaxes/fjsx15/arrow-function.sublime-syntax | 2 +- .../arrow-function/parameters.sublime-syntax | 2 +- syntaxes/fjsx15/class.sublime-syntax | 8 ++-- syntaxes/fjsx15/class/body.sublime-syntax | 6 +-- syntaxes/fjsx15/class/method.sublime-syntax | 2 +- syntaxes/fjsx15/class/property.sublime-syntax | 6 +-- syntaxes/fjsx15/comment.sublime-syntax | 4 +- .../fjsx15/comment/flowtype.sublime-syntax | 24 +++++----- syntaxes/fjsx15/core.sublime-syntax | 2 +- .../fjsx15/destructuring/array.sublime-syntax | 2 +- syntaxes/fjsx15/export.sublime-syntax | 10 ++-- syntaxes/fjsx15/expression.sublime-syntax | 2 +- syntaxes/fjsx15/function-call.sublime-syntax | 2 +- .../fjsx15/function-expression.sublime-syntax | 2 +- syntaxes/fjsx15/function.sublime-syntax | 2 +- .../destructuring/array.sublime-syntax | 2 +- .../destructuring/object.sublime-syntax | 2 +- .../function/parameter/simple.sublime-syntax | 4 +- .../fjsx15/function/parameters.sublime-syntax | 2 +- syntaxes/fjsx15/import.sublime-syntax | 6 +-- .../fjsx15/operator/relational.sublime-syntax | 2 +- syntaxes/fjsx15/statement.sublime-syntax | 6 +-- .../variable-declaration.sublime-syntax | 4 +- syntaxes/fjsx15/variable.sublime-syntax | 4 +- syntaxes/fjsx15/web.sublime-syntax | 2 +- .../associated-type.no-pop.sublime-syntax | 2 +- .../associated-type.sublime-syntax | 6 +-- .../flowtype => flow}/cast.sublime-syntax | 6 +-- .../flowtype => flow}/declare.sublime-syntax | 4 +- .../function.no-pop.sublime-syntax | 2 +- .../flowtype => flow}/function.sublime-syntax | 10 ++-- .../function/parameters.sublime-syntax | 20 ++++---- .../function/parameters/simple.sublime-syntax | 8 ++-- .../flowtype => flow}/indexer.sublime-syntax | 18 +++---- .../interface.sublime-syntax | 30 ++++++------ .../flowtype => flow}/module.sublime-syntax | 14 +++--- .../namespace-path.no-pop.sublime-syntax | 48 +++++++++---------- .../flowtype => flow}/object.sublime-syntax | 46 +++++++++--------- .../flowtype => flow}/operator.sublime-syntax | 6 +-- .../operator/array-shorthand.sublime-syntax | 8 ++-- .../contravariant.no-pop.sublime-syntax | 4 +- .../operator/covariant.no-pop.sublime-syntax | 4 +- .../operator/intersection.sublime-syntax | 6 +-- .../operator/nullable.sublime-syntax | 6 +-- .../operator/union.sublime-syntax | 6 +-- .../optional-associated-type.sublime-syntax | 2 +- .../optional-modifier.no-pop.sublime-syntax | 2 +- .../optional-modifier.sublime-syntax | 4 +- .../optional-type-expression.sublime-syntax | 2 +- .../flowtype => flow}/prolog.sublime-syntax | 4 +- .../flowtype => flow}/simple.sublime-syntax | 8 ++-- .../template/arguments.no-pop.sublime-syntax | 2 +- .../template/arguments.sublime-syntax | 14 +++--- .../template/parameters.no-pop.sublime-syntax | 2 +- .../template/parameters.sublime-syntax | 10 ++-- .../flowtype => flow}/tuple.sublime-syntax | 14 +++--- .../type-aliasing.sublime-syntax | 22 ++++----- .../type-expression.sublime-syntax | 34 ++++++------- 58 files changed, 242 insertions(+), 242 deletions(-) rename syntaxes/{fjsx15/flowtype => flow}/associated-type.no-pop.sublime-syntax (88%) rename syntaxes/{fjsx15/flowtype => flow}/associated-type.sublime-syntax (81%) rename syntaxes/{fjsx15/flowtype => flow}/cast.sublime-syntax (82%) rename syntaxes/{fjsx15/flowtype => flow}/declare.sublime-syntax (89%) rename syntaxes/{fjsx15/flowtype => flow}/function.no-pop.sublime-syntax (91%) rename syntaxes/{fjsx15/flowtype => flow}/function.sublime-syntax (78%) rename syntaxes/{fjsx15/flowtype => flow}/function/parameters.sublime-syntax (65%) rename syntaxes/{fjsx15/flowtype => flow}/function/parameters/simple.sublime-syntax (83%) rename syntaxes/{fjsx15/flowtype => flow}/indexer.sublime-syntax (79%) rename syntaxes/{fjsx15/flowtype => flow}/interface.sublime-syntax (72%) rename syntaxes/{fjsx15/flowtype => flow}/module.sublime-syntax (87%) rename syntaxes/{fjsx15/flowtype => flow}/namespace-path.no-pop.sublime-syntax (65%) rename syntaxes/{fjsx15/flowtype => flow}/object.sublime-syntax (79%) rename syntaxes/{fjsx15/flowtype => flow}/operator.sublime-syntax (69%) rename syntaxes/{fjsx15/flowtype => flow}/operator/array-shorthand.sublime-syntax (82%) rename syntaxes/{fjsx15/flowtype => flow}/operator/contravariant.no-pop.sublime-syntax (89%) rename syntaxes/{fjsx15/flowtype => flow}/operator/covariant.no-pop.sublime-syntax (90%) rename syntaxes/{fjsx15/flowtype => flow}/operator/intersection.sublime-syntax (81%) rename syntaxes/{fjsx15/flowtype => flow}/operator/nullable.sublime-syntax (81%) rename syntaxes/{fjsx15/flowtype => flow}/operator/union.sublime-syntax (81%) rename syntaxes/{fjsx15/flowtype => flow}/optional-associated-type.sublime-syntax (89%) rename syntaxes/{fjsx15/flowtype => flow}/optional-modifier.no-pop.sublime-syntax (88%) rename syntaxes/{fjsx15/flowtype => flow}/optional-modifier.sublime-syntax (90%) rename syntaxes/{fjsx15/flowtype => flow}/optional-type-expression.sublime-syntax (88%) rename syntaxes/{fjsx15/flowtype => flow}/prolog.sublime-syntax (92%) rename syntaxes/{fjsx15/flowtype => flow}/simple.sublime-syntax (85%) rename syntaxes/{fjsx15/flowtype => flow}/template/arguments.no-pop.sublime-syntax (88%) rename syntaxes/{fjsx15/flowtype => flow}/template/arguments.sublime-syntax (72%) rename syntaxes/{fjsx15/flowtype => flow}/template/parameters.no-pop.sublime-syntax (88%) rename syntaxes/{fjsx15/flowtype => flow}/template/parameters.sublime-syntax (74%) rename syntaxes/{fjsx15/flowtype => flow}/tuple.sublime-syntax (74%) rename syntaxes/{fjsx15/flowtype => flow}/type-aliasing.sublime-syntax (69%) rename syntaxes/{fjsx15/flowtype => flow}/type-expression.sublime-syntax (67%) diff --git a/syntaxes/fjsx15/arrow-function.sublime-syntax b/syntaxes/fjsx15/arrow-function.sublime-syntax index bd3de9bc..0b1614f6 100644 --- a/syntaxes/fjsx15/arrow-function.sublime-syntax +++ b/syntaxes/fjsx15/arrow-function.sublime-syntax @@ -106,7 +106,7 @@ contexts: normal-arrow-function: - meta_scope: meta.function.js.fjsx15 - include: Packages/Naomi/syntaxes/fjsx15/async.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/parameters.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/flow/template/parameters.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function/parameters.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/body.sublime-syntax diff --git a/syntaxes/fjsx15/arrow-function/parameters.sublime-syntax b/syntaxes/fjsx15/arrow-function/parameters.sublime-syntax index c4f8ff90..c0f1135d 100644 --- a/syntaxes/fjsx15/arrow-function/parameters.sublime-syntax +++ b/syntaxes/fjsx15/arrow-function/parameters.sublime-syntax @@ -58,4 +58,4 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax optional-return-type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-associated-type.sublime-syntax + - include: Packages/Naomi/syntaxes/flow/optional-associated-type.sublime-syntax diff --git a/syntaxes/fjsx15/class.sublime-syntax b/syntaxes/fjsx15/class.sublime-syntax index 9d203afc..38a47ffc 100644 --- a/syntaxes/fjsx15/class.sublime-syntax +++ b/syntaxes/fjsx15/class.sublime-syntax @@ -65,16 +65,16 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax template-parameters: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/parameters.sublime-syntax + - include: Packages/Naomi/syntaxes/flow/template/parameters.sublime-syntax type-expression: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/flow/type-expression.sublime-syntax body: - include: Packages/Naomi/syntaxes/fjsx15/class/body.sublime-syntax optional-template-arguments: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/arguments.sublime-syntax + - include: Packages/Naomi/syntaxes/flow/template/arguments.sublime-syntax - match: "" pop: true @@ -90,7 +90,7 @@ contexts: pop: true target-class-or-namespace: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/namespace-path.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/flow/namespace-path.no-pop.sublime-syntax - match: | (?xi) \s*({{commonIdentifier}}) diff --git a/syntaxes/fjsx15/class/body.sublime-syntax b/syntaxes/fjsx15/class/body.sublime-syntax index 7656ee1c..52c10e9b 100644 --- a/syntaxes/fjsx15/class/body.sublime-syntax +++ b/syntaxes/fjsx15/class/body.sublime-syntax @@ -42,9 +42,9 @@ contexts: statements-and-expressions: - include: comment-no-pop - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/operator/covariant.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/operator/contravariant.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/indexer.sublime-syntax + - include: Packages/Naomi/syntaxes/flow/operator/covariant.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/flow/operator/contravariant.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/flow/indexer.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/decorator.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/react-js.sublime-syntax#class-properties - include: Packages/Naomi/syntaxes/fjsx15/react-js.sublime-syntax diff --git a/syntaxes/fjsx15/class/method.sublime-syntax b/syntaxes/fjsx15/class/method.sublime-syntax index c71ee01b..fc820529 100644 --- a/syntaxes/fjsx15/class/method.sublime-syntax +++ b/syntaxes/fjsx15/class/method.sublime-syntax @@ -109,7 +109,7 @@ contexts: pop: true template-parameters: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/parameters.sublime-syntax + - include: Packages/Naomi/syntaxes/flow/template/parameters.sublime-syntax parameters: - include: Packages/Naomi/syntaxes/fjsx15/function/parameters.sublime-syntax diff --git a/syntaxes/fjsx15/class/property.sublime-syntax b/syntaxes/fjsx15/class/property.sublime-syntax index 78f54b57..3e2b9820 100644 --- a/syntaxes/fjsx15/class/property.sublime-syntax +++ b/syntaxes/fjsx15/class/property.sublime-syntax @@ -40,8 +40,8 @@ contexts: - match: \s*(\?) captures: 1: >- - flowtype - keyword.operator.other.optional.flowtype + flow + keyword.operator.other.optional.flow # Type. - match: (?=\s*:) push: associated-type @@ -53,7 +53,7 @@ contexts: pop: true associated-type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax + - include: Packages/Naomi/syntaxes/flow/associated-type.sublime-syntax optional-expression: - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/comment.sublime-syntax b/syntaxes/fjsx15/comment.sublime-syntax index 2600fc8e..0fd886b7 100644 --- a/syntaxes/fjsx15/comment.sublime-syntax +++ b/syntaxes/fjsx15/comment.sublime-syntax @@ -19,7 +19,7 @@ scope: ... contexts: main: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/prolog.sublime-syntax + - include: Packages/Naomi/syntaxes/flow/prolog.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/comment/eslint.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/comment/flowtype.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/comment/flow.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/comment/normal.sublime-syntax diff --git a/syntaxes/fjsx15/comment/flowtype.sublime-syntax b/syntaxes/fjsx15/comment/flowtype.sublime-syntax index f5ac2e65..5801a5ea 100644 --- a/syntaxes/fjsx15/comment/flowtype.sublime-syntax +++ b/syntaxes/fjsx15/comment/flowtype.sublime-syntax @@ -22,22 +22,22 @@ contexts: - match: \s*(/\*\s*::) captures: 1: >- - comment.block.flowtype - punctuation.definition.comment.begin.flowtype + comment.block.flow + punctuation.definition.comment.begin.flow set: [ block-end, statements-and-expressions ] - match: \s*(/\*(?=\s*:)) captures: 1: >- - comment.block.flowtype - punctuation.definition.comment.begin.flowtype + comment.block.flow + punctuation.definition.comment.begin.flow set: [ block-end, associated-type ] block-end: - - meta_scope: comment.block.flowtype + - meta_scope: comment.block.flow - match: \s*(\*/) captures: 1: >- - comment.block.flowtype + comment.block.flow punctuation.definition.comment.end.js.fjsx15 set: # Used to fix the block comment indentation settings. @@ -51,7 +51,7 @@ contexts: associated-type: - match: (?=\s*\*\/) pop: true - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax + - include: Packages/Naomi/syntaxes/flow/associated-type.sublime-syntax statements-and-expressions: - match: (?=\s*\*\/) @@ -61,12 +61,12 @@ contexts: - match: \s*(;) captures: 1: keyword.other.terminator.js.fjsx15 - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/declare.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/interface.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type-aliasing.sublime-syntax + - include: Packages/Naomi/syntaxes/flow/associated-type.sublime-syntax + - include: Packages/Naomi/syntaxes/flow/declare.sublime-syntax + - include: Packages/Naomi/syntaxes/flow/interface.sublime-syntax + - include: Packages/Naomi/syntaxes/flow/type-aliasing.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/class/property.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/indexer.sublime-syntax + - include: Packages/Naomi/syntaxes/flow/indexer.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/import.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/export.sublime-syntax - match: "" diff --git a/syntaxes/fjsx15/core.sublime-syntax b/syntaxes/fjsx15/core.sublime-syntax index 21d0a216..08a62cb2 100644 --- a/syntaxes/fjsx15/core.sublime-syntax +++ b/syntaxes/fjsx15/core.sublime-syntax @@ -42,7 +42,7 @@ contexts: - include: web-assembly optional-template-and-arguments: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/arguments.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/flow/template/arguments.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function-call/arguments.sublime-syntax - match: (?=\s*\S) pop: true diff --git a/syntaxes/fjsx15/destructuring/array.sublime-syntax b/syntaxes/fjsx15/destructuring/array.sublime-syntax index e3ad2e38..59a40024 100644 --- a/syntaxes/fjsx15/destructuring/array.sublime-syntax +++ b/syntaxes/fjsx15/destructuring/array.sublime-syntax @@ -53,7 +53,7 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax optional-type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-associated-type.sublime-syntax + - include: Packages/Naomi/syntaxes/flow/optional-associated-type.sublime-syntax optional-variable: - match: (?=\s*[,)\]}]) diff --git a/syntaxes/fjsx15/export.sublime-syntax b/syntaxes/fjsx15/export.sublime-syntax index 1bc518c3..101cb146 100644 --- a/syntaxes/fjsx15/export.sublime-syntax +++ b/syntaxes/fjsx15/export.sublime-syntax @@ -77,11 +77,11 @@ contexts: captures: 1: keyword.control.import-export.js.fjsx15 2: >- - flowtype - storage.modifier.flowtype + flow + storage.modifier.flow 3: >- - flowtype - storage.type.flowtype + flow + storage.type.flow 4: punctuation.definition.export.list.begin.js.fjsx15 set: types # Export object literal. @@ -262,4 +262,4 @@ contexts: push: simple-type simple-type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/simple.sublime-syntax + - include: Packages/Naomi/syntaxes/flow/simple.sublime-syntax diff --git a/syntaxes/fjsx15/expression.sublime-syntax b/syntaxes/fjsx15/expression.sublime-syntax index d4411a19..18e45c94 100644 --- a/syntaxes/fjsx15/expression.sublime-syntax +++ b/syntaxes/fjsx15/expression.sublime-syntax @@ -56,7 +56,7 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/literal/string/regex.sublime-syntax type-cast: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/cast.sublime-syntax + - include: Packages/Naomi/syntaxes/flow/cast.sublime-syntax open-group: - meta_scope: meta.group.js.fjsx15 diff --git a/syntaxes/fjsx15/function-call.sublime-syntax b/syntaxes/fjsx15/function-call.sublime-syntax index 5102f52b..378ef7d0 100644 --- a/syntaxes/fjsx15/function-call.sublime-syntax +++ b/syntaxes/fjsx15/function-call.sublime-syntax @@ -80,7 +80,7 @@ contexts: pop: true template-arguments: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/arguments.sublime-syntax + - include: Packages/Naomi/syntaxes/flow/template/arguments.sublime-syntax arguments: - include: Packages/Naomi/syntaxes/fjsx15/function-call/arguments.sublime-syntax diff --git a/syntaxes/fjsx15/function-expression.sublime-syntax b/syntaxes/fjsx15/function-expression.sublime-syntax index 81a6f661..7cc720df 100644 --- a/syntaxes/fjsx15/function-expression.sublime-syntax +++ b/syntaxes/fjsx15/function-expression.sublime-syntax @@ -71,7 +71,7 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax template-parameters: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/parameters.sublime-syntax + - include: Packages/Naomi/syntaxes/flow/template/parameters.sublime-syntax parameters: - include: Packages/Naomi/syntaxes/fjsx15/function/parameters.sublime-syntax diff --git a/syntaxes/fjsx15/function.sublime-syntax b/syntaxes/fjsx15/function.sublime-syntax index 613c0a0f..5766d61c 100644 --- a/syntaxes/fjsx15/function.sublime-syntax +++ b/syntaxes/fjsx15/function.sublime-syntax @@ -73,7 +73,7 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax template-parameters: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/parameters.sublime-syntax + - include: Packages/Naomi/syntaxes/flow/template/parameters.sublime-syntax parameters: - include: Packages/Naomi/syntaxes/fjsx15/function/parameters.sublime-syntax diff --git a/syntaxes/fjsx15/function/parameter/destructuring/array.sublime-syntax b/syntaxes/fjsx15/function/parameter/destructuring/array.sublime-syntax index b3bc7f61..93ab43c6 100644 --- a/syntaxes/fjsx15/function/parameter/destructuring/array.sublime-syntax +++ b/syntaxes/fjsx15/function/parameter/destructuring/array.sublime-syntax @@ -52,7 +52,7 @@ contexts: optional-type-and-default-value: - match: (?=\s*,) pop: true - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/flow/associated-type.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax comment-no-pop: diff --git a/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax b/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax index 79586b9d..25864cca 100644 --- a/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax +++ b/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax @@ -58,7 +58,7 @@ contexts: optional-type-and-default-value: - match: (?=\s*,) pop: true - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/flow/associated-type.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax comment-no-pop: diff --git a/syntaxes/fjsx15/function/parameter/simple.sublime-syntax b/syntaxes/fjsx15/function/parameter/simple.sublime-syntax index e19987e6..cdef9fa9 100644 --- a/syntaxes/fjsx15/function/parameter/simple.sublime-syntax +++ b/syntaxes/fjsx15/function/parameter/simple.sublime-syntax @@ -104,8 +104,8 @@ contexts: set: optional-modifier-and-type optional-modifier-and-type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-modifier.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-associated-type.sublime-syntax + - include: Packages/Naomi/syntaxes/flow/optional-modifier.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/flow/optional-associated-type.sublime-syntax optional-default-value: - meta_scope: >- diff --git a/syntaxes/fjsx15/function/parameters.sublime-syntax b/syntaxes/fjsx15/function/parameters.sublime-syntax index 59c7c388..1491958e 100644 --- a/syntaxes/fjsx15/function/parameters.sublime-syntax +++ b/syntaxes/fjsx15/function/parameters.sublime-syntax @@ -49,4 +49,4 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax optional-return-type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-associated-type.sublime-syntax + - include: Packages/Naomi/syntaxes/flow/optional-associated-type.sublime-syntax diff --git a/syntaxes/fjsx15/import.sublime-syntax b/syntaxes/fjsx15/import.sublime-syntax index f7961b3d..3ec2a047 100644 --- a/syntaxes/fjsx15/import.sublime-syntax +++ b/syntaxes/fjsx15/import.sublime-syntax @@ -103,8 +103,8 @@ contexts: - match: \s*(type)\b captures: 1: >- - storage.type.flowtype - keyword.declaration.type-aliasing.flowtype + storage.type.flow + keyword.declaration.type-aliasing.flow set: types # Default. - match: \s*(default)\b @@ -155,7 +155,7 @@ contexts: ] simple-type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/simple.sublime-syntax + - include: Packages/Naomi/syntaxes/flow/simple.sublime-syntax optional-alias: - match: | diff --git a/syntaxes/fjsx15/operator/relational.sublime-syntax b/syntaxes/fjsx15/operator/relational.sublime-syntax index 92ea097c..808022b0 100644 --- a/syntaxes/fjsx15/operator/relational.sublime-syntax +++ b/syntaxes/fjsx15/operator/relational.sublime-syntax @@ -36,4 +36,4 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax optional-type-expression: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-type-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/flow/optional-type-expression.sublime-syntax diff --git a/syntaxes/fjsx15/statement.sublime-syntax b/syntaxes/fjsx15/statement.sublime-syntax index a6e788a6..a1dae22b 100644 --- a/syntaxes/fjsx15/statement.sublime-syntax +++ b/syntaxes/fjsx15/statement.sublime-syntax @@ -24,9 +24,9 @@ variables: contexts: main: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/declare.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/interface.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type-aliasing.sublime-syntax + - include: Packages/Naomi/syntaxes/flow/declare.sublime-syntax + - include: Packages/Naomi/syntaxes/flow/interface.sublime-syntax + - include: Packages/Naomi/syntaxes/flow/type-aliasing.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/decorator.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/import.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/export.sublime-syntax diff --git a/syntaxes/fjsx15/variable-declaration.sublime-syntax b/syntaxes/fjsx15/variable-declaration.sublime-syntax index f76719c4..f3ac17ec 100644 --- a/syntaxes/fjsx15/variable-declaration.sublime-syntax +++ b/syntaxes/fjsx15/variable-declaration.sublime-syntax @@ -101,7 +101,7 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax associated-type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax + - include: Packages/Naomi/syntaxes/flow/associated-type.sublime-syntax optional-type-and-initial-value: - meta_scope: meta.declaration.variable.js.fjsx15 @@ -134,7 +134,7 @@ contexts: optional-type: - include: comment-no-pop - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-associated-type.sublime-syntax + - include: Packages/Naomi/syntaxes/flow/optional-associated-type.sublime-syntax constant: # Single character. diff --git a/syntaxes/fjsx15/variable.sublime-syntax b/syntaxes/fjsx15/variable.sublime-syntax index c9d6f1e2..8c6c3700 100644 --- a/syntaxes/fjsx15/variable.sublime-syntax +++ b/syntaxes/fjsx15/variable.sublime-syntax @@ -165,7 +165,7 @@ contexts: normal-arrow-function: - meta_scope: meta.function.declaration.js.fjsx15 - include: Packages/Naomi/syntaxes/fjsx15/async.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/parameters.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/flow/template/parameters.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/parameters.no-pop.sublime-syntax - match: (?=\s*=>) set: arrow-body @@ -179,7 +179,7 @@ contexts: optional-type: - include: comment-no-pop - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-associated-type.sublime-syntax + - include: Packages/Naomi/syntaxes/flow/optional-associated-type.sublime-syntax object: - match: | diff --git a/syntaxes/fjsx15/web.sublime-syntax b/syntaxes/fjsx15/web.sublime-syntax index 9b59a846..67d27302 100644 --- a/syntaxes/fjsx15/web.sublime-syntax +++ b/syntaxes/fjsx15/web.sublime-syntax @@ -24,7 +24,7 @@ contexts: - include: window-functions optional-template-and-arguments: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/arguments.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/flow/template/arguments.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function-call/arguments.sublime-syntax - match: (?=\s*\S) pop: true diff --git a/syntaxes/fjsx15/flowtype/associated-type.no-pop.sublime-syntax b/syntaxes/flow/associated-type.no-pop.sublime-syntax similarity index 88% rename from syntaxes/fjsx15/flowtype/associated-type.no-pop.sublime-syntax rename to syntaxes/flow/associated-type.no-pop.sublime-syntax index 6c662073..84fcb8b3 100644 --- a/syntaxes/fjsx15/flowtype/associated-type.no-pop.sublime-syntax +++ b/syntaxes/flow/associated-type.no-pop.sublime-syntax @@ -23,4 +23,4 @@ contexts: push: associated-type associated-type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow/associated-type.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax b/syntaxes/flow/associated-type.sublime-syntax similarity index 81% rename from syntaxes/fjsx15/flowtype/associated-type.sublime-syntax rename to syntaxes/flow/associated-type.sublime-syntax index 3aba12d4..0a0bb49f 100644 --- a/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax +++ b/syntaxes/flow/associated-type.sublime-syntax @@ -22,9 +22,9 @@ contexts: - match: \s*(:) captures: 1: >- - flowtype - keyword.operator.other.association.flowtype + flow + keyword.operator.other.association.flow set: optional-type-expression optional-type-expression: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-type-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow/optional-type-expression.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/cast.sublime-syntax b/syntaxes/flow/cast.sublime-syntax similarity index 82% rename from syntaxes/fjsx15/flowtype/cast.sublime-syntax rename to syntaxes/flow/cast.sublime-syntax index d52b5d3d..d2ebb1d8 100644 --- a/syntaxes/fjsx15/flowtype/cast.sublime-syntax +++ b/syntaxes/flow/cast.sublime-syntax @@ -24,9 +24,9 @@ contexts: \s*(:) captures: 1: >- - flowtype - keyword.operator.other.cast.flowtype + flow + keyword.operator.other.cast.flow set: optional-type-expression optional-type-expression: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-type-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow/optional-type-expression.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/declare.sublime-syntax b/syntaxes/flow/declare.sublime-syntax similarity index 89% rename from syntaxes/fjsx15/flowtype/declare.sublime-syntax rename to syntaxes/flow/declare.sublime-syntax index 73f57a34..1e31fe6b 100644 --- a/syntaxes/fjsx15/flowtype/declare.sublime-syntax +++ b/syntaxes/flow/declare.sublime-syntax @@ -22,11 +22,11 @@ contexts: - match: \s*(declare)\b captures: 1: >- - flowtype + flow keyword.declaration.js.fjsx15 set: possible-module possible-module: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/module.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow/module.sublime-syntax - match: (?=\s*\S) pop: true diff --git a/syntaxes/fjsx15/flowtype/function.no-pop.sublime-syntax b/syntaxes/flow/function.no-pop.sublime-syntax similarity index 91% rename from syntaxes/fjsx15/flowtype/function.no-pop.sublime-syntax rename to syntaxes/flow/function.no-pop.sublime-syntax index b4f048d3..219a39fc 100644 --- a/syntaxes/fjsx15/flowtype/function.no-pop.sublime-syntax +++ b/syntaxes/flow/function.no-pop.sublime-syntax @@ -47,4 +47,4 @@ contexts: push: declaration declaration: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/function.sublime-syntax#declaration + - include: Packages/Naomi/syntaxes/fjsx15/flow/function.sublime-syntax#declaration diff --git a/syntaxes/fjsx15/flowtype/function.sublime-syntax b/syntaxes/flow/function.sublime-syntax similarity index 78% rename from syntaxes/fjsx15/flowtype/function.sublime-syntax rename to syntaxes/flow/function.sublime-syntax index 67e8658c..a0e1619d 100644 --- a/syntaxes/fjsx15/flowtype/function.sublime-syntax +++ b/syntaxes/flow/function.sublime-syntax @@ -58,19 +58,19 @@ contexts: ] template-arguments: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/arguments.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow/template/arguments.sublime-syntax parameters: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/function/parameters.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow/function/parameters.sublime-syntax return: - match: \s*(=>) captures: 1: >- - flowtype - punctuation.definition.function.result.flowtype + flow + punctuation.definition.function.result.flow set: optional-type-expression optional-type-expression: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-type-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow/optional-type-expression.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/function/parameters.sublime-syntax b/syntaxes/flow/function/parameters.sublime-syntax similarity index 65% rename from syntaxes/fjsx15/flowtype/function/parameters.sublime-syntax rename to syntaxes/flow/function/parameters.sublime-syntax index de037ff0..994e1aed 100644 --- a/syntaxes/fjsx15/flowtype/function/parameters.sublime-syntax +++ b/syntaxes/flow/function/parameters.sublime-syntax @@ -22,22 +22,22 @@ contexts: - match: \s*(\() captures: 1: >- - flowtype - punctuation.definition.function.parameters.begin.flowtype + flow + punctuation.definition.function.parameters.begin.flow set: [ delimiters, optional-parameter ] delimiters: - match: \s*(,) captures: 1: >- - flowtype - punctuation.definition.function.parameters.flowtype + flow + punctuation.definition.function.parameters.flow push: optional-parameter - match: \s*(\)) captures: 1: >- - flowtype - punctuation.definition.function.parameters.end.flowtype + flow + punctuation.definition.function.parameters.end.flow pop: true optional-parameter: @@ -45,7 +45,7 @@ contexts: - match: \s*(\.{3}) captures: 1: >- - flowtype - keyword.operator.other.rest.flowtype - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/function/parameters/simple.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-type-expression.sublime-syntax + flow + keyword.operator.other.rest.flow + - include: Packages/Naomi/syntaxes/fjsx15/flow/function/parameters/simple.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow/optional-type-expression.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/function/parameters/simple.sublime-syntax b/syntaxes/flow/function/parameters/simple.sublime-syntax similarity index 83% rename from syntaxes/fjsx15/flowtype/function/parameters/simple.sublime-syntax rename to syntaxes/flow/function/parameters/simple.sublime-syntax index ebc8bff2..9dfafd95 100644 --- a/syntaxes/fjsx15/flowtype/function/parameters/simple.sublime-syntax +++ b/syntaxes/flow/function/parameters/simple.sublime-syntax @@ -30,13 +30,13 @@ contexts: (?=\s*:) captures: 1: >- - flowtype + flow function.parameter.js.fjsx15 entity.name.variable.js.fjsx15 2: >- - flowtype - keyword.operator.other.optional.flowtype + flow + keyword.operator.other.optional.flow set: optional-associated-type optional-associated-type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-associated-type.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow/optional-associated-type.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/indexer.sublime-syntax b/syntaxes/flow/indexer.sublime-syntax similarity index 79% rename from syntaxes/fjsx15/flowtype/indexer.sublime-syntax rename to syntaxes/flow/indexer.sublime-syntax index edc00c55..567e2c39 100644 --- a/syntaxes/fjsx15/flowtype/indexer.sublime-syntax +++ b/syntaxes/flow/indexer.sublime-syntax @@ -27,23 +27,23 @@ contexts: - match: \s*(\[) captures: 1: >- - flowtype - punctuation.definition.object.indexer.flowtype + flow + punctuation.definition.object.indexer.flow set: [ indexer-end, optional-name ] indexer-end: - match: \s*(]) captures: 1: >- - flowtype - punctuation.definition.object.indexer.flowtype + flow + punctuation.definition.object.indexer.flow set: optional-associated-type type-expression: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow/type-expression.sublime-syntax optional-associated-type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-associated-type.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow/optional-associated-type.sublime-syntax optional-name: - include: comment-no-pop @@ -57,8 +57,8 @@ contexts: function.parameter.js.fjsx15 entity.name.variable.js.fjsx15 2: >- - flowtype - keyword.operator.other.optional.flowtype + flow + keyword.operator.other.optional.flow set: associated-type # Strings. - match: (?=\s*(?>'|"|`)) @@ -76,7 +76,7 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/literal/string/template.sublime-syntax associated-type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow/associated-type.sublime-syntax comment-no-pop: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/interface.sublime-syntax b/syntaxes/flow/interface.sublime-syntax similarity index 72% rename from syntaxes/fjsx15/flowtype/interface.sublime-syntax rename to syntaxes/flow/interface.sublime-syntax index 11918a94..7e577511 100644 --- a/syntaxes/fjsx15/flowtype/interface.sublime-syntax +++ b/syntaxes/flow/interface.sublime-syntax @@ -27,8 +27,8 @@ contexts: - match: \s*(interface)\b captures: 1: >- - flowtype - storage.type.flowtype + flow + storage.type.flow set: declaration declaration: @@ -37,8 +37,8 @@ contexts: - match: \s*(extends)\b captures: 1: >- - flowtype - storage.modifier.flowtype + flow + storage.modifier.flow push: optional-type-expression # Template parameters. - match: (?=\s*<) @@ -50,22 +50,22 @@ contexts: - match: (?xi)\s*({{commonIdentifier}}) captures: 1: >- - flowtype - entity.name.interface.flowtype + flow + entity.name.interface.flow optional-type-expression: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-type-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow/optional-type-expression.sublime-syntax template-parameters: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/parameters.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow/template/parameters.sublime-syntax body: - include: comment-no-pop - match: \s*(\{) captures: 1: >- - flowtype - punctuation.definition.interface.body.begin.flowtype + flow + punctuation.definition.interface.body.begin.flow set: [ body-end, statements-and-expressions ] body-end: @@ -78,8 +78,8 @@ contexts: - match: \s*(}) captures: 1: >- - flowtype - punctuation.definition.interface.body.end.flowtype + flow + punctuation.definition.interface.body.end.flow pop: true - match: (?=\s*\S) push: statements-and-expressions @@ -88,9 +88,9 @@ contexts: - match: (?=\s*}) pop: true - include: comment-no-pop - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/operator/covariant.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/operator/contravariant.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/indexer.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow/operator/covariant.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow/operator/contravariant.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow/indexer.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/class/method.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/class/property.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/module.sublime-syntax b/syntaxes/flow/module.sublime-syntax similarity index 87% rename from syntaxes/fjsx15/flowtype/module.sublime-syntax rename to syntaxes/flow/module.sublime-syntax index 413f218d..daf55249 100644 --- a/syntaxes/fjsx15/flowtype/module.sublime-syntax +++ b/syntaxes/flow/module.sublime-syntax @@ -35,9 +35,9 @@ contexts: - match: \s*(module) captures: 1: >- - flowtype - storage.type.flowtype - keyword.declaration.type-aliasing.flowtype + flow + storage.type.flow + keyword.declaration.type-aliasing.flow set: identifier common-js-module: @@ -47,8 +47,8 @@ contexts: - match: \s*(:) captures: 1: >- - flowtype - keyword.operator.other.association.flowtype + flow + keyword.operator.other.association.flow pop: true object-literal: @@ -63,6 +63,6 @@ contexts: ({{commonIdentifier}}) captures: 1: >- - flowtype - entity.name.module.flowtype + flow + entity.name.module.flow pop: true diff --git a/syntaxes/fjsx15/flowtype/namespace-path.no-pop.sublime-syntax b/syntaxes/flow/namespace-path.no-pop.sublime-syntax similarity index 65% rename from syntaxes/fjsx15/flowtype/namespace-path.no-pop.sublime-syntax rename to syntaxes/flow/namespace-path.no-pop.sublime-syntax index 6529c008..856e90db 100644 --- a/syntaxes/fjsx15/flowtype/namespace-path.no-pop.sublime-syntax +++ b/syntaxes/flow/namespace-path.no-pop.sublime-syntax @@ -39,23 +39,23 @@ contexts: ) captures: 1: >- - flowtype - entity.name.namespace.a.flowtype + flow + entity.name.namespace.a.flow 2: >- - flowtype - punctuation.definition.namespace.a.flowtype + flow + punctuation.definition.namespace.a.flow 3: >- - flowtype - entity.name.namespace.b.flowtype + flow + entity.name.namespace.b.flow 4: >- - flowtype - punctuation.definition.namespace.b.flowtype + flow + punctuation.definition.namespace.b.flow 5: >- - flowtype - entity.name.namespace.a.flowtype + flow + entity.name.namespace.a.flow 6: >- - flowtype - punctuation.definition.namespace.a.flowtype + flow + punctuation.definition.namespace.a.flow # Namespace delimited by dollar signs. - match: | (?xi)\s* @@ -69,20 +69,20 @@ contexts: ) captures: 1: >- - flowtype - entity.name.namespace.a.flowtype + flow + entity.name.namespace.a.flow 2: >- - flowtype - punctuation.definition.namespace.a.flowtype + flow + punctuation.definition.namespace.a.flow 3: >- - flowtype - entity.name.namespace.b.flowtype + flow + entity.name.namespace.b.flow 4: >- - flowtype - punctuation.definition.namespace.b.flowtype + flow + punctuation.definition.namespace.b.flow 5: >- - flowtype - entity.name.namespace.a.flowtype + flow + entity.name.namespace.a.flow 6: >- - flowtype - punctuation.definition.namespace.a.flowtype + flow + punctuation.definition.namespace.a.flow diff --git a/syntaxes/fjsx15/flowtype/object.sublime-syntax b/syntaxes/flow/object.sublime-syntax similarity index 79% rename from syntaxes/fjsx15/flowtype/object.sublime-syntax rename to syntaxes/flow/object.sublime-syntax index a6e330d3..c0893d89 100644 --- a/syntaxes/fjsx15/flowtype/object.sublime-syntax +++ b/syntaxes/flow/object.sublime-syntax @@ -32,43 +32,43 @@ contexts: - match: \s*({)\s*(\|) captures: 1: >- - flowtype - punctuation.definition.object.begin.flowtype + flow + punctuation.definition.object.begin.flow 2: >- - flowtype - punctuation.definition.object.begin.flowtype + flow + punctuation.definition.object.begin.flow set: [ delimiters, optional-property-or-method ] # Normal. - match: \s*({) captures: 1: >- - flowtype - punctuation.definition.object.begin.flowtype + flow + punctuation.definition.object.begin.flow set: [ delimiters, optional-property-or-method ] delimiters: - match: \s*(,|;) captures: 1: >- - flowtype - punctuation.definition.object.flowtype + flow + punctuation.definition.object.flow push: optional-property-or-method # Exact. - match: \s*(\|)\s*(}) captures: 1: >- - flowtype - punctuation.definition.object.end.flowtype + flow + punctuation.definition.object.end.flow 2: >- - flowtype - punctuation.definition.object.end.flowtype + flow + punctuation.definition.object.end.flow pop: true # Normal. - match: \s*(}) captures: 1: >- - flowtype - punctuation.definition.object.end.flowtype + flow + punctuation.definition.object.end.flow pop: true optional-property-or-method: @@ -97,8 +97,8 @@ contexts: object.property.js.fjsx15 entity.name.constant.js.fjsx15 2: >- - flowtype - keyword.operator.other.optional.flowtype + flow + keyword.operator.other.optional.flow set: associated-type # Two or more characters. - match: | @@ -115,8 +115,8 @@ contexts: object.property.js.fjsx15 entity.name.constant.js.fjsx15 2: >- - flowtype - keyword.operator.other.optional.flowtype + flow + keyword.operator.other.optional.flow set: associated-type variable: @@ -132,8 +132,8 @@ contexts: object.property.js.fjsx15 entity.name.variable.js.fjsx15 2: >- - flowtype - keyword.operator.other.optional.flowtype + flow + keyword.operator.other.optional.flow set: associated-type # Two or more characters. - match: | @@ -150,8 +150,8 @@ contexts: object.property.js.fjsx15 entity.name.variable.js.fjsx15 2: >- - flowtype - keyword.operator.other.optional.flowtype + flow + keyword.operator.other.optional.flow set: associated-type string: @@ -160,7 +160,7 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/literal/string/template.sublime-syntax associated-type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow/associated-type.sublime-syntax comment-no-pop: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/operator.sublime-syntax b/syntaxes/flow/operator.sublime-syntax similarity index 69% rename from syntaxes/fjsx15/flowtype/operator.sublime-syntax rename to syntaxes/flow/operator.sublime-syntax index 546921d7..fed16e76 100644 --- a/syntaxes/fjsx15/flowtype/operator.sublime-syntax +++ b/syntaxes/flow/operator.sublime-syntax @@ -19,6 +19,6 @@ scope: ... contexts: main: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/operator/intersection.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/operator/nullable.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/operator/union.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow/operator/intersection.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow/operator/nullable.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow/operator/union.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/operator/array-shorthand.sublime-syntax b/syntaxes/flow/operator/array-shorthand.sublime-syntax similarity index 82% rename from syntaxes/fjsx15/flowtype/operator/array-shorthand.sublime-syntax rename to syntaxes/flow/operator/array-shorthand.sublime-syntax index 663923bc..a1614986 100644 --- a/syntaxes/fjsx15/flowtype/operator/array-shorthand.sublime-syntax +++ b/syntaxes/flow/operator/array-shorthand.sublime-syntax @@ -22,9 +22,9 @@ contexts: - match: \s*(\[)\s*(]) captures: 1: >- - flowtype - punctuation.definition.array.begin.flowtype + flow + punctuation.definition.array.begin.flow 2: >- - flowtype - punctuation.definition.array.end.flowtype + flow + punctuation.definition.array.end.flow pop: true diff --git a/syntaxes/fjsx15/flowtype/operator/contravariant.no-pop.sublime-syntax b/syntaxes/flow/operator/contravariant.no-pop.sublime-syntax similarity index 89% rename from syntaxes/fjsx15/flowtype/operator/contravariant.no-pop.sublime-syntax rename to syntaxes/flow/operator/contravariant.no-pop.sublime-syntax index eb2882dc..06042eeb 100644 --- a/syntaxes/fjsx15/flowtype/operator/contravariant.no-pop.sublime-syntax +++ b/syntaxes/flow/operator/contravariant.no-pop.sublime-syntax @@ -22,5 +22,5 @@ contexts: - match: \s*(-) captures: 1: >- - flowtype - keyword.operator.other.contravariant.flowtype + flow + keyword.operator.other.contravariant.flow diff --git a/syntaxes/fjsx15/flowtype/operator/covariant.no-pop.sublime-syntax b/syntaxes/flow/operator/covariant.no-pop.sublime-syntax similarity index 90% rename from syntaxes/fjsx15/flowtype/operator/covariant.no-pop.sublime-syntax rename to syntaxes/flow/operator/covariant.no-pop.sublime-syntax index 15bff1a6..0a5bd1b1 100644 --- a/syntaxes/fjsx15/flowtype/operator/covariant.no-pop.sublime-syntax +++ b/syntaxes/flow/operator/covariant.no-pop.sublime-syntax @@ -22,5 +22,5 @@ contexts: - match: \s*(\+) captures: 1: >- - flowtype - keyword.operator.other.covariant.flowtype + flow + keyword.operator.other.covariant.flow diff --git a/syntaxes/fjsx15/flowtype/operator/intersection.sublime-syntax b/syntaxes/flow/operator/intersection.sublime-syntax similarity index 81% rename from syntaxes/fjsx15/flowtype/operator/intersection.sublime-syntax rename to syntaxes/flow/operator/intersection.sublime-syntax index d2e45cb0..3684eb81 100644 --- a/syntaxes/fjsx15/flowtype/operator/intersection.sublime-syntax +++ b/syntaxes/flow/operator/intersection.sublime-syntax @@ -22,9 +22,9 @@ contexts: - match: \s*(&) captures: 1: >- - flowtype - keyword.operator.other.intersection.flowtype + flow + keyword.operator.other.intersection.flow set: optional-type-expression optional-type-expression: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-type-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow/optional-type-expression.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/operator/nullable.sublime-syntax b/syntaxes/flow/operator/nullable.sublime-syntax similarity index 81% rename from syntaxes/fjsx15/flowtype/operator/nullable.sublime-syntax rename to syntaxes/flow/operator/nullable.sublime-syntax index c7932de8..2508c3c0 100644 --- a/syntaxes/fjsx15/flowtype/operator/nullable.sublime-syntax +++ b/syntaxes/flow/operator/nullable.sublime-syntax @@ -22,9 +22,9 @@ contexts: - match: \s*(\?) captures: 1: >- - flowtype - keyword.operator.other.nullable.flowtype + flow + keyword.operator.other.nullable.flow set: optional-type-expression optional-type-expression: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-type-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow/optional-type-expression.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/operator/union.sublime-syntax b/syntaxes/flow/operator/union.sublime-syntax similarity index 81% rename from syntaxes/fjsx15/flowtype/operator/union.sublime-syntax rename to syntaxes/flow/operator/union.sublime-syntax index 202daf68..cf3ec958 100644 --- a/syntaxes/fjsx15/flowtype/operator/union.sublime-syntax +++ b/syntaxes/flow/operator/union.sublime-syntax @@ -22,9 +22,9 @@ contexts: - match: \s*(\|) captures: 1: >- - flowtype - keyword.operator.other.union.flowtype + flow + keyword.operator.other.union.flow set: optional-type-expression optional-type-expression: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-type-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow/optional-type-expression.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/optional-associated-type.sublime-syntax b/syntaxes/flow/optional-associated-type.sublime-syntax similarity index 89% rename from syntaxes/fjsx15/flowtype/optional-associated-type.sublime-syntax rename to syntaxes/flow/optional-associated-type.sublime-syntax index 3ba281c5..7970a19b 100644 --- a/syntaxes/fjsx15/flowtype/optional-associated-type.sublime-syntax +++ b/syntaxes/flow/optional-associated-type.sublime-syntax @@ -25,4 +25,4 @@ contexts: pop: true associated-type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow/associated-type.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/optional-modifier.no-pop.sublime-syntax b/syntaxes/flow/optional-modifier.no-pop.sublime-syntax similarity index 88% rename from syntaxes/fjsx15/flowtype/optional-modifier.no-pop.sublime-syntax rename to syntaxes/flow/optional-modifier.no-pop.sublime-syntax index cbf1986a..38c1b3dc 100644 --- a/syntaxes/fjsx15/flowtype/optional-modifier.no-pop.sublime-syntax +++ b/syntaxes/flow/optional-modifier.no-pop.sublime-syntax @@ -23,4 +23,4 @@ contexts: push: optional-modifier optional-modifier: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-modifier.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow/optional-modifier.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/optional-modifier.sublime-syntax b/syntaxes/flow/optional-modifier.sublime-syntax similarity index 90% rename from syntaxes/fjsx15/flowtype/optional-modifier.sublime-syntax rename to syntaxes/flow/optional-modifier.sublime-syntax index 24d73e53..f9116221 100644 --- a/syntaxes/fjsx15/flowtype/optional-modifier.sublime-syntax +++ b/syntaxes/flow/optional-modifier.sublime-syntax @@ -22,6 +22,6 @@ contexts: - match: \s*(\?) captures: 1: >- - flowtype - keyword.operator.other.optional.flowtype + flow + keyword.operator.other.optional.flow pop: true diff --git a/syntaxes/fjsx15/flowtype/optional-type-expression.sublime-syntax b/syntaxes/flow/optional-type-expression.sublime-syntax similarity index 88% rename from syntaxes/fjsx15/flowtype/optional-type-expression.sublime-syntax rename to syntaxes/flow/optional-type-expression.sublime-syntax index 55b7f6fe..d2c1314b 100644 --- a/syntaxes/fjsx15/flowtype/optional-type-expression.sublime-syntax +++ b/syntaxes/flow/optional-type-expression.sublime-syntax @@ -21,4 +21,4 @@ contexts: main: - match: (?=\s*[>,;:)\]}]) pop: true - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow/type-expression.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/prolog.sublime-syntax b/syntaxes/flow/prolog.sublime-syntax similarity index 92% rename from syntaxes/fjsx15/flowtype/prolog.sublime-syntax rename to syntaxes/flow/prolog.sublime-syntax index 0f46fe80..dca1c90b 100644 --- a/syntaxes/fjsx15/flowtype/prolog.sublime-syntax +++ b/syntaxes/flow/prolog.sublime-syntax @@ -26,6 +26,6 @@ contexts: )) captures: 1: >- - flowtype - keyword.other.prolog.flowtype + flow + keyword.other.prolog.flow pop: true diff --git a/syntaxes/fjsx15/flowtype/simple.sublime-syntax b/syntaxes/flow/simple.sublime-syntax similarity index 85% rename from syntaxes/fjsx15/flowtype/simple.sublime-syntax rename to syntaxes/flow/simple.sublime-syntax index 187e3875..f5a64e76 100644 --- a/syntaxes/fjsx15/flowtype/simple.sublime-syntax +++ b/syntaxes/flow/simple.sublime-syntax @@ -24,11 +24,11 @@ variables: contexts: main: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/namespace-path.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow/namespace-path.no-pop.sublime-syntax # Existential. - match: \s*(\*) captures: - 1: entity.name.type.existential.flowtype + 1: entity.name.type.existential.flow pop: true # Predefined types. - match: | @@ -49,12 +49,12 @@ contexts: | void ))\b captures: - 1: support.type.flowtype + 1: support.type.flow pop: true # Other types. - match: | (?xi)\s* ({{commonIdentifier}}) captures: - 1: variable.other.type.flowtype + 1: variable.other.type.flow pop: true diff --git a/syntaxes/fjsx15/flowtype/template/arguments.no-pop.sublime-syntax b/syntaxes/flow/template/arguments.no-pop.sublime-syntax similarity index 88% rename from syntaxes/fjsx15/flowtype/template/arguments.no-pop.sublime-syntax rename to syntaxes/flow/template/arguments.no-pop.sublime-syntax index 050ee6da..097aa43d 100644 --- a/syntaxes/fjsx15/flowtype/template/arguments.no-pop.sublime-syntax +++ b/syntaxes/flow/template/arguments.no-pop.sublime-syntax @@ -23,4 +23,4 @@ contexts: push: arguments arguments: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/arguments.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow/template/arguments.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/template/arguments.sublime-syntax b/syntaxes/flow/template/arguments.sublime-syntax similarity index 72% rename from syntaxes/fjsx15/flowtype/template/arguments.sublime-syntax rename to syntaxes/flow/template/arguments.sublime-syntax index 878d2942..a2c13534 100644 --- a/syntaxes/fjsx15/flowtype/template/arguments.sublime-syntax +++ b/syntaxes/flow/template/arguments.sublime-syntax @@ -22,23 +22,23 @@ contexts: - match: \s*(<) captures: 1: >- - flowtype - punctuation.definition.template.arguments.begin.flowtype + flow + punctuation.definition.template.arguments.begin.flow set: [ delimiters, optional-type-expression ] delimiters: - match: \s*(,) captures: 1: >- - flowtype - punctuation.definition.template.arguments.flowtype + flow + punctuation.definition.template.arguments.flow push: optional-type-expression - match: \s*(>) captures: 1: >- - flowtype - punctuation.definition.template.arguments.end.flowtype + flow + punctuation.definition.template.arguments.end.flow pop: true optional-type-expression: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-type-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow/optional-type-expression.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/template/parameters.no-pop.sublime-syntax b/syntaxes/flow/template/parameters.no-pop.sublime-syntax similarity index 88% rename from syntaxes/fjsx15/flowtype/template/parameters.no-pop.sublime-syntax rename to syntaxes/flow/template/parameters.no-pop.sublime-syntax index 823ec317..82c99fc0 100644 --- a/syntaxes/fjsx15/flowtype/template/parameters.no-pop.sublime-syntax +++ b/syntaxes/flow/template/parameters.no-pop.sublime-syntax @@ -23,4 +23,4 @@ contexts: push: parameters parameters: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/parameters.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow/template/parameters.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/template/parameters.sublime-syntax b/syntaxes/flow/template/parameters.sublime-syntax similarity index 74% rename from syntaxes/fjsx15/flowtype/template/parameters.sublime-syntax rename to syntaxes/flow/template/parameters.sublime-syntax index b7ce1afb..6f6e9223 100644 --- a/syntaxes/fjsx15/flowtype/template/parameters.sublime-syntax +++ b/syntaxes/flow/template/parameters.sublime-syntax @@ -21,19 +21,19 @@ contexts: main: - match: \s*(<) captures: - 1: punctuation.definition.generic.begin.flowtype + 1: punctuation.definition.generic.begin.flow set: [ delimiters, optional-type-expression ] delimiters: - - meta_scope: meta.generic.flowtype + - meta_scope: meta.generic.flow - match: \s*(,) captures: - 1: punctuation.separator.comma.flowtype + 1: punctuation.separator.comma.flow push: optional-type-expression - match: \s*(>) captures: - 1: punctuation.definition.generic.end.flowtype + 1: punctuation.definition.generic.end.flow pop: true optional-type-expression: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-type-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow/optional-type-expression.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/tuple.sublime-syntax b/syntaxes/flow/tuple.sublime-syntax similarity index 74% rename from syntaxes/fjsx15/flowtype/tuple.sublime-syntax rename to syntaxes/flow/tuple.sublime-syntax index be87ac73..d2e14b8f 100644 --- a/syntaxes/fjsx15/flowtype/tuple.sublime-syntax +++ b/syntaxes/flow/tuple.sublime-syntax @@ -22,23 +22,23 @@ contexts: - match: \s*(\[) captures: 1: >- - flowtype - punctuation.definition.array.begin.flowtype + flow + punctuation.definition.array.begin.flow set: [ delimiters, optional-type-expression ] delimiters: - match: \s*(,) captures: 1: >- - flowtype - punctuation.definition.array.flowtype + flow + punctuation.definition.array.flow push: optional-type-expression - match: \s*(]) captures: 1: >- - flowtype - punctuation.definition.array.end.flowtype + flow + punctuation.definition.array.end.flow pop: true optional-type-expression: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-type-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow/optional-type-expression.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/type-aliasing.sublime-syntax b/syntaxes/flow/type-aliasing.sublime-syntax similarity index 69% rename from syntaxes/fjsx15/flowtype/type-aliasing.sublime-syntax rename to syntaxes/flow/type-aliasing.sublime-syntax index 3f35c189..b2d44f65 100644 --- a/syntaxes/fjsx15/flowtype/type-aliasing.sublime-syntax +++ b/syntaxes/flow/type-aliasing.sublime-syntax @@ -41,11 +41,11 @@ contexts: ) captures: 1: >- - flowtype - storage.modifier.flowtype + flow + storage.modifier.flow 2: >- - flowtype - storage.type.flowtype + flow + storage.type.flow set: [ punctuation, identifier @@ -56,25 +56,25 @@ contexts: (?xi)\s* ({{commonIdentifier}}) captures: - 1: entity.name.type.flowtype + 1: entity.name.type.flow pop: true punctuation: - - meta_scope: meta.declaration.type.flowtype - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/parameters.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.no-pop.sublime-syntax + - meta_scope: meta.declaration.type.flow + - include: Packages/Naomi/syntaxes/fjsx15/flow/template/parameters.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow/associated-type.no-pop.sublime-syntax - match: \s*(=) captures: - 1: keyword.operator.other.assignment.flowtype + 1: keyword.operator.other.assignment.flow set: [ meta-scope, optional-type-expression ] optional-type-expression: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-type-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow/optional-type-expression.sublime-syntax meta-scope: - - meta_scope: meta.declaration.type.flowtype + - meta_scope: meta.declaration.type.flow - match: "" pop: true diff --git a/syntaxes/fjsx15/flowtype/type-expression.sublime-syntax b/syntaxes/flow/type-expression.sublime-syntax similarity index 67% rename from syntaxes/fjsx15/flowtype/type-expression.sublime-syntax rename to syntaxes/flow/type-expression.sublime-syntax index f5a8b253..a38ae70f 100644 --- a/syntaxes/fjsx15/flowtype/type-expression.sublime-syntax +++ b/syntaxes/flow/type-expression.sublime-syntax @@ -25,15 +25,15 @@ contexts: main: - include: comment-no-pop # Functions need to be detected before expression groups. - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/function.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow/function.sublime-syntax # Detect operators as soon as possible. - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/operator.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow/operator.sublime-syntax # Open new type expression group. - match: "{{expressionGroupBegin}}" captures: 1: >- - flowtype - punctuation.definition.expression.group.begin.flowtype + flow + punctuation.definition.expression.group.begin.flow set: open-group # Start of the type expression. - match: "{{expressionBegin}}" @@ -43,18 +43,18 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax optional-type-expression: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/optional-type-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow/optional-type-expression.sublime-syntax open-group: - include: comment-no-pop # Functions need to be detected before expression groups. - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/function.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow/function.no-pop.sublime-syntax # Open new type expression group. - match: "{{expressionGroupBegin}}" captures: 1: >- - flowtype - punctuation.definition.expression.group.begin.flowtype + flow + punctuation.definition.expression.group.begin.flow push: open-group # Close the current type expression group. - include: close-group @@ -66,20 +66,20 @@ contexts: - match: \s*(\)) captures: 1: >- - flowtype - punctuation.definition.expression.group.end.flowtype + flow + punctuation.definition.expression.group.end.flow set: optional-tail head: - include: comment-no-pop - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/function.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/object.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/tuple.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow/function.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow/object.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow/tuple.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/literal/number.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/literal/string/template.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/simple.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow/simple.sublime-syntax optional-tail: - include: comment-no-pop @@ -87,12 +87,12 @@ contexts: - match: (?=\s*[\[<]) set: [ optional-tail, tail ] # Other operators. - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/operator.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow/operator.sublime-syntax # Anything else not expected. - match: (?=\s*\S) pop: true tail: - include: comment-no-pop - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/operator/array-shorthand.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/arguments.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow/operator/array-shorthand.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow/template/arguments.sublime-syntax From c29fba99788675f7cdc83f7f7705e4f2ba411dec Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 25 Dec 2017 14:23:05 -0200 Subject: [PATCH 284/407] [FJSX15] Add version suffix to flow syntax --- syntaxes/fjsx15/arrow-function.sublime-syntax | 2 +- .../arrow-function/parameters.sublime-syntax | 2 +- syntaxes/fjsx15/class.sublime-syntax | 8 +++---- syntaxes/fjsx15/class/body.sublime-syntax | 6 ++--- syntaxes/fjsx15/class/method.sublime-syntax | 2 +- syntaxes/fjsx15/class/property.sublime-syntax | 2 +- syntaxes/fjsx15/comment.sublime-syntax | 2 +- .../fjsx15/comment/flowtype.sublime-syntax | 12 +++++----- syntaxes/fjsx15/core.sublime-syntax | 2 +- .../fjsx15/destructuring/array.sublime-syntax | 2 +- syntaxes/fjsx15/export.sublime-syntax | 2 +- syntaxes/fjsx15/expression.sublime-syntax | 2 +- syntaxes/fjsx15/function-call.sublime-syntax | 2 +- .../fjsx15/function-expression.sublime-syntax | 2 +- syntaxes/fjsx15/function.sublime-syntax | 2 +- .../destructuring/array.sublime-syntax | 2 +- .../destructuring/object.sublime-syntax | 2 +- .../function/parameter/simple.sublime-syntax | 4 ++-- .../fjsx15/function/parameters.sublime-syntax | 2 +- syntaxes/fjsx15/import.sublime-syntax | 2 +- .../fjsx15/operator/relational.sublime-syntax | 2 +- syntaxes/fjsx15/statement.sublime-syntax | 6 ++--- .../variable-declaration.sublime-syntax | 4 ++-- syntaxes/fjsx15/variable.sublime-syntax | 4 ++-- syntaxes/fjsx15/web.sublime-syntax | 2 +- .../associated-type.no-pop.sublime-syntax | 2 +- .../associated-type.sublime-syntax | 2 +- syntaxes/{flow => flow1}/cast.sublime-syntax | 2 +- .../{flow => flow1}/declare.sublime-syntax | 2 +- .../function.no-pop.sublime-syntax | 2 +- .../{flow => flow1}/function.sublime-syntax | 6 ++--- .../function/parameters.sublime-syntax | 4 ++-- .../function/parameters/simple.sublime-syntax | 2 +- .../{flow => flow1}/indexer.sublime-syntax | 6 ++--- .../{flow => flow1}/interface.sublime-syntax | 10 ++++----- .../{flow => flow1}/module.sublime-syntax | 0 .../namespace-path.no-pop.sublime-syntax | 0 .../{flow => flow1}/object.sublime-syntax | 2 +- .../{flow => flow1}/operator.sublime-syntax | 6 ++--- .../operator/array-shorthand.sublime-syntax | 0 .../contravariant.no-pop.sublime-syntax | 0 .../operator/covariant.no-pop.sublime-syntax | 0 .../operator/intersection.sublime-syntax | 2 +- .../operator/nullable.sublime-syntax | 2 +- .../operator/union.sublime-syntax | 2 +- .../optional-associated-type.sublime-syntax | 2 +- .../optional-modifier.no-pop.sublime-syntax | 2 +- .../optional-modifier.sublime-syntax | 0 .../optional-type-expression.sublime-syntax | 2 +- .../{flow => flow1}/prolog.sublime-syntax | 0 .../{flow => flow1}/simple.sublime-syntax | 2 +- .../template/arguments.no-pop.sublime-syntax | 2 +- .../template/arguments.sublime-syntax | 2 +- .../template/parameters.no-pop.sublime-syntax | 2 +- .../template/parameters.sublime-syntax | 2 +- syntaxes/{flow => flow1}/tuple.sublime-syntax | 2 +- .../type-aliasing.sublime-syntax | 6 ++--- .../type-expression.sublime-syntax | 22 +++++++++---------- 58 files changed, 89 insertions(+), 89 deletions(-) rename syntaxes/{flow => flow1}/associated-type.no-pop.sublime-syntax (89%) rename syntaxes/{flow => flow1}/associated-type.sublime-syntax (89%) rename syntaxes/{flow => flow1}/cast.sublime-syntax (89%) rename syntaxes/{flow => flow1}/declare.sublime-syntax (91%) rename syntaxes/{flow => flow1}/function.no-pop.sublime-syntax (91%) rename syntaxes/{flow => flow1}/function.sublime-syntax (83%) rename syntaxes/{flow => flow1}/function/parameters.sublime-syntax (87%) rename syntaxes/{flow => flow1}/function/parameters/simple.sublime-syntax (91%) rename syntaxes/{flow => flow1}/indexer.sublime-syntax (88%) rename syntaxes/{flow => flow1}/interface.sublime-syntax (83%) rename syntaxes/{flow => flow1}/module.sublime-syntax (100%) rename syntaxes/{flow => flow1}/namespace-path.no-pop.sublime-syntax (100%) rename syntaxes/{flow => flow1}/object.sublime-syntax (97%) rename syntaxes/{flow => flow1}/operator.sublime-syntax (70%) rename syntaxes/{flow => flow1}/operator/array-shorthand.sublime-syntax (100%) rename syntaxes/{flow => flow1}/operator/contravariant.no-pop.sublime-syntax (100%) rename syntaxes/{flow => flow1}/operator/covariant.no-pop.sublime-syntax (100%) rename syntaxes/{flow => flow1}/operator/intersection.sublime-syntax (89%) rename syntaxes/{flow => flow1}/operator/nullable.sublime-syntax (89%) rename syntaxes/{flow => flow1}/operator/union.sublime-syntax (89%) rename syntaxes/{flow => flow1}/optional-associated-type.sublime-syntax (89%) rename syntaxes/{flow => flow1}/optional-modifier.no-pop.sublime-syntax (88%) rename syntaxes/{flow => flow1}/optional-modifier.sublime-syntax (100%) rename syntaxes/{flow => flow1}/optional-type-expression.sublime-syntax (88%) rename syntaxes/{flow => flow1}/prolog.sublime-syntax (100%) rename syntaxes/{flow => flow1}/simple.sublime-syntax (93%) rename syntaxes/{flow => flow1}/template/arguments.no-pop.sublime-syntax (88%) rename syntaxes/{flow => flow1}/template/arguments.sublime-syntax (92%) rename syntaxes/{flow => flow1}/template/parameters.no-pop.sublime-syntax (88%) rename syntaxes/{flow => flow1}/template/parameters.sublime-syntax (91%) rename syntaxes/{flow => flow1}/tuple.sublime-syntax (92%) rename syntaxes/{flow => flow1}/type-aliasing.sublime-syntax (85%) rename syntaxes/{flow => flow1}/type-expression.sublime-syntax (74%) diff --git a/syntaxes/fjsx15/arrow-function.sublime-syntax b/syntaxes/fjsx15/arrow-function.sublime-syntax index 0b1614f6..804825c8 100644 --- a/syntaxes/fjsx15/arrow-function.sublime-syntax +++ b/syntaxes/fjsx15/arrow-function.sublime-syntax @@ -106,7 +106,7 @@ contexts: normal-arrow-function: - meta_scope: meta.function.js.fjsx15 - include: Packages/Naomi/syntaxes/fjsx15/async.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/flow/template/parameters.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/template/parameters.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function/parameters.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/body.sublime-syntax diff --git a/syntaxes/fjsx15/arrow-function/parameters.sublime-syntax b/syntaxes/fjsx15/arrow-function/parameters.sublime-syntax index c0f1135d..92cea892 100644 --- a/syntaxes/fjsx15/arrow-function/parameters.sublime-syntax +++ b/syntaxes/fjsx15/arrow-function/parameters.sublime-syntax @@ -58,4 +58,4 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax optional-return-type: - - include: Packages/Naomi/syntaxes/flow/optional-associated-type.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/optional-associated-type.sublime-syntax diff --git a/syntaxes/fjsx15/class.sublime-syntax b/syntaxes/fjsx15/class.sublime-syntax index 38a47ffc..e9a52bce 100644 --- a/syntaxes/fjsx15/class.sublime-syntax +++ b/syntaxes/fjsx15/class.sublime-syntax @@ -65,16 +65,16 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax template-parameters: - - include: Packages/Naomi/syntaxes/flow/template/parameters.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/template/parameters.sublime-syntax type-expression: - - include: Packages/Naomi/syntaxes/flow/type-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/type-expression.sublime-syntax body: - include: Packages/Naomi/syntaxes/fjsx15/class/body.sublime-syntax optional-template-arguments: - - include: Packages/Naomi/syntaxes/flow/template/arguments.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/template/arguments.sublime-syntax - match: "" pop: true @@ -90,7 +90,7 @@ contexts: pop: true target-class-or-namespace: - - include: Packages/Naomi/syntaxes/flow/namespace-path.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/namespace-path.no-pop.sublime-syntax - match: | (?xi) \s*({{commonIdentifier}}) diff --git a/syntaxes/fjsx15/class/body.sublime-syntax b/syntaxes/fjsx15/class/body.sublime-syntax index 52c10e9b..268ea8ff 100644 --- a/syntaxes/fjsx15/class/body.sublime-syntax +++ b/syntaxes/fjsx15/class/body.sublime-syntax @@ -42,9 +42,9 @@ contexts: statements-and-expressions: - include: comment-no-pop - - include: Packages/Naomi/syntaxes/flow/operator/covariant.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/flow/operator/contravariant.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/flow/indexer.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/operator/covariant.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/operator/contravariant.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/indexer.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/decorator.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/react-js.sublime-syntax#class-properties - include: Packages/Naomi/syntaxes/fjsx15/react-js.sublime-syntax diff --git a/syntaxes/fjsx15/class/method.sublime-syntax b/syntaxes/fjsx15/class/method.sublime-syntax index fc820529..eb3c4a47 100644 --- a/syntaxes/fjsx15/class/method.sublime-syntax +++ b/syntaxes/fjsx15/class/method.sublime-syntax @@ -109,7 +109,7 @@ contexts: pop: true template-parameters: - - include: Packages/Naomi/syntaxes/flow/template/parameters.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/template/parameters.sublime-syntax parameters: - include: Packages/Naomi/syntaxes/fjsx15/function/parameters.sublime-syntax diff --git a/syntaxes/fjsx15/class/property.sublime-syntax b/syntaxes/fjsx15/class/property.sublime-syntax index 3e2b9820..2f3c4dbb 100644 --- a/syntaxes/fjsx15/class/property.sublime-syntax +++ b/syntaxes/fjsx15/class/property.sublime-syntax @@ -53,7 +53,7 @@ contexts: pop: true associated-type: - - include: Packages/Naomi/syntaxes/flow/associated-type.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/associated-type.sublime-syntax optional-expression: - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/comment.sublime-syntax b/syntaxes/fjsx15/comment.sublime-syntax index 0fd886b7..dc510415 100644 --- a/syntaxes/fjsx15/comment.sublime-syntax +++ b/syntaxes/fjsx15/comment.sublime-syntax @@ -19,7 +19,7 @@ scope: ... contexts: main: - - include: Packages/Naomi/syntaxes/flow/prolog.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/prolog.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/comment/eslint.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/comment/flow.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/comment/normal.sublime-syntax diff --git a/syntaxes/fjsx15/comment/flowtype.sublime-syntax b/syntaxes/fjsx15/comment/flowtype.sublime-syntax index 5801a5ea..df3ccdb4 100644 --- a/syntaxes/fjsx15/comment/flowtype.sublime-syntax +++ b/syntaxes/fjsx15/comment/flowtype.sublime-syntax @@ -51,7 +51,7 @@ contexts: associated-type: - match: (?=\s*\*\/) pop: true - - include: Packages/Naomi/syntaxes/flow/associated-type.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/associated-type.sublime-syntax statements-and-expressions: - match: (?=\s*\*\/) @@ -61,12 +61,12 @@ contexts: - match: \s*(;) captures: 1: keyword.other.terminator.js.fjsx15 - - include: Packages/Naomi/syntaxes/flow/associated-type.sublime-syntax - - include: Packages/Naomi/syntaxes/flow/declare.sublime-syntax - - include: Packages/Naomi/syntaxes/flow/interface.sublime-syntax - - include: Packages/Naomi/syntaxes/flow/type-aliasing.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/associated-type.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/declare.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/interface.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/type-aliasing.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/class/property.sublime-syntax - - include: Packages/Naomi/syntaxes/flow/indexer.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/indexer.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/import.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/export.sublime-syntax - match: "" diff --git a/syntaxes/fjsx15/core.sublime-syntax b/syntaxes/fjsx15/core.sublime-syntax index 08a62cb2..b5ceada3 100644 --- a/syntaxes/fjsx15/core.sublime-syntax +++ b/syntaxes/fjsx15/core.sublime-syntax @@ -42,7 +42,7 @@ contexts: - include: web-assembly optional-template-and-arguments: - - include: Packages/Naomi/syntaxes/flow/template/arguments.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/template/arguments.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function-call/arguments.sublime-syntax - match: (?=\s*\S) pop: true diff --git a/syntaxes/fjsx15/destructuring/array.sublime-syntax b/syntaxes/fjsx15/destructuring/array.sublime-syntax index 59a40024..cca75551 100644 --- a/syntaxes/fjsx15/destructuring/array.sublime-syntax +++ b/syntaxes/fjsx15/destructuring/array.sublime-syntax @@ -53,7 +53,7 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax optional-type: - - include: Packages/Naomi/syntaxes/flow/optional-associated-type.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/optional-associated-type.sublime-syntax optional-variable: - match: (?=\s*[,)\]}]) diff --git a/syntaxes/fjsx15/export.sublime-syntax b/syntaxes/fjsx15/export.sublime-syntax index 101cb146..beed03df 100644 --- a/syntaxes/fjsx15/export.sublime-syntax +++ b/syntaxes/fjsx15/export.sublime-syntax @@ -262,4 +262,4 @@ contexts: push: simple-type simple-type: - - include: Packages/Naomi/syntaxes/flow/simple.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/simple.sublime-syntax diff --git a/syntaxes/fjsx15/expression.sublime-syntax b/syntaxes/fjsx15/expression.sublime-syntax index 18e45c94..ec88dbe6 100644 --- a/syntaxes/fjsx15/expression.sublime-syntax +++ b/syntaxes/fjsx15/expression.sublime-syntax @@ -56,7 +56,7 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/literal/string/regex.sublime-syntax type-cast: - - include: Packages/Naomi/syntaxes/flow/cast.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/cast.sublime-syntax open-group: - meta_scope: meta.group.js.fjsx15 diff --git a/syntaxes/fjsx15/function-call.sublime-syntax b/syntaxes/fjsx15/function-call.sublime-syntax index 378ef7d0..a32ec6fd 100644 --- a/syntaxes/fjsx15/function-call.sublime-syntax +++ b/syntaxes/fjsx15/function-call.sublime-syntax @@ -80,7 +80,7 @@ contexts: pop: true template-arguments: - - include: Packages/Naomi/syntaxes/flow/template/arguments.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/template/arguments.sublime-syntax arguments: - include: Packages/Naomi/syntaxes/fjsx15/function-call/arguments.sublime-syntax diff --git a/syntaxes/fjsx15/function-expression.sublime-syntax b/syntaxes/fjsx15/function-expression.sublime-syntax index 7cc720df..3df1ab4a 100644 --- a/syntaxes/fjsx15/function-expression.sublime-syntax +++ b/syntaxes/fjsx15/function-expression.sublime-syntax @@ -71,7 +71,7 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax template-parameters: - - include: Packages/Naomi/syntaxes/flow/template/parameters.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/template/parameters.sublime-syntax parameters: - include: Packages/Naomi/syntaxes/fjsx15/function/parameters.sublime-syntax diff --git a/syntaxes/fjsx15/function.sublime-syntax b/syntaxes/fjsx15/function.sublime-syntax index 5766d61c..ea182add 100644 --- a/syntaxes/fjsx15/function.sublime-syntax +++ b/syntaxes/fjsx15/function.sublime-syntax @@ -73,7 +73,7 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax template-parameters: - - include: Packages/Naomi/syntaxes/flow/template/parameters.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/template/parameters.sublime-syntax parameters: - include: Packages/Naomi/syntaxes/fjsx15/function/parameters.sublime-syntax diff --git a/syntaxes/fjsx15/function/parameter/destructuring/array.sublime-syntax b/syntaxes/fjsx15/function/parameter/destructuring/array.sublime-syntax index 93ab43c6..5d7a45a5 100644 --- a/syntaxes/fjsx15/function/parameter/destructuring/array.sublime-syntax +++ b/syntaxes/fjsx15/function/parameter/destructuring/array.sublime-syntax @@ -52,7 +52,7 @@ contexts: optional-type-and-default-value: - match: (?=\s*,) pop: true - - include: Packages/Naomi/syntaxes/flow/associated-type.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/associated-type.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax comment-no-pop: diff --git a/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax b/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax index 25864cca..609047aa 100644 --- a/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax +++ b/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax @@ -58,7 +58,7 @@ contexts: optional-type-and-default-value: - match: (?=\s*,) pop: true - - include: Packages/Naomi/syntaxes/flow/associated-type.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/associated-type.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax comment-no-pop: diff --git a/syntaxes/fjsx15/function/parameter/simple.sublime-syntax b/syntaxes/fjsx15/function/parameter/simple.sublime-syntax index cdef9fa9..e74a33d9 100644 --- a/syntaxes/fjsx15/function/parameter/simple.sublime-syntax +++ b/syntaxes/fjsx15/function/parameter/simple.sublime-syntax @@ -104,8 +104,8 @@ contexts: set: optional-modifier-and-type optional-modifier-and-type: - - include: Packages/Naomi/syntaxes/flow/optional-modifier.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/flow/optional-associated-type.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/optional-modifier.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/optional-associated-type.sublime-syntax optional-default-value: - meta_scope: >- diff --git a/syntaxes/fjsx15/function/parameters.sublime-syntax b/syntaxes/fjsx15/function/parameters.sublime-syntax index 1491958e..75e4c1a2 100644 --- a/syntaxes/fjsx15/function/parameters.sublime-syntax +++ b/syntaxes/fjsx15/function/parameters.sublime-syntax @@ -49,4 +49,4 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax optional-return-type: - - include: Packages/Naomi/syntaxes/flow/optional-associated-type.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/optional-associated-type.sublime-syntax diff --git a/syntaxes/fjsx15/import.sublime-syntax b/syntaxes/fjsx15/import.sublime-syntax index 3ec2a047..24482bef 100644 --- a/syntaxes/fjsx15/import.sublime-syntax +++ b/syntaxes/fjsx15/import.sublime-syntax @@ -155,7 +155,7 @@ contexts: ] simple-type: - - include: Packages/Naomi/syntaxes/flow/simple.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/simple.sublime-syntax optional-alias: - match: | diff --git a/syntaxes/fjsx15/operator/relational.sublime-syntax b/syntaxes/fjsx15/operator/relational.sublime-syntax index 808022b0..60ab362d 100644 --- a/syntaxes/fjsx15/operator/relational.sublime-syntax +++ b/syntaxes/fjsx15/operator/relational.sublime-syntax @@ -36,4 +36,4 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax optional-type-expression: - - include: Packages/Naomi/syntaxes/flow/optional-type-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/optional-type-expression.sublime-syntax diff --git a/syntaxes/fjsx15/statement.sublime-syntax b/syntaxes/fjsx15/statement.sublime-syntax index a1dae22b..81215f22 100644 --- a/syntaxes/fjsx15/statement.sublime-syntax +++ b/syntaxes/fjsx15/statement.sublime-syntax @@ -24,9 +24,9 @@ variables: contexts: main: - - include: Packages/Naomi/syntaxes/flow/declare.sublime-syntax - - include: Packages/Naomi/syntaxes/flow/interface.sublime-syntax - - include: Packages/Naomi/syntaxes/flow/type-aliasing.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/declare.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/interface.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/type-aliasing.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/decorator.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/import.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/export.sublime-syntax diff --git a/syntaxes/fjsx15/variable-declaration.sublime-syntax b/syntaxes/fjsx15/variable-declaration.sublime-syntax index f3ac17ec..dfc206c2 100644 --- a/syntaxes/fjsx15/variable-declaration.sublime-syntax +++ b/syntaxes/fjsx15/variable-declaration.sublime-syntax @@ -101,7 +101,7 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax associated-type: - - include: Packages/Naomi/syntaxes/flow/associated-type.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/associated-type.sublime-syntax optional-type-and-initial-value: - meta_scope: meta.declaration.variable.js.fjsx15 @@ -134,7 +134,7 @@ contexts: optional-type: - include: comment-no-pop - - include: Packages/Naomi/syntaxes/flow/optional-associated-type.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/optional-associated-type.sublime-syntax constant: # Single character. diff --git a/syntaxes/fjsx15/variable.sublime-syntax b/syntaxes/fjsx15/variable.sublime-syntax index 8c6c3700..17697dac 100644 --- a/syntaxes/fjsx15/variable.sublime-syntax +++ b/syntaxes/fjsx15/variable.sublime-syntax @@ -165,7 +165,7 @@ contexts: normal-arrow-function: - meta_scope: meta.function.declaration.js.fjsx15 - include: Packages/Naomi/syntaxes/fjsx15/async.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/flow/template/parameters.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/template/parameters.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/parameters.no-pop.sublime-syntax - match: (?=\s*=>) set: arrow-body @@ -179,7 +179,7 @@ contexts: optional-type: - include: comment-no-pop - - include: Packages/Naomi/syntaxes/flow/optional-associated-type.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/optional-associated-type.sublime-syntax object: - match: | diff --git a/syntaxes/fjsx15/web.sublime-syntax b/syntaxes/fjsx15/web.sublime-syntax index 67d27302..7be447e1 100644 --- a/syntaxes/fjsx15/web.sublime-syntax +++ b/syntaxes/fjsx15/web.sublime-syntax @@ -24,7 +24,7 @@ contexts: - include: window-functions optional-template-and-arguments: - - include: Packages/Naomi/syntaxes/flow/template/arguments.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/template/arguments.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function-call/arguments.sublime-syntax - match: (?=\s*\S) pop: true diff --git a/syntaxes/flow/associated-type.no-pop.sublime-syntax b/syntaxes/flow1/associated-type.no-pop.sublime-syntax similarity index 89% rename from syntaxes/flow/associated-type.no-pop.sublime-syntax rename to syntaxes/flow1/associated-type.no-pop.sublime-syntax index 84fcb8b3..c620b52e 100644 --- a/syntaxes/flow/associated-type.no-pop.sublime-syntax +++ b/syntaxes/flow1/associated-type.no-pop.sublime-syntax @@ -23,4 +23,4 @@ contexts: push: associated-type associated-type: - - include: Packages/Naomi/syntaxes/fjsx15/flow/associated-type.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow1/associated-type.sublime-syntax diff --git a/syntaxes/flow/associated-type.sublime-syntax b/syntaxes/flow1/associated-type.sublime-syntax similarity index 89% rename from syntaxes/flow/associated-type.sublime-syntax rename to syntaxes/flow1/associated-type.sublime-syntax index 0a0bb49f..d9c1b0cc 100644 --- a/syntaxes/flow/associated-type.sublime-syntax +++ b/syntaxes/flow1/associated-type.sublime-syntax @@ -27,4 +27,4 @@ contexts: set: optional-type-expression optional-type-expression: - - include: Packages/Naomi/syntaxes/fjsx15/flow/optional-type-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow1/optional-type-expression.sublime-syntax diff --git a/syntaxes/flow/cast.sublime-syntax b/syntaxes/flow1/cast.sublime-syntax similarity index 89% rename from syntaxes/flow/cast.sublime-syntax rename to syntaxes/flow1/cast.sublime-syntax index d2ebb1d8..c537ed8f 100644 --- a/syntaxes/flow/cast.sublime-syntax +++ b/syntaxes/flow1/cast.sublime-syntax @@ -29,4 +29,4 @@ contexts: set: optional-type-expression optional-type-expression: - - include: Packages/Naomi/syntaxes/fjsx15/flow/optional-type-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow1/optional-type-expression.sublime-syntax diff --git a/syntaxes/flow/declare.sublime-syntax b/syntaxes/flow1/declare.sublime-syntax similarity index 91% rename from syntaxes/flow/declare.sublime-syntax rename to syntaxes/flow1/declare.sublime-syntax index 1e31fe6b..04e7fef3 100644 --- a/syntaxes/flow/declare.sublime-syntax +++ b/syntaxes/flow1/declare.sublime-syntax @@ -27,6 +27,6 @@ contexts: set: possible-module possible-module: - - include: Packages/Naomi/syntaxes/fjsx15/flow/module.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow1/module.sublime-syntax - match: (?=\s*\S) pop: true diff --git a/syntaxes/flow/function.no-pop.sublime-syntax b/syntaxes/flow1/function.no-pop.sublime-syntax similarity index 91% rename from syntaxes/flow/function.no-pop.sublime-syntax rename to syntaxes/flow1/function.no-pop.sublime-syntax index 219a39fc..cc611450 100644 --- a/syntaxes/flow/function.no-pop.sublime-syntax +++ b/syntaxes/flow1/function.no-pop.sublime-syntax @@ -47,4 +47,4 @@ contexts: push: declaration declaration: - - include: Packages/Naomi/syntaxes/fjsx15/flow/function.sublime-syntax#declaration + - include: Packages/Naomi/syntaxes/fjsx15/flow1/function.sublime-syntax#declaration diff --git a/syntaxes/flow/function.sublime-syntax b/syntaxes/flow1/function.sublime-syntax similarity index 83% rename from syntaxes/flow/function.sublime-syntax rename to syntaxes/flow1/function.sublime-syntax index a0e1619d..5b424ea7 100644 --- a/syntaxes/flow/function.sublime-syntax +++ b/syntaxes/flow1/function.sublime-syntax @@ -58,10 +58,10 @@ contexts: ] template-arguments: - - include: Packages/Naomi/syntaxes/fjsx15/flow/template/arguments.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow1/template/arguments.sublime-syntax parameters: - - include: Packages/Naomi/syntaxes/fjsx15/flow/function/parameters.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow1/function/parameters.sublime-syntax return: - match: \s*(=>) @@ -72,5 +72,5 @@ contexts: set: optional-type-expression optional-type-expression: - - include: Packages/Naomi/syntaxes/fjsx15/flow/optional-type-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow1/optional-type-expression.sublime-syntax diff --git a/syntaxes/flow/function/parameters.sublime-syntax b/syntaxes/flow1/function/parameters.sublime-syntax similarity index 87% rename from syntaxes/flow/function/parameters.sublime-syntax rename to syntaxes/flow1/function/parameters.sublime-syntax index 994e1aed..6a0e3b24 100644 --- a/syntaxes/flow/function/parameters.sublime-syntax +++ b/syntaxes/flow1/function/parameters.sublime-syntax @@ -47,5 +47,5 @@ contexts: 1: >- flow keyword.operator.other.rest.flow - - include: Packages/Naomi/syntaxes/fjsx15/flow/function/parameters/simple.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flow/optional-type-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow1/function/parameters/simple.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow1/optional-type-expression.sublime-syntax diff --git a/syntaxes/flow/function/parameters/simple.sublime-syntax b/syntaxes/flow1/function/parameters/simple.sublime-syntax similarity index 91% rename from syntaxes/flow/function/parameters/simple.sublime-syntax rename to syntaxes/flow1/function/parameters/simple.sublime-syntax index 9dfafd95..82b1e8ce 100644 --- a/syntaxes/flow/function/parameters/simple.sublime-syntax +++ b/syntaxes/flow1/function/parameters/simple.sublime-syntax @@ -39,4 +39,4 @@ contexts: set: optional-associated-type optional-associated-type: - - include: Packages/Naomi/syntaxes/fjsx15/flow/optional-associated-type.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow1/optional-associated-type.sublime-syntax diff --git a/syntaxes/flow/indexer.sublime-syntax b/syntaxes/flow1/indexer.sublime-syntax similarity index 88% rename from syntaxes/flow/indexer.sublime-syntax rename to syntaxes/flow1/indexer.sublime-syntax index 567e2c39..c9f5c41c 100644 --- a/syntaxes/flow/indexer.sublime-syntax +++ b/syntaxes/flow1/indexer.sublime-syntax @@ -40,10 +40,10 @@ contexts: set: optional-associated-type type-expression: - - include: Packages/Naomi/syntaxes/fjsx15/flow/type-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow1/type-expression.sublime-syntax optional-associated-type: - - include: Packages/Naomi/syntaxes/fjsx15/flow/optional-associated-type.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow1/optional-associated-type.sublime-syntax optional-name: - include: comment-no-pop @@ -76,7 +76,7 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/literal/string/template.sublime-syntax associated-type: - - include: Packages/Naomi/syntaxes/fjsx15/flow/associated-type.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow1/associated-type.sublime-syntax comment-no-pop: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax diff --git a/syntaxes/flow/interface.sublime-syntax b/syntaxes/flow1/interface.sublime-syntax similarity index 83% rename from syntaxes/flow/interface.sublime-syntax rename to syntaxes/flow1/interface.sublime-syntax index 7e577511..1257fc55 100644 --- a/syntaxes/flow/interface.sublime-syntax +++ b/syntaxes/flow1/interface.sublime-syntax @@ -54,10 +54,10 @@ contexts: entity.name.interface.flow optional-type-expression: - - include: Packages/Naomi/syntaxes/fjsx15/flow/optional-type-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow1/optional-type-expression.sublime-syntax template-parameters: - - include: Packages/Naomi/syntaxes/fjsx15/flow/template/parameters.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow1/template/parameters.sublime-syntax body: - include: comment-no-pop @@ -88,9 +88,9 @@ contexts: - match: (?=\s*}) pop: true - include: comment-no-pop - - include: Packages/Naomi/syntaxes/fjsx15/flow/operator/covariant.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flow/operator/contravariant.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flow/indexer.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow1/operator/covariant.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow1/operator/contravariant.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow1/indexer.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/class/method.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/class/property.sublime-syntax diff --git a/syntaxes/flow/module.sublime-syntax b/syntaxes/flow1/module.sublime-syntax similarity index 100% rename from syntaxes/flow/module.sublime-syntax rename to syntaxes/flow1/module.sublime-syntax diff --git a/syntaxes/flow/namespace-path.no-pop.sublime-syntax b/syntaxes/flow1/namespace-path.no-pop.sublime-syntax similarity index 100% rename from syntaxes/flow/namespace-path.no-pop.sublime-syntax rename to syntaxes/flow1/namespace-path.no-pop.sublime-syntax diff --git a/syntaxes/flow/object.sublime-syntax b/syntaxes/flow1/object.sublime-syntax similarity index 97% rename from syntaxes/flow/object.sublime-syntax rename to syntaxes/flow1/object.sublime-syntax index c0893d89..da025d4a 100644 --- a/syntaxes/flow/object.sublime-syntax +++ b/syntaxes/flow1/object.sublime-syntax @@ -160,7 +160,7 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/literal/string/template.sublime-syntax associated-type: - - include: Packages/Naomi/syntaxes/fjsx15/flow/associated-type.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow1/associated-type.sublime-syntax comment-no-pop: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax diff --git a/syntaxes/flow/operator.sublime-syntax b/syntaxes/flow1/operator.sublime-syntax similarity index 70% rename from syntaxes/flow/operator.sublime-syntax rename to syntaxes/flow1/operator.sublime-syntax index fed16e76..1bc35be3 100644 --- a/syntaxes/flow/operator.sublime-syntax +++ b/syntaxes/flow1/operator.sublime-syntax @@ -19,6 +19,6 @@ scope: ... contexts: main: - - include: Packages/Naomi/syntaxes/fjsx15/flow/operator/intersection.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flow/operator/nullable.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flow/operator/union.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow1/operator/intersection.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow1/operator/nullable.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow1/operator/union.sublime-syntax diff --git a/syntaxes/flow/operator/array-shorthand.sublime-syntax b/syntaxes/flow1/operator/array-shorthand.sublime-syntax similarity index 100% rename from syntaxes/flow/operator/array-shorthand.sublime-syntax rename to syntaxes/flow1/operator/array-shorthand.sublime-syntax diff --git a/syntaxes/flow/operator/contravariant.no-pop.sublime-syntax b/syntaxes/flow1/operator/contravariant.no-pop.sublime-syntax similarity index 100% rename from syntaxes/flow/operator/contravariant.no-pop.sublime-syntax rename to syntaxes/flow1/operator/contravariant.no-pop.sublime-syntax diff --git a/syntaxes/flow/operator/covariant.no-pop.sublime-syntax b/syntaxes/flow1/operator/covariant.no-pop.sublime-syntax similarity index 100% rename from syntaxes/flow/operator/covariant.no-pop.sublime-syntax rename to syntaxes/flow1/operator/covariant.no-pop.sublime-syntax diff --git a/syntaxes/flow/operator/intersection.sublime-syntax b/syntaxes/flow1/operator/intersection.sublime-syntax similarity index 89% rename from syntaxes/flow/operator/intersection.sublime-syntax rename to syntaxes/flow1/operator/intersection.sublime-syntax index 3684eb81..afbcc4dc 100644 --- a/syntaxes/flow/operator/intersection.sublime-syntax +++ b/syntaxes/flow1/operator/intersection.sublime-syntax @@ -27,4 +27,4 @@ contexts: set: optional-type-expression optional-type-expression: - - include: Packages/Naomi/syntaxes/fjsx15/flow/optional-type-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow1/optional-type-expression.sublime-syntax diff --git a/syntaxes/flow/operator/nullable.sublime-syntax b/syntaxes/flow1/operator/nullable.sublime-syntax similarity index 89% rename from syntaxes/flow/operator/nullable.sublime-syntax rename to syntaxes/flow1/operator/nullable.sublime-syntax index 2508c3c0..ab7ae1a3 100644 --- a/syntaxes/flow/operator/nullable.sublime-syntax +++ b/syntaxes/flow1/operator/nullable.sublime-syntax @@ -27,4 +27,4 @@ contexts: set: optional-type-expression optional-type-expression: - - include: Packages/Naomi/syntaxes/fjsx15/flow/optional-type-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow1/optional-type-expression.sublime-syntax diff --git a/syntaxes/flow/operator/union.sublime-syntax b/syntaxes/flow1/operator/union.sublime-syntax similarity index 89% rename from syntaxes/flow/operator/union.sublime-syntax rename to syntaxes/flow1/operator/union.sublime-syntax index cf3ec958..4753b88f 100644 --- a/syntaxes/flow/operator/union.sublime-syntax +++ b/syntaxes/flow1/operator/union.sublime-syntax @@ -27,4 +27,4 @@ contexts: set: optional-type-expression optional-type-expression: - - include: Packages/Naomi/syntaxes/fjsx15/flow/optional-type-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow1/optional-type-expression.sublime-syntax diff --git a/syntaxes/flow/optional-associated-type.sublime-syntax b/syntaxes/flow1/optional-associated-type.sublime-syntax similarity index 89% rename from syntaxes/flow/optional-associated-type.sublime-syntax rename to syntaxes/flow1/optional-associated-type.sublime-syntax index 7970a19b..e8ef7904 100644 --- a/syntaxes/flow/optional-associated-type.sublime-syntax +++ b/syntaxes/flow1/optional-associated-type.sublime-syntax @@ -25,4 +25,4 @@ contexts: pop: true associated-type: - - include: Packages/Naomi/syntaxes/fjsx15/flow/associated-type.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow1/associated-type.sublime-syntax diff --git a/syntaxes/flow/optional-modifier.no-pop.sublime-syntax b/syntaxes/flow1/optional-modifier.no-pop.sublime-syntax similarity index 88% rename from syntaxes/flow/optional-modifier.no-pop.sublime-syntax rename to syntaxes/flow1/optional-modifier.no-pop.sublime-syntax index 38c1b3dc..110604cb 100644 --- a/syntaxes/flow/optional-modifier.no-pop.sublime-syntax +++ b/syntaxes/flow1/optional-modifier.no-pop.sublime-syntax @@ -23,4 +23,4 @@ contexts: push: optional-modifier optional-modifier: - - include: Packages/Naomi/syntaxes/fjsx15/flow/optional-modifier.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow1/optional-modifier.sublime-syntax diff --git a/syntaxes/flow/optional-modifier.sublime-syntax b/syntaxes/flow1/optional-modifier.sublime-syntax similarity index 100% rename from syntaxes/flow/optional-modifier.sublime-syntax rename to syntaxes/flow1/optional-modifier.sublime-syntax diff --git a/syntaxes/flow/optional-type-expression.sublime-syntax b/syntaxes/flow1/optional-type-expression.sublime-syntax similarity index 88% rename from syntaxes/flow/optional-type-expression.sublime-syntax rename to syntaxes/flow1/optional-type-expression.sublime-syntax index d2c1314b..2470ca09 100644 --- a/syntaxes/flow/optional-type-expression.sublime-syntax +++ b/syntaxes/flow1/optional-type-expression.sublime-syntax @@ -21,4 +21,4 @@ contexts: main: - match: (?=\s*[>,;:)\]}]) pop: true - - include: Packages/Naomi/syntaxes/fjsx15/flow/type-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow1/type-expression.sublime-syntax diff --git a/syntaxes/flow/prolog.sublime-syntax b/syntaxes/flow1/prolog.sublime-syntax similarity index 100% rename from syntaxes/flow/prolog.sublime-syntax rename to syntaxes/flow1/prolog.sublime-syntax diff --git a/syntaxes/flow/simple.sublime-syntax b/syntaxes/flow1/simple.sublime-syntax similarity index 93% rename from syntaxes/flow/simple.sublime-syntax rename to syntaxes/flow1/simple.sublime-syntax index f5a64e76..5ac43206 100644 --- a/syntaxes/flow/simple.sublime-syntax +++ b/syntaxes/flow1/simple.sublime-syntax @@ -24,7 +24,7 @@ variables: contexts: main: - - include: Packages/Naomi/syntaxes/fjsx15/flow/namespace-path.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow1/namespace-path.no-pop.sublime-syntax # Existential. - match: \s*(\*) captures: diff --git a/syntaxes/flow/template/arguments.no-pop.sublime-syntax b/syntaxes/flow1/template/arguments.no-pop.sublime-syntax similarity index 88% rename from syntaxes/flow/template/arguments.no-pop.sublime-syntax rename to syntaxes/flow1/template/arguments.no-pop.sublime-syntax index 097aa43d..1748fb21 100644 --- a/syntaxes/flow/template/arguments.no-pop.sublime-syntax +++ b/syntaxes/flow1/template/arguments.no-pop.sublime-syntax @@ -23,4 +23,4 @@ contexts: push: arguments arguments: - - include: Packages/Naomi/syntaxes/fjsx15/flow/template/arguments.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow1/template/arguments.sublime-syntax diff --git a/syntaxes/flow/template/arguments.sublime-syntax b/syntaxes/flow1/template/arguments.sublime-syntax similarity index 92% rename from syntaxes/flow/template/arguments.sublime-syntax rename to syntaxes/flow1/template/arguments.sublime-syntax index a2c13534..cdf04bd6 100644 --- a/syntaxes/flow/template/arguments.sublime-syntax +++ b/syntaxes/flow1/template/arguments.sublime-syntax @@ -41,4 +41,4 @@ contexts: pop: true optional-type-expression: - - include: Packages/Naomi/syntaxes/fjsx15/flow/optional-type-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow1/optional-type-expression.sublime-syntax diff --git a/syntaxes/flow/template/parameters.no-pop.sublime-syntax b/syntaxes/flow1/template/parameters.no-pop.sublime-syntax similarity index 88% rename from syntaxes/flow/template/parameters.no-pop.sublime-syntax rename to syntaxes/flow1/template/parameters.no-pop.sublime-syntax index 82c99fc0..ee591111 100644 --- a/syntaxes/flow/template/parameters.no-pop.sublime-syntax +++ b/syntaxes/flow1/template/parameters.no-pop.sublime-syntax @@ -23,4 +23,4 @@ contexts: push: parameters parameters: - - include: Packages/Naomi/syntaxes/fjsx15/flow/template/parameters.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow1/template/parameters.sublime-syntax diff --git a/syntaxes/flow/template/parameters.sublime-syntax b/syntaxes/flow1/template/parameters.sublime-syntax similarity index 91% rename from syntaxes/flow/template/parameters.sublime-syntax rename to syntaxes/flow1/template/parameters.sublime-syntax index 6f6e9223..229dbb88 100644 --- a/syntaxes/flow/template/parameters.sublime-syntax +++ b/syntaxes/flow1/template/parameters.sublime-syntax @@ -36,4 +36,4 @@ contexts: pop: true optional-type-expression: - - include: Packages/Naomi/syntaxes/fjsx15/flow/optional-type-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow1/optional-type-expression.sublime-syntax diff --git a/syntaxes/flow/tuple.sublime-syntax b/syntaxes/flow1/tuple.sublime-syntax similarity index 92% rename from syntaxes/flow/tuple.sublime-syntax rename to syntaxes/flow1/tuple.sublime-syntax index d2e14b8f..bf54fd4a 100644 --- a/syntaxes/flow/tuple.sublime-syntax +++ b/syntaxes/flow1/tuple.sublime-syntax @@ -41,4 +41,4 @@ contexts: pop: true optional-type-expression: - - include: Packages/Naomi/syntaxes/fjsx15/flow/optional-type-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow1/optional-type-expression.sublime-syntax diff --git a/syntaxes/flow/type-aliasing.sublime-syntax b/syntaxes/flow1/type-aliasing.sublime-syntax similarity index 85% rename from syntaxes/flow/type-aliasing.sublime-syntax rename to syntaxes/flow1/type-aliasing.sublime-syntax index b2d44f65..36862ee3 100644 --- a/syntaxes/flow/type-aliasing.sublime-syntax +++ b/syntaxes/flow1/type-aliasing.sublime-syntax @@ -61,8 +61,8 @@ contexts: punctuation: - meta_scope: meta.declaration.type.flow - - include: Packages/Naomi/syntaxes/fjsx15/flow/template/parameters.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flow/associated-type.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow1/template/parameters.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow1/associated-type.no-pop.sublime-syntax - match: \s*(=) captures: 1: keyword.operator.other.assignment.flow @@ -72,7 +72,7 @@ contexts: ] optional-type-expression: - - include: Packages/Naomi/syntaxes/fjsx15/flow/optional-type-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow1/optional-type-expression.sublime-syntax meta-scope: - meta_scope: meta.declaration.type.flow diff --git a/syntaxes/flow/type-expression.sublime-syntax b/syntaxes/flow1/type-expression.sublime-syntax similarity index 74% rename from syntaxes/flow/type-expression.sublime-syntax rename to syntaxes/flow1/type-expression.sublime-syntax index a38ae70f..8bcd8e58 100644 --- a/syntaxes/flow/type-expression.sublime-syntax +++ b/syntaxes/flow1/type-expression.sublime-syntax @@ -25,9 +25,9 @@ contexts: main: - include: comment-no-pop # Functions need to be detected before expression groups. - - include: Packages/Naomi/syntaxes/fjsx15/flow/function.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow1/function.sublime-syntax # Detect operators as soon as possible. - - include: Packages/Naomi/syntaxes/fjsx15/flow/operator.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow1/operator.sublime-syntax # Open new type expression group. - match: "{{expressionGroupBegin}}" captures: @@ -43,12 +43,12 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax optional-type-expression: - - include: Packages/Naomi/syntaxes/fjsx15/flow/optional-type-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow1/optional-type-expression.sublime-syntax open-group: - include: comment-no-pop # Functions need to be detected before expression groups. - - include: Packages/Naomi/syntaxes/fjsx15/flow/function.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow1/function.no-pop.sublime-syntax # Open new type expression group. - match: "{{expressionGroupBegin}}" captures: @@ -72,14 +72,14 @@ contexts: head: - include: comment-no-pop - - include: Packages/Naomi/syntaxes/fjsx15/flow/function.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flow/object.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flow/tuple.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow1/function.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow1/object.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow1/tuple.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/literal/number.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/literal/string/template.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flow/simple.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow1/simple.sublime-syntax optional-tail: - include: comment-no-pop @@ -87,12 +87,12 @@ contexts: - match: (?=\s*[\[<]) set: [ optional-tail, tail ] # Other operators. - - include: Packages/Naomi/syntaxes/fjsx15/flow/operator.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow1/operator.sublime-syntax # Anything else not expected. - match: (?=\s*\S) pop: true tail: - include: comment-no-pop - - include: Packages/Naomi/syntaxes/fjsx15/flow/operator/array-shorthand.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flow/template/arguments.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow1/operator/array-shorthand.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/flow1/template/arguments.sublime-syntax From 143cd35cd9dbfd756ac97966c1de4cb4ed557db4 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 25 Dec 2017 16:44:52 -0200 Subject: [PATCH 285/407] [FJSX15] Add computed key meta scope --- .../literal/object/property.sublime-syntax | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/syntaxes/fjsx15/literal/object/property.sublime-syntax b/syntaxes/fjsx15/literal/object/property.sublime-syntax index 3a18188b..f9e87a7e 100644 --- a/syntaxes/fjsx15/literal/object/property.sublime-syntax +++ b/syntaxes/fjsx15/literal/object/property.sublime-syntax @@ -152,7 +152,7 @@ contexts: 1: punctuation.definition.object.computed-property.begin.js.fjsx15 set: [ associated-value, - key-meta-scope, + computed-key-meta-scope, computed-property-end, optional-expression ] @@ -167,11 +167,20 @@ contexts: - include: constant - include: variable - key-meta-scope: - - meta_scope: meta.object-literal.key.js.fjsx15 + escape: - match: "" pop: true + key-meta-scope: + - meta_scope: meta.object-literal.key.js.fjsx15 + - include: escape + + computed-key-meta-scope: + - meta_scope: >- + meta.object-literal.key.js.fjsx15 + meta.object-literal.key.computed.js.fjsx15 + - include: escape + method-identifier: - match: | (?xi) @@ -210,7 +219,7 @@ contexts: captures: 1: >- meta.object-literal.key.js.fjsx15 - entity.name.constant.js.fjsx15 + variable.other.constant.js.fjsx15 set: associated-value # Two or more characters. - match: | @@ -224,7 +233,7 @@ contexts: captures: 1: >- meta.object-literal.key.js.fjsx15 - entity.name.constant.js.fjsx15 + variable.other.constant.js.fjsx15 set: associated-value variable: @@ -237,7 +246,7 @@ contexts: captures: 1: >- meta.object-literal.key.js.fjsx15 - entity.name.variable.js.fjsx15 + variable.other.readwrite.js.fjsx15 set: associated-value # Two or more characters. - match: | @@ -251,7 +260,7 @@ contexts: captures: 1: >- meta.object-literal.key.js.fjsx15 - entity.name.variable.js.fjsx15 + variable.other.readwrite.js.fjsx15 set: associated-value optional-expression: From 4a27edf23ccf63cb69ec5566a6715dd4d180e52d Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 25 Dec 2017 16:45:16 -0200 Subject: [PATCH 286/407] [FJSX15] Normalize JSX scopes --- syntaxes/fjsx15/jsx1.sublime-syntax | 42 ++++------- syntaxes/jsx1/attribute.sublime-syntax | 18 +++-- syntaxes/jsx1/component.sublime-syntax | 97 +++++++++++++------------- syntaxes/jsx1/element.sublime-syntax | 83 ++++++++++++---------- syntaxes/jsx1/fragment.sublime-syntax | 12 ++-- 5 files changed, 125 insertions(+), 127 deletions(-) diff --git a/syntaxes/fjsx15/jsx1.sublime-syntax b/syntaxes/fjsx15/jsx1.sublime-syntax index 77fca43b..b0c65e0e 100644 --- a/syntaxes/fjsx15/jsx1.sublime-syntax +++ b/syntaxes/fjsx15/jsx1.sublime-syntax @@ -32,44 +32,32 @@ contexts: - match: \s*(\{\s*/\*)(.*)(\*/\s*}) captures: 1: >- - source.jsx - comment.block.js.fjsx15 - punctuation.definition.comment.begin.js.fjsx15 - 2: >- - source.jsx - comment.block.js.fjsx15 + comment.block.jsx.jsx1 + punctuation.definition.comment.begin.jsx.jsx1 + 2: comment.block.jsx.jsx1 3: >- - source.jsx - comment.block.js.fjsx15 - punctuation.definition.comment.end.js.fjsx15 + comment.block.jsx.jsx1 + punctuation.definition.comment.end.jsx.jsx1 # Embedded javascript. - match: \s*(\{) captures: - 1: >- - source.jsx.jsx1 - keyword.operator.other.embedded.js.begin.jsx.jsx1 - push: embedded-js + 1: keyword.operator.other.embedded.js.begin.jsx.jsx1 + push: [ + embedded-js-close, + optional-expression + ] set: jsx jsx: - - clear_scopes: true - include: Packages/Naomi/syntaxes/jsx1/fragment.sublime-syntax - include: Packages/Naomi/syntaxes/jsx1/component.sublime-syntax - include: Packages/Naomi/syntaxes/jsx1/element.sublime-syntax - embedded-js: - - clear_scopes: true - - meta_content_scope: source.js.fjsx15 - - match: (\s*)(})(\n*) + embedded-js-close: + - match: \s*(}) captures: - 1: source.js.fjsx15 - 2: >- - source.jsx.jsx1 - keyword.operator.other.embedded.js.end.jsx.jsx1 - 3: source.jsx.jsx1 + 1: keyword.operator.other.embedded.js.end.jsx.jsx1 pop: true - - match: "" - push: optional-statements-and-expressions - optional-statements-and-expressions: - - include: Packages/Naomi/syntaxes/fjsx15/optional-statements-and-expressions.sublime-syntax + optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/jsx1/attribute.sublime-syntax b/syntaxes/jsx1/attribute.sublime-syntax index cd344ed6..c0978b1e 100644 --- a/syntaxes/jsx1/attribute.sublime-syntax +++ b/syntaxes/jsx1/attribute.sublime-syntax @@ -18,7 +18,7 @@ hidden: true scope: ... variables: - commonIdentifier: | + attributeIdentifier: | [_[:alpha:]] [._\-[:alnum:]]* @@ -26,25 +26,29 @@ contexts: main: - match: | (?xi)\s* - ({{commonIdentifier}}) + ({{attributeIdentifier}}) captures: 1: entity.other.attribute-name.jsx.jsx1 set: optional-value + escape: + - match: (?=\s*\S) + pop: true + optional-value: # Normal value. - match: \s*(=) captures: - 1: keyword.operator.other.assignment.jsx.jsx1 + 1: punctuation.separator.key-value.jsx.jsx1 set: value # Anything else. - - match: "" - pop: true + - include: escape value: + - include: Packages/Naomi/syntaxes/jsx1/fragment.sublime-syntax - include: Packages/Naomi/syntaxes/jsx1/component.sublime-syntax - include: Packages/Naomi/syntaxes/jsx1/element.sublime-syntax - include: Packages/Naomi/syntaxes/jsx1/literal/string/double-quoted.sublime-syntax - include: Packages/Naomi/syntaxes/jsx1/literal/string/single-quoted.sublime-syntax - - match: "" - pop: true + # Anything else. + - include: escape diff --git a/syntaxes/jsx1/component.sublime-syntax b/syntaxes/jsx1/component.sublime-syntax index 58724a1e..5cb7ebb8 100644 --- a/syntaxes/jsx1/component.sublime-syntax +++ b/syntaxes/jsx1/component.sublime-syntax @@ -22,6 +22,10 @@ variables: [[:upper:]] [$_.:[:alnum:]]* + attributeIdentifier: | + [_[:alpha:]] + [._\-[:alnum:]]* + contexts: main: - match: | @@ -29,70 +33,63 @@ contexts: (<) ({{componentIdentifier}}) captures: - 1: >- - component.jsx.jsx1 - punctuation.definition.tag.begin.jsx.jsx1 - 2: >- - component.jsx.jsx1 - entity.name.tag.jsx.jsx1 + 1: punctuation.definition.tag.begin.jsx.jsx1 + 2: entity.name.tag.component.jsx.jsx1 set: [ - content, - attributes + meta-scope, + closing-tag, + open-tag, + optional-attribute ] - attributes: - # Self closing tag. - - match: (?=\s*/>) + meta-scope: + - meta_scope: meta.tag.component.jsx.jsx1 + - match: "" pop: true - # Normal tag. - - match: \s*(>) - captures: - 1: >- - component.jsx.jsx1 - punctuation.definition.tag.end.jsx.jsx1 + + escape: + - match: (?=\s*\S) pop: true - # Attributes. - - match: "" - push: - - include: Packages/Naomi/syntaxes/jsx1/attribute.sublime-syntax - - match: "" - pop: true - content: - - clear_scopes: true - - meta_scope: source.jsx.jsx1 - # Self closing tag. - - match: \s*(/>) + attribute: + - include: Packages/Naomi/syntaxes/jsx1/attribute.sublime-syntax + + optional-attribute: + - include: attribute + - include: escape + + open-tag: + # Normal or self closing tag. + - match: \s*(/?>) captures: - 1: >- - source.jsx.fjsx15 - component.jsx.jsx1 - punctuation.definition.tag.end.jsx.jsx1 + 1: punctuation.definition.tag.end.jsx.jsx1 + pop: true + # Attribute. + - match: | + (?xi) + (?=\s*{{attributeIdentifier}}) + push: attribute + + closing-tag: + # It was a self closing tag. + - match: (?<=/>) pop: true # Closing tag. - match: | (?x)\s* - () + (()) captures: - 1: >- - component.jsx.jsx1 - punctuation.definition.tag.begin.jsx.jsx1 - 2: >- - component.jsx.jsx1 - entity.name.tag.jsx.jsx1 - 3: >- - component.jsx.jsx1 - punctuation.definition.tag.end.jsx.jsx1 + 1: meta.tag.close.jsx.jsx1 + 2: punctuation.definition.tag.begin.jsx.jsx1 + 3: entity.name.tag.component.jsx.jsx1 + 4: punctuation.definition.tag.end.jsx.jsx1 pop: true - # Sub tags. - - match: "" + # Other content. + - match: (?=\s*\S) push: - - clear_scopes: true + - include: Packages/Naomi/syntaxes/jsx1/fragment.sublime-syntax - include: main - include: Packages/Naomi/syntaxes/jsx1/element.sublime-syntax - - match: | - (?x) - (?=\s*(?>/>|<)) + - match: . + scope: text.jsx pop: true - - match: .|\n - scope: source.jsx diff --git a/syntaxes/jsx1/element.sublime-syntax b/syntaxes/jsx1/element.sublime-syntax index 041ef079..df2b6189 100644 --- a/syntaxes/jsx1/element.sublime-syntax +++ b/syntaxes/jsx1/element.sublime-syntax @@ -18,66 +18,79 @@ hidden: true scope: ... variables: - commonIdentifier: | + elementIdentifier: | [$_[:alpha:]] [$_.:[:alnum:]]* + attributeIdentifier: | + [_[:alpha:]] + [._\-[:alnum:]]* + contexts: main: - match: | - (?xi)\s* + (?x)\s* (<) - ({{commonIdentifier}}) + ({{elementIdentifier}}) captures: 1: punctuation.definition.tag.begin.jsx.jsx1 2: entity.name.tag.jsx.jsx1 set: [ - content, - attributes + meta-scope, + closing-tag, + open-tag, + optional-attribute ] - attributes: - # Self closing tag. - - match: (?=\s*/>) + meta-scope: + - meta_scope: meta.tag.other.jsx.jsx1 + - match: "" pop: true - # Normal tag. - - match: \s*(>) - captures: - 1: punctuation.definition.tag.end.jsx.jsx1 + + escape: + - match: (?=\s*\S) pop: true - # Attributes. - - match: "" - push: - - include: Packages/Naomi/syntaxes/jsx1/attribute.sublime-syntax - - match: "" - pop: true - content: - - clear_scopes: true - - meta_scope: source.jsx.jsx1 - # Self closing tag. - - match: \s*(/>) + attribute: + - include: Packages/Naomi/syntaxes/jsx1/attribute.sublime-syntax + + optional-attribute: + - include: attribute + - include: escape + + open-tag: + # Normal or self closing tag. + - match: \s*(/?>) captures: 1: punctuation.definition.tag.end.jsx.jsx1 pop: true + # Attribute. + - match: | + (?xi) + (?=\s*{{attributeIdentifier}}) + push: attribute + + closing-tag: + # It was a self closing tag. + - match: (?<=/>) + pop: true # Closing tag. - match: | (?x)\s* - () + (()) captures: - 1: punctuation.definition.tag.begin.jsx.jsx1 - 2: entity.name.tag.jsx.jsx1 - 3: punctuation.definition.tag.end.jsx.jsx1 + 1: meta.tag.close.jsx.jsx1 + 2: punctuation.definition.tag.begin.jsx.jsx1 + 3: entity.name.tag.jsx.jsx1 + 4: punctuation.definition.tag.end.jsx.jsx1 pop: true - # Sub tags. - - match: "" + # Other content. + - match: (?=\s*\S) push: - - clear_scopes: true + - include: Packages/Naomi/syntaxes/jsx1/fragment.sublime-syntax - include: Packages/Naomi/syntaxes/jsx1/component.sublime-syntax - include: main - - match: | - (?x) - (?=\s*(?>/>|<)) + # Simple text. + - match: . + scope: text.jsx pop: true - - match: .|\n - scope: source.jsx diff --git a/syntaxes/jsx1/fragment.sublime-syntax b/syntaxes/jsx1/fragment.sublime-syntax index c87a2b5d..87734340 100644 --- a/syntaxes/jsx1/fragment.sublime-syntax +++ b/syntaxes/jsx1/fragment.sublime-syntax @@ -31,18 +31,16 @@ contexts: set: content content: - - clear_scopes: true - - meta_scope: source.jsx.jsx1 # Closing tag. - - match: \s*() + - match: \s*(()) captures: - 1: punctuation.definition.tag.begin.jsx.jsx1 - 2: punctuation.definition.tag.end.jsx.jsx1 + 1: meta.tag.close.jsx.jsx1 + 2: punctuation.definition.tag.begin.jsx.jsx1 + 3: punctuation.definition.tag.end.jsx.jsx1 pop: true # Sub tags. - match: "" push: - - clear_scopes: true - include: main - include: Packages/Naomi/syntaxes/jsx1/component.sublime-syntax - include: Packages/Naomi/syntaxes/jsx1/element.sublime-syntax @@ -50,5 +48,3 @@ contexts: (?x) (?=\s*<) pop: true - - match: .|\n - scope: source.jsx From bdc74ad8097fe29b19b3299bdb8803d86aff14c7 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 25 Dec 2017 16:47:34 -0200 Subject: [PATCH 287/407] [FJSX15] Fix JSX closing tag --- Default.sublime-keymap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Default.sublime-keymap b/Default.sublime-keymap index 15491f4c..419aaca4 100644 --- a/Default.sublime-keymap +++ b/Default.sublime-keymap @@ -142,7 +142,7 @@ },{ "key": "selector", "operator": "equal", - "operand": "source.jsx - string - comment", + "operand": "source.js meta.tag - string - comment", "match_all": true },{ "key": "selector", From 71be9735448413bde15326d41fd6628be1fc6ba2 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 25 Dec 2017 17:55:57 -0200 Subject: [PATCH 288/407] [FJSX15] Add attribute with value meta scope --- syntaxes/jsx1/attribute.sublime-syntax | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/syntaxes/jsx1/attribute.sublime-syntax b/syntaxes/jsx1/attribute.sublime-syntax index c0978b1e..2c76ae6c 100644 --- a/syntaxes/jsx1/attribute.sublime-syntax +++ b/syntaxes/jsx1/attribute.sublime-syntax @@ -24,18 +24,28 @@ variables: contexts: main: + # Attribute with value. - match: | (?xi)\s* ({{attributeIdentifier}}) + (?=\s*=) captures: 1: entity.other.attribute-name.jsx.jsx1 set: optional-value + # Simple attribute. + - match: | + (?xi)\s* + ({{attributeIdentifier}}) + captures: + 1: entity.other.attribute-name.jsx.jsx1 + pop: true escape: - match: (?=\s*\S) pop: true optional-value: + - meta_scope: meta.attribute-with-value.jsx.jsx1 # Normal value. - match: \s*(=) captures: From a0b99c7a4c6ad5c87ecc5a341b2da56b70d6ef75 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 25 Dec 2017 17:56:51 -0200 Subject: [PATCH 289/407] [FJSX15] Expand JSX meta scopes --- syntaxes/jsx1/component.sublime-syntax | 20 ++++---- syntaxes/jsx1/element.sublime-syntax | 63 +++++++++++++++++++++----- syntaxes/jsx1/fragment.sublime-syntax | 27 ++++++++--- 3 files changed, 81 insertions(+), 29 deletions(-) diff --git a/syntaxes/jsx1/component.sublime-syntax b/syntaxes/jsx1/component.sublime-syntax index 5cb7ebb8..85292bef 100644 --- a/syntaxes/jsx1/component.sublime-syntax +++ b/syntaxes/jsx1/component.sublime-syntax @@ -29,9 +29,9 @@ variables: contexts: main: - match: | - (?x)\s* - (<) - ({{componentIdentifier}}) + (?x) + \s*(<) + \s*({{componentIdentifier}}) captures: 1: punctuation.definition.tag.begin.jsx.jsx1 2: entity.name.tag.component.jsx.jsx1 @@ -43,20 +43,19 @@ contexts: ] meta-scope: - - meta_scope: meta.tag.component.jsx.jsx1 + - meta_scope: >- + text.html.basic.jsx.jsx1 + meta.tag.other.component.jsx.jsx1 - match: "" pop: true - escape: - - match: (?=\s*\S) - pop: true - attribute: - include: Packages/Naomi/syntaxes/jsx1/attribute.sublime-syntax optional-attribute: - include: attribute - - include: escape + - match: (?=\s*\S) + pop: true open-tag: # Normal or self closing tag. @@ -72,7 +71,7 @@ contexts: closing-tag: # It was a self closing tag. - - match: (?<=/>) + - match: (?<=[^<]/>) pop: true # Closing tag. - match: | @@ -91,5 +90,4 @@ contexts: - include: main - include: Packages/Naomi/syntaxes/jsx1/element.sublime-syntax - match: . - scope: text.jsx pop: true diff --git a/syntaxes/jsx1/element.sublime-syntax b/syntaxes/jsx1/element.sublime-syntax index df2b6189..93e9ca77 100644 --- a/syntaxes/jsx1/element.sublime-syntax +++ b/syntaxes/jsx1/element.sublime-syntax @@ -28,27 +28,68 @@ variables: contexts: main: + # html, head, body. - match: | - (?x)\s* - (<) - ({{elementIdentifier}}) + (?x) + \s*(<) + \s*(body|head|html)\b + captures: + 1: punctuation.definition.tag.begin.jsx.jsx1 + 2: entity.name.tag.structure.jsx.jsx1 + set: [ + meta-scope-structure, + closing-tag, + open-tag, + optional-attribute + ] + # a. + - match: | + (?x) + \s*(<) + \s*(a)\b + captures: + 1: punctuation.definition.tag.begin.jsx.jsx1 + 2: entity.name.tag.a.jsx.jsx1 + set: [ + meta-scope-a, + closing-tag, + open-tag, + optional-attribute + ] + # Other tags. + - match: | + (?x) + \s*(<) + \s*({{elementIdentifier}}) captures: 1: punctuation.definition.tag.begin.jsx.jsx1 2: entity.name.tag.jsx.jsx1 set: [ - meta-scope, + meta-scope-other, closing-tag, open-tag, optional-attribute ] - meta-scope: - - meta_scope: meta.tag.other.jsx.jsx1 + meta-scope-structure: + - meta_scope: >- + text.html.basic.jsx.jsx1 + meta.tag.structure.jsx.jsx1 - match: "" pop: true - escape: - - match: (?=\s*\S) + meta-scope-a: + - meta_scope: >- + text.html.basic.jsx.jsx1 + meta.tag.inline.a.jsx.jsx1 + - match: "" + pop: true + + meta-scope-other: + - meta_scope: >- + text.html.basic.jsx.jsx1 + meta.tag.other.jsx.jsx1 + - match: "" pop: true attribute: @@ -56,7 +97,8 @@ contexts: optional-attribute: - include: attribute - - include: escape + - match: (?=\s*\S) + pop: true open-tag: # Normal or self closing tag. @@ -72,7 +114,7 @@ contexts: closing-tag: # It was a self closing tag. - - match: (?<=/>) + - match: (?<=[^<]/>) pop: true # Closing tag. - match: | @@ -92,5 +134,4 @@ contexts: - include: main # Simple text. - match: . - scope: text.jsx pop: true diff --git a/syntaxes/jsx1/fragment.sublime-syntax b/syntaxes/jsx1/fragment.sublime-syntax index 87734340..2023dc10 100644 --- a/syntaxes/jsx1/fragment.sublime-syntax +++ b/syntaxes/jsx1/fragment.sublime-syntax @@ -28,9 +28,22 @@ contexts: captures: 1: punctuation.definition.tag.begin.jsx.jsx1 2: punctuation.definition.tag.end.jsx.jsx1 - set: content + set: [ + meta-scope, + closing-tag + ] - content: + meta-scope: + - meta_scope: >- + text.html.basic.jsx.jsx1 + meta.tag.other.fragment.jsx.jsx1 + - match: "" + pop: true + + closing-tag: + # It was a self closing tag. + - match: (?<=[^<]/>) + pop: true # Closing tag. - match: \s*(()) captures: @@ -38,13 +51,13 @@ contexts: 2: punctuation.definition.tag.begin.jsx.jsx1 3: punctuation.definition.tag.end.jsx.jsx1 pop: true - # Sub tags. - - match: "" + # Other content. + - match: (?=\s*\S) push: - include: main - include: Packages/Naomi/syntaxes/jsx1/component.sublime-syntax - include: Packages/Naomi/syntaxes/jsx1/element.sublime-syntax - - match: | - (?x) - (?=\s*<) + # Simple text. + - match: . pop: true + From abaea0f4e869d18713b59c1ef909b33a17191aaf Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 25 Dec 2017 23:09:51 -0200 Subject: [PATCH 290/407] [FJSX15] Add import.meta --- syntaxes/fjsx15/core.sublime-syntax | 11 +++++++++++ syntaxes/fjsx15/import.sublime-syntax | 1 + 2 files changed, 12 insertions(+) diff --git a/syntaxes/fjsx15/core.sublime-syntax b/syntaxes/fjsx15/core.sublime-syntax index b5ceada3..1fb50906 100644 --- a/syntaxes/fjsx15/core.sublime-syntax +++ b/syntaxes/fjsx15/core.sublime-syntax @@ -30,6 +30,7 @@ contexts: - include: constants - include: variables - include: functions + - include: import-properties - include: fundamental-objects - include: numbers-and-dates - include: text-processing @@ -256,6 +257,16 @@ contexts: 3: support.variable.js.fjsx15 pop: true + import-properties: + - match: | + (?x)\s* + (import)(.)(meta)\b + captures: + 1: support.type.object.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.type.object.js.fjsx15 + pop: true + fundamental-objects: - match: | (?x)\s* diff --git a/syntaxes/fjsx15/import.sublime-syntax b/syntaxes/fjsx15/import.sublime-syntax index 24482bef..3c2bb60b 100644 --- a/syntaxes/fjsx15/import.sublime-syntax +++ b/syntaxes/fjsx15/import.sublime-syntax @@ -31,6 +31,7 @@ variables: contexts: main: + - include: Packages/Naomi/syntaxes/fjsx15/core.sublime-syntax#import-properties # Dynamic import. - match: | (?x)\s* From f4959212a867dc28dd608246762b223d107b11ce Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 25 Dec 2017 23:38:47 -0200 Subject: [PATCH 291/407] [FJSX15] Add HTML suffix to enhance color scheme compatibility --- syntaxes/jsx1/attribute.sublime-syntax | 8 ++++---- syntaxes/jsx1/component.sublime-syntax | 16 +++++++-------- syntaxes/jsx1/element.sublime-syntax | 28 +++++++++++++------------- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/syntaxes/jsx1/attribute.sublime-syntax b/syntaxes/jsx1/attribute.sublime-syntax index 2c76ae6c..3715fb67 100644 --- a/syntaxes/jsx1/attribute.sublime-syntax +++ b/syntaxes/jsx1/attribute.sublime-syntax @@ -30,14 +30,14 @@ contexts: ({{attributeIdentifier}}) (?=\s*=) captures: - 1: entity.other.attribute-name.jsx.jsx1 + 1: entity.other.attribute-name.html.jsx.jsx1 set: optional-value # Simple attribute. - match: | (?xi)\s* ({{attributeIdentifier}}) captures: - 1: entity.other.attribute-name.jsx.jsx1 + 1: entity.other.attribute-name.html.jsx.jsx1 pop: true escape: @@ -45,11 +45,11 @@ contexts: pop: true optional-value: - - meta_scope: meta.attribute-with-value.jsx.jsx1 + - meta_scope: meta.attribute-with-value.html.jsx.jsx1 # Normal value. - match: \s*(=) captures: - 1: punctuation.separator.key-value.jsx.jsx1 + 1: punctuation.separator.key-value.html.jsx.jsx1 set: value # Anything else. - include: escape diff --git a/syntaxes/jsx1/component.sublime-syntax b/syntaxes/jsx1/component.sublime-syntax index 85292bef..fedf8216 100644 --- a/syntaxes/jsx1/component.sublime-syntax +++ b/syntaxes/jsx1/component.sublime-syntax @@ -33,8 +33,8 @@ contexts: \s*(<) \s*({{componentIdentifier}}) captures: - 1: punctuation.definition.tag.begin.jsx.jsx1 - 2: entity.name.tag.component.jsx.jsx1 + 1: punctuation.definition.tag.begin.html.jsx.jsx1 + 2: entity.name.tag.component.html.jsx.jsx1 set: [ meta-scope, closing-tag, @@ -45,7 +45,7 @@ contexts: meta-scope: - meta_scope: >- text.html.basic.jsx.jsx1 - meta.tag.other.component.jsx.jsx1 + meta.tag.other.component.html.jsx.jsx1 - match: "" pop: true @@ -61,7 +61,7 @@ contexts: # Normal or self closing tag. - match: \s*(/?>) captures: - 1: punctuation.definition.tag.end.jsx.jsx1 + 1: punctuation.definition.tag.end.html.jsx.jsx1 pop: true # Attribute. - match: | @@ -78,10 +78,10 @@ contexts: (?x)\s* (()) captures: - 1: meta.tag.close.jsx.jsx1 - 2: punctuation.definition.tag.begin.jsx.jsx1 - 3: entity.name.tag.component.jsx.jsx1 - 4: punctuation.definition.tag.end.jsx.jsx1 + 1: meta.tag.close.html.jsx.jsx1 + 2: punctuation.definition.tag.begin.html.jsx.jsx1 + 3: entity.name.tag.component.html.jsx.jsx1 + 4: punctuation.definition.tag.end.html.jsx.jsx1 pop: true # Other content. - match: (?=\s*\S) diff --git a/syntaxes/jsx1/element.sublime-syntax b/syntaxes/jsx1/element.sublime-syntax index 93e9ca77..9da8287f 100644 --- a/syntaxes/jsx1/element.sublime-syntax +++ b/syntaxes/jsx1/element.sublime-syntax @@ -34,8 +34,8 @@ contexts: \s*(<) \s*(body|head|html)\b captures: - 1: punctuation.definition.tag.begin.jsx.jsx1 - 2: entity.name.tag.structure.jsx.jsx1 + 1: punctuation.definition.tag.begin.html.jsx.jsx1 + 2: entity.name.tag.structure.html.jsx.jsx1 set: [ meta-scope-structure, closing-tag, @@ -48,8 +48,8 @@ contexts: \s*(<) \s*(a)\b captures: - 1: punctuation.definition.tag.begin.jsx.jsx1 - 2: entity.name.tag.a.jsx.jsx1 + 1: punctuation.definition.tag.begin.html.jsx.jsx1 + 2: entity.name.tag.a.html.jsx.jsx1 set: [ meta-scope-a, closing-tag, @@ -62,8 +62,8 @@ contexts: \s*(<) \s*({{elementIdentifier}}) captures: - 1: punctuation.definition.tag.begin.jsx.jsx1 - 2: entity.name.tag.jsx.jsx1 + 1: punctuation.definition.tag.begin.html.jsx.jsx1 + 2: entity.name.tag.html.jsx.jsx1 set: [ meta-scope-other, closing-tag, @@ -74,21 +74,21 @@ contexts: meta-scope-structure: - meta_scope: >- text.html.basic.jsx.jsx1 - meta.tag.structure.jsx.jsx1 + meta.tag.structure.html.jsx.jsx1 - match: "" pop: true meta-scope-a: - meta_scope: >- text.html.basic.jsx.jsx1 - meta.tag.inline.a.jsx.jsx1 + meta.tag.inline.a.html.jsx.jsx1 - match: "" pop: true meta-scope-other: - meta_scope: >- text.html.basic.jsx.jsx1 - meta.tag.other.jsx.jsx1 + meta.tag.other.html.jsx.jsx1 - match: "" pop: true @@ -104,7 +104,7 @@ contexts: # Normal or self closing tag. - match: \s*(/?>) captures: - 1: punctuation.definition.tag.end.jsx.jsx1 + 1: punctuation.definition.tag.end.html.jsx.jsx1 pop: true # Attribute. - match: | @@ -121,10 +121,10 @@ contexts: (?x)\s* (()) captures: - 1: meta.tag.close.jsx.jsx1 - 2: punctuation.definition.tag.begin.jsx.jsx1 - 3: entity.name.tag.jsx.jsx1 - 4: punctuation.definition.tag.end.jsx.jsx1 + 1: meta.tag.close.html.jsx.jsx1 + 2: punctuation.definition.tag.begin.html.jsx.jsx1 + 3: entity.name.tag.html.jsx.jsx1 + 4: punctuation.definition.tag.end.html.jsx.jsx1 pop: true # Other content. - match: (?=\s*\S) From 0e42c5f66aa1774d5cb9a99ad4ed62294025f467 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 25 Dec 2017 23:51:07 -0200 Subject: [PATCH 292/407] [FJSX15] Fix flow references --- .../associated-type.no-pop.sublime-syntax | 2 +- syntaxes/flow1/associated-type.sublime-syntax | 2 +- syntaxes/flow1/cast.sublime-syntax | 2 +- syntaxes/flow1/declare.sublime-syntax | 2 +- syntaxes/flow1/function.no-pop.sublime-syntax | 2 +- syntaxes/flow1/function.sublime-syntax | 6 ++--- .../flow1/function/parameters.sublime-syntax | 4 ++-- .../function/parameters/simple.sublime-syntax | 2 +- syntaxes/flow1/indexer.sublime-syntax | 6 ++--- syntaxes/flow1/interface.sublime-syntax | 10 ++++----- syntaxes/flow1/object.sublime-syntax | 2 +- syntaxes/flow1/operator.sublime-syntax | 6 ++--- .../operator/intersection.sublime-syntax | 2 +- .../flow1/operator/nullable.sublime-syntax | 2 +- syntaxes/flow1/operator/union.sublime-syntax | 2 +- .../optional-associated-type.sublime-syntax | 2 +- .../optional-modifier.no-pop.sublime-syntax | 2 +- .../optional-type-expression.sublime-syntax | 2 +- syntaxes/flow1/simple.sublime-syntax | 2 +- .../template/arguments.no-pop.sublime-syntax | 2 +- .../flow1/template/arguments.sublime-syntax | 2 +- .../template/parameters.no-pop.sublime-syntax | 2 +- .../flow1/template/parameters.sublime-syntax | 2 +- syntaxes/flow1/tuple.sublime-syntax | 2 +- syntaxes/flow1/type-aliasing.sublime-syntax | 6 ++--- syntaxes/flow1/type-expression.sublime-syntax | 22 +++++++++---------- 26 files changed, 49 insertions(+), 49 deletions(-) diff --git a/syntaxes/flow1/associated-type.no-pop.sublime-syntax b/syntaxes/flow1/associated-type.no-pop.sublime-syntax index c620b52e..5bed4a82 100644 --- a/syntaxes/flow1/associated-type.no-pop.sublime-syntax +++ b/syntaxes/flow1/associated-type.no-pop.sublime-syntax @@ -23,4 +23,4 @@ contexts: push: associated-type associated-type: - - include: Packages/Naomi/syntaxes/fjsx15/flow1/associated-type.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/associated-type.sublime-syntax diff --git a/syntaxes/flow1/associated-type.sublime-syntax b/syntaxes/flow1/associated-type.sublime-syntax index d9c1b0cc..748bb404 100644 --- a/syntaxes/flow1/associated-type.sublime-syntax +++ b/syntaxes/flow1/associated-type.sublime-syntax @@ -27,4 +27,4 @@ contexts: set: optional-type-expression optional-type-expression: - - include: Packages/Naomi/syntaxes/fjsx15/flow1/optional-type-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/optional-type-expression.sublime-syntax diff --git a/syntaxes/flow1/cast.sublime-syntax b/syntaxes/flow1/cast.sublime-syntax index c537ed8f..e53d1e4f 100644 --- a/syntaxes/flow1/cast.sublime-syntax +++ b/syntaxes/flow1/cast.sublime-syntax @@ -29,4 +29,4 @@ contexts: set: optional-type-expression optional-type-expression: - - include: Packages/Naomi/syntaxes/fjsx15/flow1/optional-type-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/optional-type-expression.sublime-syntax diff --git a/syntaxes/flow1/declare.sublime-syntax b/syntaxes/flow1/declare.sublime-syntax index 04e7fef3..003cdd59 100644 --- a/syntaxes/flow1/declare.sublime-syntax +++ b/syntaxes/flow1/declare.sublime-syntax @@ -27,6 +27,6 @@ contexts: set: possible-module possible-module: - - include: Packages/Naomi/syntaxes/fjsx15/flow1/module.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/module.sublime-syntax - match: (?=\s*\S) pop: true diff --git a/syntaxes/flow1/function.no-pop.sublime-syntax b/syntaxes/flow1/function.no-pop.sublime-syntax index cc611450..239489bf 100644 --- a/syntaxes/flow1/function.no-pop.sublime-syntax +++ b/syntaxes/flow1/function.no-pop.sublime-syntax @@ -47,4 +47,4 @@ contexts: push: declaration declaration: - - include: Packages/Naomi/syntaxes/fjsx15/flow1/function.sublime-syntax#declaration + - include: Packages/Naomi/syntaxes/flow1/function.sublime-syntax#declaration diff --git a/syntaxes/flow1/function.sublime-syntax b/syntaxes/flow1/function.sublime-syntax index 5b424ea7..f6f17f6d 100644 --- a/syntaxes/flow1/function.sublime-syntax +++ b/syntaxes/flow1/function.sublime-syntax @@ -58,10 +58,10 @@ contexts: ] template-arguments: - - include: Packages/Naomi/syntaxes/fjsx15/flow1/template/arguments.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/template/arguments.sublime-syntax parameters: - - include: Packages/Naomi/syntaxes/fjsx15/flow1/function/parameters.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/function/parameters.sublime-syntax return: - match: \s*(=>) @@ -72,5 +72,5 @@ contexts: set: optional-type-expression optional-type-expression: - - include: Packages/Naomi/syntaxes/fjsx15/flow1/optional-type-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/optional-type-expression.sublime-syntax diff --git a/syntaxes/flow1/function/parameters.sublime-syntax b/syntaxes/flow1/function/parameters.sublime-syntax index 6a0e3b24..03fa42f2 100644 --- a/syntaxes/flow1/function/parameters.sublime-syntax +++ b/syntaxes/flow1/function/parameters.sublime-syntax @@ -47,5 +47,5 @@ contexts: 1: >- flow keyword.operator.other.rest.flow - - include: Packages/Naomi/syntaxes/fjsx15/flow1/function/parameters/simple.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flow1/optional-type-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/function/parameters/simple.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/optional-type-expression.sublime-syntax diff --git a/syntaxes/flow1/function/parameters/simple.sublime-syntax b/syntaxes/flow1/function/parameters/simple.sublime-syntax index 82b1e8ce..8a521310 100644 --- a/syntaxes/flow1/function/parameters/simple.sublime-syntax +++ b/syntaxes/flow1/function/parameters/simple.sublime-syntax @@ -39,4 +39,4 @@ contexts: set: optional-associated-type optional-associated-type: - - include: Packages/Naomi/syntaxes/fjsx15/flow1/optional-associated-type.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/optional-associated-type.sublime-syntax diff --git a/syntaxes/flow1/indexer.sublime-syntax b/syntaxes/flow1/indexer.sublime-syntax index c9f5c41c..6c921930 100644 --- a/syntaxes/flow1/indexer.sublime-syntax +++ b/syntaxes/flow1/indexer.sublime-syntax @@ -40,10 +40,10 @@ contexts: set: optional-associated-type type-expression: - - include: Packages/Naomi/syntaxes/fjsx15/flow1/type-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/type-expression.sublime-syntax optional-associated-type: - - include: Packages/Naomi/syntaxes/fjsx15/flow1/optional-associated-type.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/optional-associated-type.sublime-syntax optional-name: - include: comment-no-pop @@ -76,7 +76,7 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/literal/string/template.sublime-syntax associated-type: - - include: Packages/Naomi/syntaxes/fjsx15/flow1/associated-type.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/associated-type.sublime-syntax comment-no-pop: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax diff --git a/syntaxes/flow1/interface.sublime-syntax b/syntaxes/flow1/interface.sublime-syntax index 1257fc55..0c575e3d 100644 --- a/syntaxes/flow1/interface.sublime-syntax +++ b/syntaxes/flow1/interface.sublime-syntax @@ -54,10 +54,10 @@ contexts: entity.name.interface.flow optional-type-expression: - - include: Packages/Naomi/syntaxes/fjsx15/flow1/optional-type-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/optional-type-expression.sublime-syntax template-parameters: - - include: Packages/Naomi/syntaxes/fjsx15/flow1/template/parameters.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/template/parameters.sublime-syntax body: - include: comment-no-pop @@ -88,9 +88,9 @@ contexts: - match: (?=\s*}) pop: true - include: comment-no-pop - - include: Packages/Naomi/syntaxes/fjsx15/flow1/operator/covariant.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flow1/operator/contravariant.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flow1/indexer.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/operator/covariant.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/operator/contravariant.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/indexer.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/class/method.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/class/property.sublime-syntax diff --git a/syntaxes/flow1/object.sublime-syntax b/syntaxes/flow1/object.sublime-syntax index da025d4a..78f3d87b 100644 --- a/syntaxes/flow1/object.sublime-syntax +++ b/syntaxes/flow1/object.sublime-syntax @@ -160,7 +160,7 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/literal/string/template.sublime-syntax associated-type: - - include: Packages/Naomi/syntaxes/fjsx15/flow1/associated-type.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/associated-type.sublime-syntax comment-no-pop: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax diff --git a/syntaxes/flow1/operator.sublime-syntax b/syntaxes/flow1/operator.sublime-syntax index 1bc35be3..d62a9755 100644 --- a/syntaxes/flow1/operator.sublime-syntax +++ b/syntaxes/flow1/operator.sublime-syntax @@ -19,6 +19,6 @@ scope: ... contexts: main: - - include: Packages/Naomi/syntaxes/fjsx15/flow1/operator/intersection.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flow1/operator/nullable.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flow1/operator/union.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/operator/intersection.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/operator/nullable.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/operator/union.sublime-syntax diff --git a/syntaxes/flow1/operator/intersection.sublime-syntax b/syntaxes/flow1/operator/intersection.sublime-syntax index afbcc4dc..728dc964 100644 --- a/syntaxes/flow1/operator/intersection.sublime-syntax +++ b/syntaxes/flow1/operator/intersection.sublime-syntax @@ -27,4 +27,4 @@ contexts: set: optional-type-expression optional-type-expression: - - include: Packages/Naomi/syntaxes/fjsx15/flow1/optional-type-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/optional-type-expression.sublime-syntax diff --git a/syntaxes/flow1/operator/nullable.sublime-syntax b/syntaxes/flow1/operator/nullable.sublime-syntax index ab7ae1a3..e4d264e2 100644 --- a/syntaxes/flow1/operator/nullable.sublime-syntax +++ b/syntaxes/flow1/operator/nullable.sublime-syntax @@ -27,4 +27,4 @@ contexts: set: optional-type-expression optional-type-expression: - - include: Packages/Naomi/syntaxes/fjsx15/flow1/optional-type-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/optional-type-expression.sublime-syntax diff --git a/syntaxes/flow1/operator/union.sublime-syntax b/syntaxes/flow1/operator/union.sublime-syntax index 4753b88f..cfc02054 100644 --- a/syntaxes/flow1/operator/union.sublime-syntax +++ b/syntaxes/flow1/operator/union.sublime-syntax @@ -27,4 +27,4 @@ contexts: set: optional-type-expression optional-type-expression: - - include: Packages/Naomi/syntaxes/fjsx15/flow1/optional-type-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/optional-type-expression.sublime-syntax diff --git a/syntaxes/flow1/optional-associated-type.sublime-syntax b/syntaxes/flow1/optional-associated-type.sublime-syntax index e8ef7904..ff57aa9a 100644 --- a/syntaxes/flow1/optional-associated-type.sublime-syntax +++ b/syntaxes/flow1/optional-associated-type.sublime-syntax @@ -25,4 +25,4 @@ contexts: pop: true associated-type: - - include: Packages/Naomi/syntaxes/fjsx15/flow1/associated-type.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/associated-type.sublime-syntax diff --git a/syntaxes/flow1/optional-modifier.no-pop.sublime-syntax b/syntaxes/flow1/optional-modifier.no-pop.sublime-syntax index 110604cb..92f4ffda 100644 --- a/syntaxes/flow1/optional-modifier.no-pop.sublime-syntax +++ b/syntaxes/flow1/optional-modifier.no-pop.sublime-syntax @@ -23,4 +23,4 @@ contexts: push: optional-modifier optional-modifier: - - include: Packages/Naomi/syntaxes/fjsx15/flow1/optional-modifier.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/optional-modifier.sublime-syntax diff --git a/syntaxes/flow1/optional-type-expression.sublime-syntax b/syntaxes/flow1/optional-type-expression.sublime-syntax index 2470ca09..7ea24d30 100644 --- a/syntaxes/flow1/optional-type-expression.sublime-syntax +++ b/syntaxes/flow1/optional-type-expression.sublime-syntax @@ -21,4 +21,4 @@ contexts: main: - match: (?=\s*[>,;:)\]}]) pop: true - - include: Packages/Naomi/syntaxes/fjsx15/flow1/type-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/type-expression.sublime-syntax diff --git a/syntaxes/flow1/simple.sublime-syntax b/syntaxes/flow1/simple.sublime-syntax index 5ac43206..3b5efa76 100644 --- a/syntaxes/flow1/simple.sublime-syntax +++ b/syntaxes/flow1/simple.sublime-syntax @@ -24,7 +24,7 @@ variables: contexts: main: - - include: Packages/Naomi/syntaxes/fjsx15/flow1/namespace-path.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/namespace-path.no-pop.sublime-syntax # Existential. - match: \s*(\*) captures: diff --git a/syntaxes/flow1/template/arguments.no-pop.sublime-syntax b/syntaxes/flow1/template/arguments.no-pop.sublime-syntax index 1748fb21..27f7cdc8 100644 --- a/syntaxes/flow1/template/arguments.no-pop.sublime-syntax +++ b/syntaxes/flow1/template/arguments.no-pop.sublime-syntax @@ -23,4 +23,4 @@ contexts: push: arguments arguments: - - include: Packages/Naomi/syntaxes/fjsx15/flow1/template/arguments.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/template/arguments.sublime-syntax diff --git a/syntaxes/flow1/template/arguments.sublime-syntax b/syntaxes/flow1/template/arguments.sublime-syntax index cdf04bd6..384b7b79 100644 --- a/syntaxes/flow1/template/arguments.sublime-syntax +++ b/syntaxes/flow1/template/arguments.sublime-syntax @@ -41,4 +41,4 @@ contexts: pop: true optional-type-expression: - - include: Packages/Naomi/syntaxes/fjsx15/flow1/optional-type-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/optional-type-expression.sublime-syntax diff --git a/syntaxes/flow1/template/parameters.no-pop.sublime-syntax b/syntaxes/flow1/template/parameters.no-pop.sublime-syntax index ee591111..489baec6 100644 --- a/syntaxes/flow1/template/parameters.no-pop.sublime-syntax +++ b/syntaxes/flow1/template/parameters.no-pop.sublime-syntax @@ -23,4 +23,4 @@ contexts: push: parameters parameters: - - include: Packages/Naomi/syntaxes/fjsx15/flow1/template/parameters.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/template/parameters.sublime-syntax diff --git a/syntaxes/flow1/template/parameters.sublime-syntax b/syntaxes/flow1/template/parameters.sublime-syntax index 229dbb88..83a63486 100644 --- a/syntaxes/flow1/template/parameters.sublime-syntax +++ b/syntaxes/flow1/template/parameters.sublime-syntax @@ -36,4 +36,4 @@ contexts: pop: true optional-type-expression: - - include: Packages/Naomi/syntaxes/fjsx15/flow1/optional-type-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/optional-type-expression.sublime-syntax diff --git a/syntaxes/flow1/tuple.sublime-syntax b/syntaxes/flow1/tuple.sublime-syntax index bf54fd4a..dae91a0f 100644 --- a/syntaxes/flow1/tuple.sublime-syntax +++ b/syntaxes/flow1/tuple.sublime-syntax @@ -41,4 +41,4 @@ contexts: pop: true optional-type-expression: - - include: Packages/Naomi/syntaxes/fjsx15/flow1/optional-type-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/optional-type-expression.sublime-syntax diff --git a/syntaxes/flow1/type-aliasing.sublime-syntax b/syntaxes/flow1/type-aliasing.sublime-syntax index 36862ee3..c3eae2b2 100644 --- a/syntaxes/flow1/type-aliasing.sublime-syntax +++ b/syntaxes/flow1/type-aliasing.sublime-syntax @@ -61,8 +61,8 @@ contexts: punctuation: - meta_scope: meta.declaration.type.flow - - include: Packages/Naomi/syntaxes/fjsx15/flow1/template/parameters.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flow1/associated-type.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/template/parameters.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/associated-type.no-pop.sublime-syntax - match: \s*(=) captures: 1: keyword.operator.other.assignment.flow @@ -72,7 +72,7 @@ contexts: ] optional-type-expression: - - include: Packages/Naomi/syntaxes/fjsx15/flow1/optional-type-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/optional-type-expression.sublime-syntax meta-scope: - meta_scope: meta.declaration.type.flow diff --git a/syntaxes/flow1/type-expression.sublime-syntax b/syntaxes/flow1/type-expression.sublime-syntax index 8bcd8e58..f64bd15d 100644 --- a/syntaxes/flow1/type-expression.sublime-syntax +++ b/syntaxes/flow1/type-expression.sublime-syntax @@ -25,9 +25,9 @@ contexts: main: - include: comment-no-pop # Functions need to be detected before expression groups. - - include: Packages/Naomi/syntaxes/fjsx15/flow1/function.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/function.sublime-syntax # Detect operators as soon as possible. - - include: Packages/Naomi/syntaxes/fjsx15/flow1/operator.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/operator.sublime-syntax # Open new type expression group. - match: "{{expressionGroupBegin}}" captures: @@ -43,12 +43,12 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax optional-type-expression: - - include: Packages/Naomi/syntaxes/fjsx15/flow1/optional-type-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/optional-type-expression.sublime-syntax open-group: - include: comment-no-pop # Functions need to be detected before expression groups. - - include: Packages/Naomi/syntaxes/fjsx15/flow1/function.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/function.no-pop.sublime-syntax # Open new type expression group. - match: "{{expressionGroupBegin}}" captures: @@ -72,14 +72,14 @@ contexts: head: - include: comment-no-pop - - include: Packages/Naomi/syntaxes/fjsx15/flow1/function.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flow1/object.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flow1/tuple.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/function.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/object.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/tuple.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/literal/number.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/literal/string/template.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flow1/simple.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/simple.sublime-syntax optional-tail: - include: comment-no-pop @@ -87,12 +87,12 @@ contexts: - match: (?=\s*[\[<]) set: [ optional-tail, tail ] # Other operators. - - include: Packages/Naomi/syntaxes/fjsx15/flow1/operator.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/operator.sublime-syntax # Anything else not expected. - match: (?=\s*\S) pop: true tail: - include: comment-no-pop - - include: Packages/Naomi/syntaxes/fjsx15/flow1/operator/array-shorthand.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flow1/template/arguments.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/operator/array-shorthand.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/template/arguments.sublime-syntax From 51808708087326d026b87c670cb36edaaebeb2e4 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Tue, 26 Dec 2017 00:25:40 -0200 Subject: [PATCH 293/407] [FJSX15] Add HTML suffix to jsx strings --- syntaxes/jsx1/literal/string/double-quoted.sublime-syntax | 6 +++--- syntaxes/jsx1/literal/string/single-quoted.sublime-syntax | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/syntaxes/jsx1/literal/string/double-quoted.sublime-syntax b/syntaxes/jsx1/literal/string/double-quoted.sublime-syntax index a91316ce..881fc97a 100644 --- a/syntaxes/jsx1/literal/string/double-quoted.sublime-syntax +++ b/syntaxes/jsx1/literal/string/double-quoted.sublime-syntax @@ -21,12 +21,12 @@ contexts: main: - match: \s*(\") captures: - 1: punctuation.definition.string.begin.jsx.jsx1 + 1: punctuation.definition.string.begin.html.html.jsx.jsx1 set: string string: - - meta_scope: string.quoted.double.jsx.jsx1 + - meta_scope: string.quoted.double.html.html.jsx.jsx1 - match: \s*(\") captures: - 1: punctuation.definition.string.end.jsx.jsx1 + 1: punctuation.definition.string.end.html.html.jsx.jsx1 pop: true diff --git a/syntaxes/jsx1/literal/string/single-quoted.sublime-syntax b/syntaxes/jsx1/literal/string/single-quoted.sublime-syntax index 9c876c82..e8590507 100644 --- a/syntaxes/jsx1/literal/string/single-quoted.sublime-syntax +++ b/syntaxes/jsx1/literal/string/single-quoted.sublime-syntax @@ -21,12 +21,12 @@ contexts: main: - match: \s*(\') captures: - 1: punctuation.definition.string.begin.jsx.jsx1 + 1: punctuation.definition.string.begin.html.jsx.jsx1 set: string string: - - meta_scope: string.quoted.single.jsx.jsx1 + - meta_scope: string.quoted.single.html.jsx.jsx1 - match: \s*(\') captures: - 1: punctuation.definition.string.end.jsx.jsx1 + 1: punctuation.definition.string.end.html.jsx.jsx1 pop: true From c32b0c8b16cda6bbf899374099c9b698a88ee6ea Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Tue, 26 Dec 2017 00:26:12 -0200 Subject: [PATCH 294/407] [FJSX15] Move flow comment file --- syntaxes/fjsx15/comment.sublime-syntax | 2 +- .../flowtype.sublime-syntax => flow1/comment.sublime-syntax} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename syntaxes/{fjsx15/comment/flowtype.sublime-syntax => flow1/comment.sublime-syntax} (100%) diff --git a/syntaxes/fjsx15/comment.sublime-syntax b/syntaxes/fjsx15/comment.sublime-syntax index dc510415..ea73980a 100644 --- a/syntaxes/fjsx15/comment.sublime-syntax +++ b/syntaxes/fjsx15/comment.sublime-syntax @@ -20,6 +20,6 @@ scope: ... contexts: main: - include: Packages/Naomi/syntaxes/flow1/prolog.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/comment.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/comment/eslint.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/comment/flow.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/comment/normal.sublime-syntax diff --git a/syntaxes/fjsx15/comment/flowtype.sublime-syntax b/syntaxes/flow1/comment.sublime-syntax similarity index 100% rename from syntaxes/fjsx15/comment/flowtype.sublime-syntax rename to syntaxes/flow1/comment.sublime-syntax From 4ef7c523cf8b9508eac392237b5664da203bec73 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Tue, 26 Dec 2017 00:27:13 -0200 Subject: [PATCH 295/407] [FJSX15] Make JSX similar to HTML --- syntaxes/fjsx15/jsx1.sublime-syntax | 7 +- syntaxes/jsx1/attribute.sublime-syntax | 2 +- syntaxes/jsx1/component.no-pop.sublime-syntax | 57 +++++++++++ syntaxes/jsx1/component.sublime-syntax | 4 +- syntaxes/jsx1/element.no-pop.sublime-syntax | 96 +++++++++++++++++++ syntaxes/jsx1/element.sublime-syntax | 12 +-- syntaxes/jsx1/fragment.no-pop.sublime-syntax | 42 ++++++++ syntaxes/jsx1/fragment.sublime-syntax | 4 +- syntaxes/naomi.jsx1.sublime-syntax | 27 ++++++ 9 files changed, 229 insertions(+), 22 deletions(-) create mode 100644 syntaxes/jsx1/component.no-pop.sublime-syntax create mode 100644 syntaxes/jsx1/element.no-pop.sublime-syntax create mode 100644 syntaxes/jsx1/fragment.no-pop.sublime-syntax create mode 100644 syntaxes/naomi.jsx1.sublime-syntax diff --git a/syntaxes/fjsx15/jsx1.sublime-syntax b/syntaxes/fjsx15/jsx1.sublime-syntax index b0c65e0e..e8110a83 100644 --- a/syntaxes/fjsx15/jsx1.sublime-syntax +++ b/syntaxes/fjsx15/jsx1.sublime-syntax @@ -46,12 +46,7 @@ contexts: embedded-js-close, optional-expression ] - set: jsx - - jsx: - - include: Packages/Naomi/syntaxes/jsx1/fragment.sublime-syntax - - include: Packages/Naomi/syntaxes/jsx1/component.sublime-syntax - - include: Packages/Naomi/syntaxes/jsx1/element.sublime-syntax + set: [ Packages/Naomi/syntaxes/naomi.jsx1.sublime-syntax ] embedded-js-close: - match: \s*(}) diff --git a/syntaxes/jsx1/attribute.sublime-syntax b/syntaxes/jsx1/attribute.sublime-syntax index 3715fb67..7f91d115 100644 --- a/syntaxes/jsx1/attribute.sublime-syntax +++ b/syntaxes/jsx1/attribute.sublime-syntax @@ -50,7 +50,7 @@ contexts: - match: \s*(=) captures: 1: punctuation.separator.key-value.html.jsx.jsx1 - set: value + push: value # Anything else. - include: escape diff --git a/syntaxes/jsx1/component.no-pop.sublime-syntax b/syntaxes/jsx1/component.no-pop.sublime-syntax new file mode 100644 index 00000000..76b32c0c --- /dev/null +++ b/syntaxes/jsx1/component.no-pop.sublime-syntax @@ -0,0 +1,57 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +variables: + componentIdentifier: | + [[:upper:]] + [$_.:[:alnum:]]* + + attributeIdentifier: | + [_[:alpha:]] + [._\-[:alnum:]]* + +contexts: + main: + - match: | + (?x) + \s*(<) + \s*({{componentIdentifier}}) + captures: + 1: punctuation.definition.tag.begin.html.jsx.jsx1 + 2: entity.name.tag.component.html.jsx.jsx1 + push: [ + meta-scope, + closing-tag, + open-tag, + optional-attribute + ] + + meta-scope: + - meta_scope: meta.tag.other.component.html.jsx.jsx1 + - match: "" + pop: true + + closing-tag: + - include: Packages/Naomi/syntaxes/jsx1/component.sublime-syntax#closing-tag + + open-tag: + - include: Packages/Naomi/syntaxes/jsx1/component.sublime-syntax#open-tag + + optional-attribute: + - include: Packages/Naomi/syntaxes/jsx1/component.sublime-syntax#optional-attribute diff --git a/syntaxes/jsx1/component.sublime-syntax b/syntaxes/jsx1/component.sublime-syntax index fedf8216..6407b2d0 100644 --- a/syntaxes/jsx1/component.sublime-syntax +++ b/syntaxes/jsx1/component.sublime-syntax @@ -43,9 +43,7 @@ contexts: ] meta-scope: - - meta_scope: >- - text.html.basic.jsx.jsx1 - meta.tag.other.component.html.jsx.jsx1 + - meta_scope: meta.tag.other.component.html.jsx.jsx1 - match: "" pop: true diff --git a/syntaxes/jsx1/element.no-pop.sublime-syntax b/syntaxes/jsx1/element.no-pop.sublime-syntax new file mode 100644 index 00000000..cce400ae --- /dev/null +++ b/syntaxes/jsx1/element.no-pop.sublime-syntax @@ -0,0 +1,96 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +variables: + elementIdentifier: | + [$_[:alpha:]] + [$_.:[:alnum:]]* + + attributeIdentifier: | + [_[:alpha:]] + [._\-[:alnum:]]* + +contexts: + main: + # html, head, body. + - match: | + (?x) + \s*(<) + \s*(body|head|html)\b + captures: + 1: punctuation.definition.tag.begin.html.jsx.jsx1 + 2: entity.name.tag.structure.html.jsx.jsx1 + push: [ + meta-scope-structure, + closing-tag, + open-tag, + optional-attribute + ] + # a. + - match: | + (?x) + \s*(<) + \s*(a)\b + captures: + 1: punctuation.definition.tag.begin.html.jsx.jsx1 + 2: entity.name.tag.a.html.jsx.jsx1 + push: [ + meta-scope-a, + closing-tag, + open-tag, + optional-attribute + ] + # Other tags. + - match: | + (?x) + \s*(<) + \s*({{elementIdentifier}}) + captures: + 1: punctuation.definition.tag.begin.html.jsx.jsx1 + 2: entity.name.tag.html.jsx.jsx1 + push: [ + meta-scope-other, + closing-tag, + open-tag, + optional-attribute + ] + + meta-scope-structure: + - meta_scope: meta.tag.structure.html.jsx.jsx1 + - match: "" + pop: true + + meta-scope-a: + - meta_scope: meta.tag.inline.a.html.jsx.jsx1 + - match: "" + pop: true + + meta-scope-other: + - meta_scope: meta.tag.other.html.jsx.jsx1 + - match: "" + pop: true + + closing-tag: + - include: Packages/Naomi/syntaxes/jsx1/element.sublime-syntax#closing-tag + + open-tag: + - include: Packages/Naomi/syntaxes/jsx1/element.sublime-syntax#open-tag + + optional-attribute: + - include: Packages/Naomi/syntaxes/jsx1/element.sublime-syntax#optional-attribute diff --git a/syntaxes/jsx1/element.sublime-syntax b/syntaxes/jsx1/element.sublime-syntax index 9da8287f..833e53a9 100644 --- a/syntaxes/jsx1/element.sublime-syntax +++ b/syntaxes/jsx1/element.sublime-syntax @@ -72,23 +72,17 @@ contexts: ] meta-scope-structure: - - meta_scope: >- - text.html.basic.jsx.jsx1 - meta.tag.structure.html.jsx.jsx1 + - meta_scope: meta.tag.structure.html.jsx.jsx1 - match: "" pop: true meta-scope-a: - - meta_scope: >- - text.html.basic.jsx.jsx1 - meta.tag.inline.a.html.jsx.jsx1 + - meta_scope: meta.tag.inline.a.html.jsx.jsx1 - match: "" pop: true meta-scope-other: - - meta_scope: >- - text.html.basic.jsx.jsx1 - meta.tag.other.html.jsx.jsx1 + - meta_scope: meta.tag.other.html.jsx.jsx1 - match: "" pop: true diff --git a/syntaxes/jsx1/fragment.no-pop.sublime-syntax b/syntaxes/jsx1/fragment.no-pop.sublime-syntax new file mode 100644 index 00000000..c024b6d8 --- /dev/null +++ b/syntaxes/jsx1/fragment.no-pop.sublime-syntax @@ -0,0 +1,42 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_.:[:alnum:]]* + +contexts: + main: + - match: \s*(<)(>) + captures: + 1: punctuation.definition.tag.begin.jsx.jsx1 + 2: punctuation.definition.tag.end.jsx.jsx1 + push: [ + meta-scope, + closing-tag + ] + + meta-scope: + - meta_scope: meta.tag.other.fragment.jsx.jsx1 + - match: "" + pop: true + + closing-tag: + - include: Packages/Naomi/syntaxes/jsx1/fragment.sublime-syntax#closing-tag diff --git a/syntaxes/jsx1/fragment.sublime-syntax b/syntaxes/jsx1/fragment.sublime-syntax index 2023dc10..af299c14 100644 --- a/syntaxes/jsx1/fragment.sublime-syntax +++ b/syntaxes/jsx1/fragment.sublime-syntax @@ -34,9 +34,7 @@ contexts: ] meta-scope: - - meta_scope: >- - text.html.basic.jsx.jsx1 - meta.tag.other.fragment.jsx.jsx1 + - meta_scope: meta.tag.other.fragment.jsx.jsx1 - match: "" pop: true diff --git a/syntaxes/naomi.jsx1.sublime-syntax b/syntaxes/naomi.jsx1.sublime-syntax new file mode 100644 index 00000000..7a715035 --- /dev/null +++ b/syntaxes/naomi.jsx1.sublime-syntax @@ -0,0 +1,27 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: text.html.basic.jsx.jsx1 + +contexts: + main: + - clear_scopes: true + - include: Packages/Naomi/syntaxes/jsx1/fragment.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/jsx1/component.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/jsx1/element.no-pop.sublime-syntax + - match: "" + pop: true From e73e5b506b8a4856cb3d65e11ae553ebeeba1178 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Tue, 26 Dec 2017 00:53:25 -0200 Subject: [PATCH 296/407] [FJSX15] Cleanup embedded JS scopes --- syntaxes/fjsx15/jsx1.sublime-syntax | 2 ++ 1 file changed, 2 insertions(+) diff --git a/syntaxes/fjsx15/jsx1.sublime-syntax b/syntaxes/fjsx15/jsx1.sublime-syntax index e8110a83..129d8cbd 100644 --- a/syntaxes/fjsx15/jsx1.sublime-syntax +++ b/syntaxes/fjsx15/jsx1.sublime-syntax @@ -49,6 +49,8 @@ contexts: set: [ Packages/Naomi/syntaxes/naomi.jsx1.sublime-syntax ] embedded-js-close: + - clear_scopes: true + - meta_scope: source.js.fjsx15 - match: \s*(}) captures: 1: keyword.operator.other.embedded.js.end.jsx.jsx1 From 52a27745f13954c9213339fad6ba0c3a12ac45dd Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Tue, 26 Dec 2017 02:08:53 -0200 Subject: [PATCH 297/407] [FJSX15] Fix arrow function parameters --- syntaxes/fjsx15/variable.sublime-syntax | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/variable.sublime-syntax b/syntaxes/fjsx15/variable.sublime-syntax index 17697dac..35633f25 100644 --- a/syntaxes/fjsx15/variable.sublime-syntax +++ b/syntaxes/fjsx15/variable.sublime-syntax @@ -166,7 +166,7 @@ contexts: - meta_scope: meta.function.declaration.js.fjsx15 - include: Packages/Naomi/syntaxes/fjsx15/async.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/flow1/template/parameters.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/parameters.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/function/parameters.no-pop.sublime-syntax - match: (?=\s*=>) set: arrow-body From 772f03f4368cde8b35e0a5a09bdd240e6e2941c3 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Tue, 26 Dec 2017 02:33:59 -0200 Subject: [PATCH 298/407] [FJSX15] Enhance arrow function with strings prediction --- syntaxes/fjsx15/arrow-function.sublime-syntax | 18 +++++++++++++----- syntaxes/fjsx15/variable.sublime-syntax | 19 ++++++++++++++----- 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/syntaxes/fjsx15/arrow-function.sublime-syntax b/syntaxes/fjsx15/arrow-function.sublime-syntax index 804825c8..6531b071 100644 --- a/syntaxes/fjsx15/arrow-function.sublime-syntax +++ b/syntaxes/fjsx15/arrow-function.sublime-syntax @@ -31,9 +31,17 @@ variables: parameters: | (\( - [^()]* + (?> '(?:[^']|\')*' + | "(?:[^"]|\")*" + | `(?:[^`]|\`)*` + | [^'"`()]* + ) \g<-1>? - [^()]* + (?> '(?:[^']|\')*' + | "(?:[^"]|\")*" + | `(?:[^`]|\`)*` + | [^'"`()]* + ) \)) flowOperators: | @@ -42,9 +50,9 @@ variables: ) string: | - (?> '.*?' - | ".*?" - | `.*` + (?> '(?:[^']|\')*' + | "(?:[^"]|\")*" + | `(?:[^`]|\`)*` ) simpleFlowType: | diff --git a/syntaxes/fjsx15/variable.sublime-syntax b/syntaxes/fjsx15/variable.sublime-syntax index 35633f25..98c18039 100644 --- a/syntaxes/fjsx15/variable.sublime-syntax +++ b/syntaxes/fjsx15/variable.sublime-syntax @@ -21,6 +21,7 @@ variables: commonIdentifier: | [$_[:alpha:]] [$_[:alnum:]]* + templateArguments: | (< [^<>]* @@ -30,9 +31,17 @@ variables: parameters: | (\( - [^()]* + (?> '(?:[^']|\')*' + | "(?:[^"]|\")*" + | `(?:[^`]|\`)*` + | [^'"`()]* + ) \g<-1>? - [^()]* + (?> '(?:[^']|\')*' + | "(?:[^"]|\")*" + | `(?:[^`]|\`)*` + | [^'"`()]* + ) \)) flowOperators: | @@ -41,9 +50,9 @@ variables: ) string: | - (?> '.*?' - | ".*?" - | `.*` + (?> '(?:[^']|\')*' + | "(?:[^"]|\")*" + | `(?:[^`]|\`)*` ) simpleFlowType: | From 172565249d24974c45af947edc109efc50717aac Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Tue, 26 Dec 2017 18:50:45 -0200 Subject: [PATCH 299/407] [FJSX15] Enhance string pattern --- syntaxes/fjsx15/arrow-function.no-pop.sublime-syntax | 6 +++--- syntaxes/fjsx15/function/parameter/simple.sublime-syntax | 6 +++--- syntaxes/fjsx15/literal/object/property.sublime-syntax | 6 +++--- syntaxes/fjsx15/variable-declaration.sublime-syntax | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/syntaxes/fjsx15/arrow-function.no-pop.sublime-syntax b/syntaxes/fjsx15/arrow-function.no-pop.sublime-syntax index 251a54de..590031af 100644 --- a/syntaxes/fjsx15/arrow-function.no-pop.sublime-syntax +++ b/syntaxes/fjsx15/arrow-function.no-pop.sublime-syntax @@ -44,9 +44,9 @@ variables: ) string: | - (?> '.*?' - | ".*?" - | `.*` + (?> '(?:[^']|\')*' + | "(?:[^"]|\")*" + | `(?:[^`]|\`)*` ) simpleFlowType: | diff --git a/syntaxes/fjsx15/function/parameter/simple.sublime-syntax b/syntaxes/fjsx15/function/parameter/simple.sublime-syntax index e74a33d9..89a0f0e3 100644 --- a/syntaxes/fjsx15/function/parameter/simple.sublime-syntax +++ b/syntaxes/fjsx15/function/parameter/simple.sublime-syntax @@ -41,9 +41,9 @@ variables: ) string: | - (?> '.*?' - | ".*?" - | `.*` + (?> '(?:[^']|\')*' + | "(?:[^"]|\")*" + | `(?:[^`]|\`)*` ) simpleFlowType: | diff --git a/syntaxes/fjsx15/literal/object/property.sublime-syntax b/syntaxes/fjsx15/literal/object/property.sublime-syntax index f9e87a7e..984cf2ef 100644 --- a/syntaxes/fjsx15/literal/object/property.sublime-syntax +++ b/syntaxes/fjsx15/literal/object/property.sublime-syntax @@ -63,9 +63,9 @@ variables: ) string: | - (?> '.*?' - | ".*?" - | `.*` + (?> '(?:[^']|\')*' + | "(?:[^"]|\")*" + | `(?:[^`]|\`)*` ) simpleFlowType: | diff --git a/syntaxes/fjsx15/variable-declaration.sublime-syntax b/syntaxes/fjsx15/variable-declaration.sublime-syntax index dfc206c2..e724f252 100644 --- a/syntaxes/fjsx15/variable-declaration.sublime-syntax +++ b/syntaxes/fjsx15/variable-declaration.sublime-syntax @@ -46,9 +46,9 @@ variables: ) string: | - (?> '.*?' - | ".*?" - | `.*` + (?> '(?:[^']|\')*' + | "(?:[^"]|\")*" + | `(?:[^`]|\`)*` ) simpleFlowType: | From 51acbaed6ac8ba0fb809a82da9881492b4f0625b Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Tue, 26 Dec 2017 19:00:33 -0200 Subject: [PATCH 300/407] [FJSX15] Enhance parameters prediction --- .../arrow-function.no-pop.sublime-syntax | 18 +++++++++++++----- syntaxes/fjsx15/arrow-function.sublime-syntax | 18 +++++++++--------- .../function/parameter/simple.sublime-syntax | 18 +++++++++++++----- .../literal/object/property.sublime-syntax | 18 +++++++++++++----- .../fjsx15/variable-declaration.sublime-syntax | 18 +++++++++++++----- syntaxes/fjsx15/variable.sublime-syntax | 18 +++++++++--------- syntaxes/flow1/function.no-pop.sublime-syntax | 12 ++++++++++-- syntaxes/flow1/function.sublime-syntax | 12 ++++++++++-- 8 files changed, 90 insertions(+), 42 deletions(-) diff --git a/syntaxes/fjsx15/arrow-function.no-pop.sublime-syntax b/syntaxes/fjsx15/arrow-function.no-pop.sublime-syntax index 590031af..156d62e6 100644 --- a/syntaxes/fjsx15/arrow-function.no-pop.sublime-syntax +++ b/syntaxes/fjsx15/arrow-function.no-pop.sublime-syntax @@ -33,9 +33,17 @@ variables: parameters: | (\( - [^()]* + (?> '(?:\'|[^'])*' + | "(?:\"|[^"])*" + | `(?:\`|[^`])*` + | [^'"`()]* + ) \g<-1>? - [^()]* + (?> '(?:\'|[^'])*' + | "(?:\"|[^"])*" + | `(?:\`|[^`])*` + | [^'"`()]* + ) \)) flowOperators: | @@ -44,9 +52,9 @@ variables: ) string: | - (?> '(?:[^']|\')*' - | "(?:[^"]|\")*" - | `(?:[^`]|\`)*` + (?> '(?:\'|[^'])*' + | "(?:\"|[^"])*" + | `(?:\`|[^`])*` ) simpleFlowType: | diff --git a/syntaxes/fjsx15/arrow-function.sublime-syntax b/syntaxes/fjsx15/arrow-function.sublime-syntax index 6531b071..2ce64cc4 100644 --- a/syntaxes/fjsx15/arrow-function.sublime-syntax +++ b/syntaxes/fjsx15/arrow-function.sublime-syntax @@ -31,15 +31,15 @@ variables: parameters: | (\( - (?> '(?:[^']|\')*' - | "(?:[^"]|\")*" - | `(?:[^`]|\`)*` + (?> '(?:\'|[^'])*' + | "(?:\"|[^"])*" + | `(?:\`|[^`])*` | [^'"`()]* ) \g<-1>? - (?> '(?:[^']|\')*' - | "(?:[^"]|\")*" - | `(?:[^`]|\`)*` + (?> '(?:\'|[^'])*' + | "(?:\"|[^"])*" + | `(?:\`|[^`])*` | [^'"`()]* ) \)) @@ -50,9 +50,9 @@ variables: ) string: | - (?> '(?:[^']|\')*' - | "(?:[^"]|\")*" - | `(?:[^`]|\`)*` + (?> '(?:\'|[^'])*' + | "(?:\"|[^"])*" + | `(?:\`|[^`])*` ) simpleFlowType: | diff --git a/syntaxes/fjsx15/function/parameter/simple.sublime-syntax b/syntaxes/fjsx15/function/parameter/simple.sublime-syntax index 89a0f0e3..8fb25271 100644 --- a/syntaxes/fjsx15/function/parameter/simple.sublime-syntax +++ b/syntaxes/fjsx15/function/parameter/simple.sublime-syntax @@ -30,9 +30,17 @@ variables: parameters: | (\( - [^()]* + (?> '(?:\'|[^'])*' + | "(?:\"|[^"])*" + | `(?:\`|[^`])*` + | [^'"`()]* + ) \g<-1>? - [^()]* + (?> '(?:\'|[^'])*' + | "(?:\"|[^"])*" + | `(?:\`|[^`])*` + | [^'"`()]* + ) \)) flowOperators: | @@ -41,9 +49,9 @@ variables: ) string: | - (?> '(?:[^']|\')*' - | "(?:[^"]|\")*" - | `(?:[^`]|\`)*` + (?> '(?:\'|[^'])*' + | "(?:\"|[^"])*" + | `(?:\`|[^`])*` ) simpleFlowType: | diff --git a/syntaxes/fjsx15/literal/object/property.sublime-syntax b/syntaxes/fjsx15/literal/object/property.sublime-syntax index 984cf2ef..b5d0484d 100644 --- a/syntaxes/fjsx15/literal/object/property.sublime-syntax +++ b/syntaxes/fjsx15/literal/object/property.sublime-syntax @@ -52,9 +52,17 @@ variables: parameters: | (\( - [^()]* + (?> '(?:\'|[^'])*' + | "(?:\"|[^"])*" + | `(?:\`|[^`])*` + | [^'"`()]* + ) \g<-1>? - [^()]* + (?> '(?:\'|[^'])*' + | "(?:\"|[^"])*" + | `(?:\`|[^`])*` + | [^'"`()]* + ) \)) flowOperators: | @@ -63,9 +71,9 @@ variables: ) string: | - (?> '(?:[^']|\')*' - | "(?:[^"]|\")*" - | `(?:[^`]|\`)*` + (?> '(?:\'|[^'])*' + | "(?:\"|[^"])*" + | `(?:\`|[^`])*` ) simpleFlowType: | diff --git a/syntaxes/fjsx15/variable-declaration.sublime-syntax b/syntaxes/fjsx15/variable-declaration.sublime-syntax index e724f252..1cdbc44f 100644 --- a/syntaxes/fjsx15/variable-declaration.sublime-syntax +++ b/syntaxes/fjsx15/variable-declaration.sublime-syntax @@ -35,9 +35,17 @@ variables: parameters: | (\( - [^()]* + (?> '(?:\'|[^'])*' + | "(?:\"|[^"])*" + | `(?:\`|[^`])*` + | [^'"`()]* + ) \g<-1>? - [^()]* + (?> '(?:\'|[^'])*' + | "(?:\"|[^"])*" + | `(?:\`|[^`])*` + | [^'"`()]* + ) \)) flowOperators: | @@ -46,9 +54,9 @@ variables: ) string: | - (?> '(?:[^']|\')*' - | "(?:[^"]|\")*" - | `(?:[^`]|\`)*` + (?> '(?:\'|[^'])*' + | "(?:\"|[^"])*" + | `(?:\`|[^`])*` ) simpleFlowType: | diff --git a/syntaxes/fjsx15/variable.sublime-syntax b/syntaxes/fjsx15/variable.sublime-syntax index 98c18039..4f21b988 100644 --- a/syntaxes/fjsx15/variable.sublime-syntax +++ b/syntaxes/fjsx15/variable.sublime-syntax @@ -31,15 +31,15 @@ variables: parameters: | (\( - (?> '(?:[^']|\')*' - | "(?:[^"]|\")*" - | `(?:[^`]|\`)*` + (?> '(?:\'|[^'])*' + | "(?:\"|[^"])*" + | `(?:\`|[^`])*` | [^'"`()]* ) \g<-1>? - (?> '(?:[^']|\')*' - | "(?:[^"]|\")*" - | `(?:[^`]|\`)*` + (?> '(?:\'|[^'])*' + | "(?:\"|[^"])*" + | `(?:\`|[^`])*` | [^'"`()]* ) \)) @@ -50,9 +50,9 @@ variables: ) string: | - (?> '(?:[^']|\')*' - | "(?:[^"]|\")*" - | `(?:[^`]|\`)*` + (?> '(?:\'|[^'])*' + | "(?:\"|[^"])*" + | `(?:\`|[^`])*` ) simpleFlowType: | diff --git a/syntaxes/flow1/function.no-pop.sublime-syntax b/syntaxes/flow1/function.no-pop.sublime-syntax index 239489bf..9f2a34fd 100644 --- a/syntaxes/flow1/function.no-pop.sublime-syntax +++ b/syntaxes/flow1/function.no-pop.sublime-syntax @@ -27,9 +27,17 @@ variables: parameters: | (\( - [^()]* + (?> '(?:\'|[^'])*' + | "(?:\"|[^"])*" + | `(?:\`|[^`])*` + | [^'"`()]* + ) \g<-1>? - [^()]* + (?> '(?:\'|[^'])*' + | "(?:\"|[^"])*" + | `(?:\`|[^`])*` + | [^'"`()]* + ) \)) flowFunction: | diff --git a/syntaxes/flow1/function.sublime-syntax b/syntaxes/flow1/function.sublime-syntax index f6f17f6d..b63ef400 100644 --- a/syntaxes/flow1/function.sublime-syntax +++ b/syntaxes/flow1/function.sublime-syntax @@ -27,9 +27,17 @@ variables: parameters: | (\( - [^()]* + (?> '(?:\'|[^'])*' + | "(?:\"|[^"])*" + | `(?:\`|[^`])*` + | [^'"`()]* + ) \g<-1>? - [^()]* + (?> '(?:\'|[^'])*' + | "(?:\"|[^"])*" + | `(?:\`|[^`])*` + | [^'"`()]* + ) \)) flowFunction: | From 0d9ad70c493c41fd88198a610f12eb3811316ddd Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Wed, 27 Dec 2017 15:24:30 -0200 Subject: [PATCH 301/407] [FJSX15] Fix typeof expressions in call arguments --- syntaxes/fjsx15/function-call/arguments.sublime-syntax | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/syntaxes/fjsx15/function-call/arguments.sublime-syntax b/syntaxes/fjsx15/function-call/arguments.sublime-syntax index cce2d089..85c947d0 100644 --- a/syntaxes/fjsx15/function-call/arguments.sublime-syntax +++ b/syntaxes/fjsx15/function-call/arguments.sublime-syntax @@ -29,10 +29,11 @@ contexts: captures: 1: punctuation.section.group.end.js.fjsx15 pop: true - - match: \s*(,) - captures: - 1: punctuation.separator.comma.js.fjsx15 - push: optional-expression + - match: (?=\s*\S) + push: expression + + expression: + - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax optional-expression: - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax From ff9634246f2d58697f4b4f52be6d3f54255ba8d8 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Wed, 27 Dec 2017 16:29:26 -0200 Subject: [PATCH 302/407] [FJSX15] Simplify tag content highlighting --- syntaxes/jsx1/component.sublime-syntax | 38 ++++++++++++++++++-------- syntaxes/jsx1/element.sublime-syntax | 30 +++++--------------- syntaxes/jsx1/fragment.sublime-syntax | 24 ++++++++-------- 3 files changed, 46 insertions(+), 46 deletions(-) diff --git a/syntaxes/jsx1/component.sublime-syntax b/syntaxes/jsx1/component.sublime-syntax index 6407b2d0..c7e6df0f 100644 --- a/syntaxes/jsx1/component.sublime-syntax +++ b/syntaxes/jsx1/component.sublime-syntax @@ -56,20 +56,42 @@ contexts: pop: true open-tag: - # Normal or self closing tag. - - match: \s*(/?>) + # Self closing tag. + - match: (?=\s*/>) captures: 1: punctuation.definition.tag.end.html.jsx.jsx1 pop: true + # Normal closing tag. + - match: \s*(>) + captures: + 1: punctuation.definition.tag.end.html.jsx.jsx1 + # pop: true + set: optional-content # Attribute. - match: | (?xi) (?=\s*{{attributeIdentifier}}) push: attribute + optional-content: + # Closing tag. + - match: (?=\s*) + # Self closing tag. + - match: \s*(/>) + captures: + 1: punctuation.definition.tag.end.html.jsx.jsx1 pop: true # Closing tag. - match: | @@ -81,11 +103,3 @@ contexts: 3: entity.name.tag.component.html.jsx.jsx1 4: punctuation.definition.tag.end.html.jsx.jsx1 pop: true - # Other content. - - match: (?=\s*\S) - push: - - include: Packages/Naomi/syntaxes/jsx1/fragment.sublime-syntax - - include: main - - include: Packages/Naomi/syntaxes/jsx1/element.sublime-syntax - - match: . - pop: true diff --git a/syntaxes/jsx1/element.sublime-syntax b/syntaxes/jsx1/element.sublime-syntax index 833e53a9..4fcc4c0e 100644 --- a/syntaxes/jsx1/element.sublime-syntax +++ b/syntaxes/jsx1/element.sublime-syntax @@ -95,32 +95,13 @@ contexts: pop: true open-tag: - # Normal or self closing tag. - - match: \s*(/?>) - captures: - 1: punctuation.definition.tag.end.html.jsx.jsx1 - pop: true - # Attribute. - - match: | - (?xi) - (?=\s*{{attributeIdentifier}}) - push: attribute + - include: Packages/Naomi/syntaxes/jsx1/component.sublime-syntax#open-tag - closing-tag: - # It was a self closing tag. - - match: (?<=[^<]/>) - pop: true + optional-content: # Closing tag. - - match: | - (?x)\s* - (()) - captures: - 1: meta.tag.close.html.jsx.jsx1 - 2: punctuation.definition.tag.begin.html.jsx.jsx1 - 3: entity.name.tag.html.jsx.jsx1 - 4: punctuation.definition.tag.end.html.jsx.jsx1 + - match: (?=\s*) - pop: true + optional-content: # Closing tag. - - match: \s*(()) - captures: - 1: meta.tag.close.jsx.jsx1 - 2: punctuation.definition.tag.begin.jsx.jsx1 - 3: punctuation.definition.tag.end.jsx.jsx1 + - match: (?=\s*)) + captures: + 1: meta.tag.close.jsx.jsx1 + 2: punctuation.definition.tag.begin.jsx.jsx1 + 3: punctuation.definition.tag.end.jsx.jsx1 + pop: true From 6dfbb91a7ef69e1d3475481d86bb38e3276af2ec Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Wed, 27 Dec 2017 19:33:57 -0200 Subject: [PATCH 303/407] [FJSX15] Remove unnecessary JSX macro --- Default.sublime-keymap | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/Default.sublime-keymap b/Default.sublime-keymap index 419aaca4..fe2601c4 100644 --- a/Default.sublime-keymap +++ b/Default.sublime-keymap @@ -128,26 +128,4 @@ "args": { "file": "res://Packages/Naomi/macros/delete-to-previous-line.sublime-macro" } -},{ - // Close JSX tag. - "keys": [ "/" ], - "command": "close_tag", - "context": [{ - "key": "setting.auto_close_tags", - "match_all": true - },{ - "key": "preceding_text", - "operator": "regex_match", - "operand": ".*<$" - },{ - "key": "selector", - "operator": "equal", - "operand": "source.js meta.tag - string - comment", - "match_all": true - },{ - "key": "selector", - "operator": "not_equal", - "operand": "keyword.operator.other.embedded.js.end", - "match_all": true - }] }] From 0b516f8acbc5224cd11f44ce39da39cadb7bfd78 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Wed, 27 Dec 2017 19:34:22 -0200 Subject: [PATCH 304/407] [FJSX15] Normalize class and style scopes --- syntaxes/jsx1/attribute.sublime-syntax | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/syntaxes/jsx1/attribute.sublime-syntax b/syntaxes/jsx1/attribute.sublime-syntax index 7f91d115..775ec899 100644 --- a/syntaxes/jsx1/attribute.sublime-syntax +++ b/syntaxes/jsx1/attribute.sublime-syntax @@ -24,6 +24,20 @@ variables: contexts: main: + # className. + - match: | + (?xi)\s* + (className) + captures: + 1: entity.other.attribute-name.class.html.jsx.jsx1 + set: optional-value + # style. + - match: | + (?xi)\s* + (style) + captures: + 1: entity.other.attribute-name.style.html.jsx.jsx1 + set: optional-value # Attribute with value. - match: | (?xi)\s* From a512242621d98e06185a164cb2d5dc74e2fcc891 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Wed, 27 Dec 2017 19:34:35 -0200 Subject: [PATCH 305/407] [FJSX15] Cleanup JSX content scopes --- syntaxes/jsx1/component.sublime-syntax | 2 ++ syntaxes/jsx1/element.sublime-syntax | 40 ++++++++++++++++++++++++++ syntaxes/jsx1/fragment.sublime-syntax | 2 ++ 3 files changed, 44 insertions(+) diff --git a/syntaxes/jsx1/component.sublime-syntax b/syntaxes/jsx1/component.sublime-syntax index c7e6df0f..d5678de8 100644 --- a/syntaxes/jsx1/component.sublime-syntax +++ b/syntaxes/jsx1/component.sublime-syntax @@ -80,6 +80,8 @@ contexts: # Content. - match: (?=\s*\S) push: + - clear_scopes: true + - meta_scope: text.html.basic.jsx.jsx1 - include: Packages/Naomi/syntaxes/jsx1/fragment.sublime-syntax - include: main - include: Packages/Naomi/syntaxes/jsx1/element.sublime-syntax diff --git a/syntaxes/jsx1/element.sublime-syntax b/syntaxes/jsx1/element.sublime-syntax index 4fcc4c0e..8ced77cf 100644 --- a/syntaxes/jsx1/element.sublime-syntax +++ b/syntaxes/jsx1/element.sublime-syntax @@ -56,6 +56,34 @@ contexts: open-tag, optional-attribute ] + # div. + - match: | + (?x) + \s*(<) + \s*(div)\b + captures: + 1: punctuation.definition.tag.begin.html.jsx.jsx1 + 2: entity.name.tag.block.any.html.jsx.jsx1 + set: [ + meta-scope-block-any, + closing-tag, + open-tag, + optional-attribute + ] + # span. + - match: | + (?x) + \s*(<) + \s*(span)\b + captures: + 1: punctuation.definition.tag.begin.html.jsx.jsx1 + 2: entity.name.tag.inline.any.html.jsx.jsx1 + set: [ + meta-scope-inline-any, + closing-tag, + open-tag, + optional-attribute + ] # Other tags. - match: | (?x) @@ -81,6 +109,16 @@ contexts: - match: "" pop: true + meta-scope-block-any: + - meta_scope: meta.tag.block.any.html.jsx.jsx1 + - match: "" + pop: true + + meta-scope-inline-any: + - meta_scope: meta.tag.inline.any.html.jsx.jsx1 + - match: "" + pop: true + meta-scope-other: - meta_scope: meta.tag.other.html.jsx.jsx1 - match: "" @@ -104,6 +142,8 @@ contexts: # Content. - match: (?=\s*\S) push: + - clear_scopes: true + - meta_scope: text.html.basic.jsx.jsx1 - include: Packages/Naomi/syntaxes/jsx1/fragment.sublime-syntax - include: Packages/Naomi/syntaxes/jsx1/component.sublime-syntax - include: main diff --git a/syntaxes/jsx1/fragment.sublime-syntax b/syntaxes/jsx1/fragment.sublime-syntax index df58a6a4..72fa8558 100644 --- a/syntaxes/jsx1/fragment.sublime-syntax +++ b/syntaxes/jsx1/fragment.sublime-syntax @@ -46,6 +46,8 @@ contexts: # Content. - match: (?=\s*\S) push: + - clear_scopes: true + - meta_scope: text.html.basic.jsx.jsx1 - include: main - include: Packages/Naomi/syntaxes/jsx1/component.sublime-syntax - include: Packages/Naomi/syntaxes/jsx1/element.sublime-syntax From 00357f635a69df73fd69d9337b0bd0c26fd5d5a3 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Thu, 28 Dec 2017 14:16:11 -0200 Subject: [PATCH 306/407] [FJSX15] Fix indexer priority --- syntaxes/fjsx15/class/body.sublime-syntax | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/class/body.sublime-syntax b/syntaxes/fjsx15/class/body.sublime-syntax index 268ea8ff..c1bbb4ae 100644 --- a/syntaxes/fjsx15/class/body.sublime-syntax +++ b/syntaxes/fjsx15/class/body.sublime-syntax @@ -44,12 +44,12 @@ contexts: - include: comment-no-pop - include: Packages/Naomi/syntaxes/flow1/operator/covariant.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/flow1/operator/contravariant.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/flow1/indexer.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/decorator.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/react-js.sublime-syntax#class-properties - include: Packages/Naomi/syntaxes/fjsx15/react-js.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/class/modifier.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/class/method.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/indexer.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/class/property.sublime-syntax - match: (?=\s*\S) pop: true From 46c0598ba8887ef91209916350b3e5e854480e52 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Thu, 28 Dec 2017 14:16:40 -0200 Subject: [PATCH 307/407] [FJSX15] Normalize blocks and conditionals --- syntaxes/fjsx15/statement.sublime-syntax | 33 +++++++++++++++++++----- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/syntaxes/fjsx15/statement.sublime-syntax b/syntaxes/fjsx15/statement.sublime-syntax index 81215f22..f6eb6b12 100644 --- a/syntaxes/fjsx15/statement.sublime-syntax +++ b/syntaxes/fjsx15/statement.sublime-syntax @@ -50,7 +50,7 @@ contexts: condition-end: - match: \s*(\)) captures: - 1: punctuation.definition.control.header.end.js.fjsx15 + 1: punctuation.section.group.end.js.fjsx15 pop: true optional-await: @@ -58,13 +58,17 @@ contexts: - match: (?=\s*\S) pop: true + optional-block-statement-or-expression: + - include: block + - include: optional-statements-and-expressions + optional-statements-and-expressions: - include: Packages/Naomi/syntaxes/fjsx15/optional-statements-and-expressions.sublime-syntax for-header: - match: \s*(\() captures: - 1: punctuation.definition.control.header.begin.js.fjsx15 + 1: punctuation.section.group.begin.js.fjsx15 set: for-header-end for-header-end: @@ -83,7 +87,7 @@ contexts: expression-only-header: - match: \s*(\() captures: - 1: punctuation.definition.control.header.begin.js.fjsx15 + 1: punctuation.section.group.begin.js.fjsx15 set: [ condition-end, optional-expression ] optional-expression-only-header: @@ -94,14 +98,18 @@ contexts: block: - match: \s*({) captures: - 1: punctuation.section.block.begin.js.fjsx15 + 1: >- + meta.block.js.fjsx15 + punctuation.section.block.begin.js.fjsx15 set: [ block-end, optional-statements-and-expressions ] block-end: - - meta_scope: meta.block.js.fjsx15 + - meta_content_scope: meta.block.js.fjsx15 - match: \s*(}) captures: - 1: punctuation.section.block.end.js.fjsx15 + 1: >- + meta.block.js.fjsx15 + punctuation.section.block.end.js.fjsx15 pop: true - match: "" push: optional-statements-and-expressions @@ -151,10 +159,21 @@ contexts: - match: \s*(if)\b captures: 1: keyword.control.conditional.js.fjsx15 - set: expression-only-header + set: [ + meta-conditional, + optional-block-statement-or-expression, + expression-only-header + ] - match: \s*(else)\b captures: 1: keyword.control.conditional.js.fjsx15 + set: [ + optional-block-statement-or-expression + ] + + meta-conditional: + - meta_scope: meta.conditional.js.fjsx15 + - match: "" pop: true label: From 9881249a593c84e18398fbd2976d1233c1950fb6 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Thu, 28 Dec 2017 14:16:52 -0200 Subject: [PATCH 308/407] [FJSX15] Normalize decorator meta scope --- syntaxes/fjsx15/decorator.sublime-syntax | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/decorator.sublime-syntax b/syntaxes/fjsx15/decorator.sublime-syntax index c5be8100..661c3780 100644 --- a/syntaxes/fjsx15/decorator.sublime-syntax +++ b/syntaxes/fjsx15/decorator.sublime-syntax @@ -53,7 +53,10 @@ contexts: ({{decoratorIdentifier}}) captures: 1: variable.annotation.js.fjsx15 - set: possible-chain + set: [ + possible-chain, + meta-scope + ] arguments: - include: Packages/Naomi/syntaxes/fjsx15/function-call/arguments.sublime-syntax From 0c4f490c321b60c9cf5477993681e4b112ad3d23 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Thu, 28 Dec 2017 14:17:30 -0200 Subject: [PATCH 309/407] [FJSX15] Normalize section group scope --- syntaxes/fjsx15/expression.sublime-syntax | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/syntaxes/fjsx15/expression.sublime-syntax b/syntaxes/fjsx15/expression.sublime-syntax index ec88dbe6..f8ad7e56 100644 --- a/syntaxes/fjsx15/expression.sublime-syntax +++ b/syntaxes/fjsx15/expression.sublime-syntax @@ -37,7 +37,7 @@ contexts: # Open new expression group. - match: "{{expressionGroupBegin}}" captures: - 1: punctuation.definition.expression.group.begin.js.fjsx15 + 1: punctuation.section.group.begin.js.fjsx15 set: open-group # Start of the expression. - match: "{{expressionBegin}}" @@ -72,7 +72,7 @@ contexts: # Open new expression group. - match: "{{expressionGroupBegin}}" captures: - 1: punctuation.definition.expression.group.begin.js.fjsx15 + 1: punctuation.section.group.begin.js.fjsx15 push: open-group # Close the current expression group. - include: close-group @@ -83,7 +83,7 @@ contexts: close-group: - match: \s*(\)) captures: - 1: punctuation.definition.expression.group.end.js.fjsx15 + 1: punctuation.section.group.end.js.fjsx15 set: optional-tail globals: From 1bf4263fdb446fd161ac045c7a342bcd99a336d1 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Thu, 28 Dec 2017 14:17:42 -0200 Subject: [PATCH 310/407] [FJSX15] Tone down method greediness --- syntaxes/fjsx15/class/method.sublime-syntax | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/syntaxes/fjsx15/class/method.sublime-syntax b/syntaxes/fjsx15/class/method.sublime-syntax index eb3c4a47..8aade13d 100644 --- a/syntaxes/fjsx15/class/method.sublime-syntax +++ b/syntaxes/fjsx15/class/method.sublime-syntax @@ -24,15 +24,23 @@ variables: indexer: | (\[ - [^\[\]]* + (?> '(?:\'|[^'])*' + | "(?:\"|[^"])*" + | `(?:\`|[^`])*` + | [^'"`\[\]]* + ) \g<-1>? - [^\[\]]* + (?> '(?:\'|[^'])*' + | "(?:\"|[^"])*" + | `(?:\`|[^`])*` + | [^'"`\[\]]* + ) \]) methodIdentifier: | - (?> '.*?(? '(?:\'|[^'])*' + | "(?:\"|[^"])*" + | `(?:\`|[^`])*` | {{indexer}} | {{commonIdentifier}} ) From 486942c162f5bc2fc65be1377fe395e46059168b Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Thu, 28 Dec 2017 14:18:00 -0200 Subject: [PATCH 311/407] [FJSX15] Normalize new.target scope --- syntaxes/fjsx15/operator/new.sublime-syntax | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/operator/new.sublime-syntax b/syntaxes/fjsx15/operator/new.sublime-syntax index c9d30937..b706e694 100644 --- a/syntaxes/fjsx15/operator/new.sublime-syntax +++ b/syntaxes/fjsx15/operator/new.sublime-syntax @@ -31,7 +31,7 @@ contexts: \s*(\.) \s*(target) captures: - 1: keyword.operator.word.new.js.fjsx15 + 1: support.type.object.js.fjsx15 2: punctuation.accessor.js.fjsx15 3: support.constant.js.fjsx15 pop: true From 157f0060d49bc809226959d9aa0264b17f3a0a8c Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Thu, 28 Dec 2017 22:15:56 -0200 Subject: [PATCH 312/407] [FJSX15] Stop modifiers near colon This is necessary for object literals. --- syntaxes/fjsx15/class/modifier.sublime-syntax | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/syntaxes/fjsx15/class/modifier.sublime-syntax b/syntaxes/fjsx15/class/modifier.sublime-syntax index 32bdd5e7..aa9e8316 100644 --- a/syntaxes/fjsx15/class/modifier.sublime-syntax +++ b/syntaxes/fjsx15/class/modifier.sublime-syntax @@ -22,26 +22,26 @@ contexts: - include: modifiers modifiers: - - match: \s*(static)\b + - match: \s*(static)\b(?!\s*:) captures: 1: storage.modifier.js.fjsx15 set: modifier-trap - - match: \s*(\#) + - match: \s*(\#)(?!\s*:) captures: 1: >- storage.modifier.js.fjsx15 set: modifier-trap - - match: \s*(async)\b + - match: \s*(async)\b(?!\s*:) captures: 1: storage.modifier.js.fjsx15 set: modifier-trap - match: | (?xi)\s* - (get|set)\b + (get|set)\b(?!\s*:) captures: 1: storage.modifier.js.fjsx15 set: modifier-trap - - match: \s*(\*) + - match: \s*(\*)(?!\s*:) captures: 1: storage.modifier.js.fjsx15 set: modifier-trap From 75b5b42c95de6c1a4054fed40a85a0d70194ea4c Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Fri, 29 Dec 2017 10:24:28 -0200 Subject: [PATCH 313/407] [FJSX15] Cleanup statements meta scopes --- syntaxes/fjsx15/statement.sublime-syntax | 104 ++++++++++++++++------- 1 file changed, 71 insertions(+), 33 deletions(-) diff --git a/syntaxes/fjsx15/statement.sublime-syntax b/syntaxes/fjsx15/statement.sublime-syntax index f6eb6b12..52d86c81 100644 --- a/syntaxes/fjsx15/statement.sublime-syntax +++ b/syntaxes/fjsx15/statement.sublime-syntax @@ -47,48 +47,68 @@ contexts: - include: try-catch-finally - include: yield - condition-end: - - match: \s*(\)) - captures: - 1: punctuation.section.group.end.js.fjsx15 - pop: true + optional-statements-and-expressions: + - include: Packages/Naomi/syntaxes/fjsx15/optional-statements-and-expressions.sublime-syntax + + optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax optional-await: - include: Packages/Naomi/syntaxes/fjsx15/operator/await.sublime-syntax#just-pop - match: (?=\s*\S) pop: true - optional-block-statement-or-expression: + optional-block-or-statement-or-expression: - include: block - include: optional-statements-and-expressions - optional-statements-and-expressions: - - include: Packages/Naomi/syntaxes/fjsx15/optional-statements-and-expressions.sublime-syntax - - for-header: - - match: \s*(\() - captures: - 1: punctuation.section.group.begin.js.fjsx15 - set: for-header-end - - for-header-end: - - include: condition-end - - match: "" - push: optional-statements-and-expressions - asi-checked-optional-expression: - match: (?=\s*\n) pop: true - include: optional-expression - optional-expression: - - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax + header-end: + - match: \s*(\)) + captures: + 1: punctuation.section.group.end.js.fjsx15 + pop: true expression-only-header: + - match: \s*(\() + captures: + 1: >- + meta.group.js.fjsx15 + punctuation.section.group.begin.js.fjsx15 + set: [ + meta-group, + header-end, + optional-expression + ] + + statements-and-expressions-header: - match: \s*(\() captures: 1: punctuation.section.group.begin.js.fjsx15 - set: [ condition-end, optional-expression ] + set: [ + meta-group, + header-end, + optional-statements-and-expressions + ] + + meta-group: + - meta_content_scope: meta.group.js.fjsx15 + - match: "" + pop: true + + meta-conditional: + - meta_content_scope: meta.conditional.js.fjsx15 + - match: "" + pop: true + + meta-switch: + - meta_content_scope: meta.switch.js.fjsx15 + - match: "" + pop: true optional-expression-only-header: - include: expression-only-header @@ -101,7 +121,10 @@ contexts: 1: >- meta.block.js.fjsx15 punctuation.section.block.begin.js.fjsx15 - set: [ block-end, optional-statements-and-expressions ] + set: [ + block-end, + optional-statements-and-expressions + ] block-end: - meta_content_scope: meta.block.js.fjsx15 @@ -151,30 +174,42 @@ contexts: captures: 1: keyword.control.loop.js.fjsx15 set: [ - for-header, + statements-and-expressions-header, optional-await ] if-else: - match: \s*(if)\b captures: - 1: keyword.control.conditional.js.fjsx15 + 1: >- + meta.conditional.js.fjsx15 + keyword.control.conditional.js.fjsx15 set: [ meta-conditional, - optional-block-statement-or-expression, + optional-block-or-statement-or-expression, expression-only-header ] - match: \s*(else)\b captures: + 0: meta.conditional.js.fjsx15 1: keyword.control.conditional.js.fjsx15 set: [ - optional-block-statement-or-expression + meta-conditional, + else-body, ] - meta-conditional: - - meta_scope: meta.conditional.js.fjsx15 - - match: "" - pop: true + else-body: + - include: no-meta-if + - include: optional-block-or-statement-or-expression + + no-meta-if: + - match: \s*(if)\b + captures: + 1: keyword.control.conditional.js.fjsx15 + set: [ + optional-block-or-statement-or-expression, + expression-only-header + ] label: - match: | @@ -196,7 +231,10 @@ contexts: - match: \s*(switch)\b captures: 1: keyword.control.switch.js.fjsx15 - set: expression-only-header + set: [ + meta-switch, + expression-only-header + ] - match: \s*(case)\b captures: 1: keyword.control.switch.js.fjsx15 From c1655fa0bd7640559e3f7db075fa937a10dc8e99 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Fri, 29 Dec 2017 19:37:21 -0200 Subject: [PATCH 314/407] [FJSX15] Add indexer to flow objects --- syntaxes/flow1/object.sublime-syntax | 1 + 1 file changed, 1 insertion(+) diff --git a/syntaxes/flow1/object.sublime-syntax b/syntaxes/flow1/object.sublime-syntax index 78f3d87b..f3945205 100644 --- a/syntaxes/flow1/object.sublime-syntax +++ b/syntaxes/flow1/object.sublime-syntax @@ -77,6 +77,7 @@ contexts: pop: true - include: Packages/Naomi/syntaxes/fjsx15/class/modifier.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/class/method.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/indexer.sublime-syntax - include: constant - include: variable # String property name. From ec70eaf0103716b330fe423d5e8843073eb0f338 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Fri, 29 Dec 2017 19:37:47 -0200 Subject: [PATCH 315/407] [FJSX15] Change indexer priority in classes --- syntaxes/fjsx15/class/body.sublime-syntax | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/class/body.sublime-syntax b/syntaxes/fjsx15/class/body.sublime-syntax index c1bbb4ae..d6777d53 100644 --- a/syntaxes/fjsx15/class/body.sublime-syntax +++ b/syntaxes/fjsx15/class/body.sublime-syntax @@ -49,8 +49,8 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/react-js.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/class/modifier.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/class/method.sublime-syntax - - include: Packages/Naomi/syntaxes/flow1/indexer.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/class/property.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/indexer.sublime-syntax - match: (?=\s*\S) pop: true From dfd6bee1b34f64466cccf833450908b64256c1b9 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 30 Dec 2017 18:55:18 -0200 Subject: [PATCH 316/407] [FJSX15] Fix generic refinement --- .../flow1/template/parameters.sublime-syntax | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/syntaxes/flow1/template/parameters.sublime-syntax b/syntaxes/flow1/template/parameters.sublime-syntax index 83a63486..9f2a8f3e 100644 --- a/syntaxes/flow1/template/parameters.sublime-syntax +++ b/syntaxes/flow1/template/parameters.sublime-syntax @@ -17,12 +17,30 @@ hidden: true scope: ... +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + contexts: main: - match: \s*(<) captures: 1: punctuation.definition.generic.begin.flow - set: [ delimiters, optional-type-expression ] + set: [ delimiters, generic-identifier ] + + generic-identifier: + - match: | + (?xi) + \s*({{commonIdentifier}}) + captures: + 1: variable.other.type.flow + set: optional-refinement + + optional-refinement: + - include: Packages/Naomi/syntaxes/flow1/associated-type.sublime-syntax + - match: (?=\s*\S) + pop: true delimiters: - meta_scope: meta.generic.flow From dc161edb331fdbb5dcf06f9c605786e69d5e95b2 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 30 Dec 2017 18:55:35 -0200 Subject: [PATCH 317/407] [FLOW] Add typeof --- syntaxes/flow1/operator.sublime-syntax | 1 + syntaxes/flow1/operator/typeof.sublime-syntax | 28 +++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 syntaxes/flow1/operator/typeof.sublime-syntax diff --git a/syntaxes/flow1/operator.sublime-syntax b/syntaxes/flow1/operator.sublime-syntax index d62a9755..5176c675 100644 --- a/syntaxes/flow1/operator.sublime-syntax +++ b/syntaxes/flow1/operator.sublime-syntax @@ -19,6 +19,7 @@ scope: ... contexts: main: + - include: Packages/Naomi/syntaxes/flow1/operator/typeof.sublime-syntax - include: Packages/Naomi/syntaxes/flow1/operator/intersection.sublime-syntax - include: Packages/Naomi/syntaxes/flow1/operator/nullable.sublime-syntax - include: Packages/Naomi/syntaxes/flow1/operator/union.sublime-syntax diff --git a/syntaxes/flow1/operator/typeof.sublime-syntax b/syntaxes/flow1/operator/typeof.sublime-syntax new file mode 100644 index 00000000..a8e3cf41 --- /dev/null +++ b/syntaxes/flow1/operator/typeof.sublime-syntax @@ -0,0 +1,28 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +contexts: + main: + - match: (?i)\s*(typeof)\b + captures: + 1: keyword.operator.word.typeof.flow + set: type + + type: + - include: Packages/Naomi/syntaxes/flow1/type-expression.sublime-syntax From c6b9d0a173700036c838309c5ebf4dabc6add6f3 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sat, 30 Dec 2017 19:01:50 -0200 Subject: [PATCH 318/407] Update generic and terminator color --- Candyman.tmTheme | 11 ++++++++++- schemes/candyman/_punctuation.scss | 14 ++++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/Candyman.tmTheme b/Candyman.tmTheme index 03861742..3fe9c45f 100644 --- a/Candyman.tmTheme +++ b/Candyman.tmTheme @@ -2054,13 +2054,22 @@ scope - .punctuation.accessor + .punctuation.accessor, .punctuation.terminator settings foreground #5af158 + + scope + .meta.generic .punctuation.separator.comma, .meta.generic .punctuation.definition.generic + settings + + foreground + #a1887f + + scope .meta.group .punctuation.separator.comma diff --git a/schemes/candyman/_punctuation.scss b/schemes/candyman/_punctuation.scss index 237bf55e..f058a81a 100644 --- a/schemes/candyman/_punctuation.scss +++ b/schemes/candyman/_punctuation.scss @@ -10,8 +10,18 @@ // License for the specific language governing permissions and limitations under // the License. -.punctuation.accessor { - foreground: $green-a200; +.punctuation { + &.accessor, + &.terminator { + foreground: $green-a200; + } +} + +.meta.generic { + .punctuation.separator.comma, + .punctuation.definition.generic { + foreground: $brown-300; + } } .meta.group { From 1efda60598ba5ebfd7d793c7f619be65deb4d8dd Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 31 Dec 2017 00:52:39 -0200 Subject: [PATCH 319/407] Add class declaration color --- schemes/candyman/_class.scss | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/schemes/candyman/_class.scss b/schemes/candyman/_class.scss index 737ca93d..1806faca 100644 --- a/schemes/candyman/_class.scss +++ b/schemes/candyman/_class.scss @@ -16,6 +16,16 @@ } } +.entity.name.class { + foreground: $light-green-300; + background: rgba($light-green-300, .025); +} + +.entity.other.inherited-class { + foreground: $purple-a100; + background: rgba($purple-a100, .025); +} + // .support.type { // foreground: $deep-orange-a100; // fontStyle: italic; From d88ad5aeed249c270d77d5e45fdae0a89a73348f Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 31 Dec 2017 00:52:53 -0200 Subject: [PATCH 320/407] Clean up function colors --- schemes/candyman/_function.scss | 35 +++++++++++---------------------- 1 file changed, 12 insertions(+), 23 deletions(-) diff --git a/schemes/candyman/_function.scss b/schemes/candyman/_function.scss index 7dd650cc..01d85c75 100644 --- a/schemes/candyman/_function.scss +++ b/schemes/candyman/_function.scss @@ -10,36 +10,25 @@ // License for the specific language governing permissions and limitations under // the License. -.variable.function, .entity.name.function { foreground: $light-blue-300; + background: rgba($light-blue-300, .025); +} + +.variable.function { + foreground: $light-blue-300; } .meta.function { - .punctuation.section.block, - .punctuation.section.group, - .punctuation.separator.comma { - foreground: $light-blue-300; + .punctuation { + &.section.block, + &.section.group, + &.separator.comma { + foreground: $light-blue-300; + } } } .support.function { - foreground: $deep-orange-a100; + foreground: $deep-orange-300; } - - - -// .support { -// .entity.name.function, -// .keyword.operator.other.computed-function, -// .punctuation.definition.function { -// foreground: $deep-orange-a100; -// } -// } - -// .function.parameter { -// .entity.name.variable, -// .punctuation.definition.variable { -// foreground: $orange-200; -// } -// } From 71f448bdbc43d2decc921f594ab79cc76d08e08b Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 31 Dec 2017 00:53:09 -0200 Subject: [PATCH 321/407] Add comment, json and string colors --- Candyman.scsscheme | 3 + schemes/candyman/_comment.scss | 24 ++++ schemes/candyman/_json.scss | 214 +++++++++++++++++++++++++++++++++ schemes/candyman/_string.scss | 20 +++ 4 files changed, 261 insertions(+) create mode 100644 schemes/candyman/_comment.scss create mode 100644 schemes/candyman/_json.scss create mode 100644 schemes/candyman/_string.scss diff --git a/Candyman.scsscheme b/Candyman.scsscheme index ae1656a4..20af2b65 100644 --- a/Candyman.scsscheme +++ b/Candyman.scsscheme @@ -20,8 +20,11 @@ @import 'schemes/candyman/annotation'; @import 'schemes/candyman/class'; @import 'schemes/candyman/constant'; +@import 'schemes/candyman/comment'; @import 'schemes/candyman/function'; +@import 'schemes/candyman/json'; @import 'schemes/candyman/number'; @import 'schemes/candyman/punctuation'; +@import 'schemes/candyman/string'; @import 'schemes/candyman/type'; @import 'schemes/candyman/variable'; diff --git a/schemes/candyman/_comment.scss b/schemes/candyman/_comment.scss new file mode 100644 index 00000000..32f7a55a --- /dev/null +++ b/schemes/candyman/_comment.scss @@ -0,0 +1,24 @@ +// Licensed under the Apache License, Version 2.0 (the “License”); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +.comment, +.comment .punctuation.definition { + foreground: $blue-gray-300; +} + +.comment .entity { + &.email, + &.link { + foreground: $blue-gray-100; + } +} + diff --git a/schemes/candyman/_json.scss b/schemes/candyman/_json.scss new file mode 100644 index 00000000..692bcb90 --- /dev/null +++ b/schemes/candyman/_json.scss @@ -0,0 +1,214 @@ +// Licensed under the Apache License, Version 2.0 (the “License”); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +.source.json { + // Root. + .punctuation.section.dictionary { + foreground: $purple-200; + } + + // Level 1. + .meta.structure.dictionary { + .meta.structure.dictionary.key { + .string { + foreground: $cyan-300; + background: rgba($cyan-300, .05); + + .punctuation.definition.string { + foreground: $cyan-300; + } + } + } + } + + // Level 2. + .meta.structure.dictionary + .meta.structure.dictionary + .meta.structure.dictionary { + .punctuation.section.dictionary { + foreground: $cyan-300; + } + + .meta.structure.dictionary.key { + .string { + foreground: $light-green-300; + background: rgba($light-green-300, .05); + + .punctuation.definition.string { + foreground: $light-green-300; + } + } + } + } + + // Level 3. + .meta.structure.dictionary + .meta.structure.dictionary + .meta.structure.dictionary + .meta.structure.dictionary + .meta.structure.dictionary { + .punctuation.section.dictionary { + foreground: $light-green-300; + } + + .meta.structure.dictionary.key { + .string { + foreground: $deep-orange-300; + background: rgba($deep-orange-300, .05); + + .punctuation.definition.string { + foreground: $deep-orange-300; + } + } + } + } + + // Level 4. + .meta.structure.dictionary + .meta.structure.dictionary + .meta.structure.dictionary + .meta.structure.dictionary + .meta.structure.dictionary + .meta.structure.dictionary + .meta.structure.dictionary { + .punctuation.section.dictionary { + foreground: $deep-orange-300; + } + + .meta.structure.dictionary.key { + .string { + foreground: $teal-300; + background: rgba($teal-300, .1); + + .punctuation.definition.string { + foreground: $teal-300; + } + } + } + } + + // Level 5. + .meta.structure.dictionary + .meta.structure.dictionary + .meta.structure.dictionary + .meta.structure.dictionary + .meta.structure.dictionary + .meta.structure.dictionary + .meta.structure.dictionary + .meta.structure.dictionary + .meta.structure.dictionary { + .punctuation.section.dictionary { + foreground: $teal-300; + } + + .meta.structure.dictionary.key { + .string { + foreground: $pink-300; + background: rgba($pink-300, .1); + + .punctuation.definition.string { + foreground: $pink-300; + } + } + } + } + + // Level 6. + .meta.structure.dictionary + .meta.structure.dictionary + .meta.structure.dictionary + .meta.structure.dictionary + .meta.structure.dictionary + .meta.structure.dictionary + .meta.structure.dictionary + .meta.structure.dictionary + .meta.structure.dictionary + .meta.structure.dictionary + .meta.structure.dictionary { + .punctuation.section.dictionary { + foreground: $pink-300; + } + + .meta.structure.dictionary.key { + .string { + foreground: $purple-300; + background: rgba($purple-300, .1); + + .punctuation.definition.string { + foreground: $purple-300; + } + } + } + } + + // Level 7. + .meta.structure.dictionary + .meta.structure.dictionary + .meta.structure.dictionary + .meta.structure.dictionary + .meta.structure.dictionary + .meta.structure.dictionary + .meta.structure.dictionary + .meta.structure.dictionary + .meta.structure.dictionary + .meta.structure.dictionary + .meta.structure.dictionary + .meta.structure.dictionary + .meta.structure.dictionary { + .punctuation.section.dictionary { + foreground: $purple-300; + } + + .meta.structure.dictionary.key { + .string { + foreground: $amber-300; + background: rgba($amber-300, .05); + + .punctuation.definition.string { + foreground: $amber-300; + } + } + } + } + + // Level 8 - n. + .meta.structure.dictionary + .meta.structure.dictionary + .meta.structure.dictionary + .meta.structure.dictionary + .meta.structure.dictionary + .meta.structure.dictionary + .meta.structure.dictionary + .meta.structure.dictionary + .meta.structure.dictionary + .meta.structure.dictionary + .meta.structure.dictionary + .meta.structure.dictionary + .meta.structure.dictionary + .meta.structure.dictionary + .meta.structure.dictionary { + .punctuation.section.dictionary { + foreground: $amber-300; + } + + .meta.structure.dictionary.key { + .string { + foreground: $amber-300; + background: rgba($amber-300, .05); + + .punctuation.definition.string { + foreground: $amber-300; + } + } + } + } +} diff --git a/schemes/candyman/_string.scss b/schemes/candyman/_string.scss new file mode 100644 index 00000000..4aceda39 --- /dev/null +++ b/schemes/candyman/_string.scss @@ -0,0 +1,20 @@ +// Licensed under the Apache License, Version 2.0 (the “License”); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +.string { + foreground: $amber-300; + background: rgba($amber-300, .035); + + .punctuation.definition.string { + foreground: $amber-300; + } +} From 8d7adb414abdcbd3a6b4c645c6a78faffb255576 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 31 Dec 2017 00:53:21 -0200 Subject: [PATCH 322/407] Update candyman build --- Candyman.tmTheme | 307 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 305 insertions(+), 2 deletions(-) diff --git a/Candyman.tmTheme b/Candyman.tmTheme index 3fe9c45f..d0c71f42 100644 --- a/Candyman.tmTheme +++ b/Candyman.tmTheme @@ -1917,6 +1917,28 @@ #aed581 + + scope + .entity.name.class + settings + + background + #AED58106 + foreground + #aed581 + + + + scope + .entity.other.inherited-class + settings + + background + #EA80FC06 + foreground + #ea80fc + + scope .variable.other.constant, .entity.name.constant, .punctuation.definition.constant @@ -1937,7 +1959,36 @@ scope - .variable.function, .entity.name.function + .comment, .comment .punctuation.definition + settings + + foreground + #90a4ae + + + + scope + .comment .entity.email, .comment .entity.link + settings + + foreground + #cfd8dc + + + + scope + .entity.name.function + settings + + background + #4FC3F706 + foreground + #4fc3f7 + + + + scope + .variable.function settings foreground @@ -1959,7 +2010,239 @@ settings foreground - #ff9e80 + #ff8a65 + + + + scope + .source.json .punctuation.section.dictionary + settings + + foreground + #ce93d8 + + + + scope + .source.json .meta.structure.dictionary .meta.structure.dictionary.key .string + settings + + background + #4DD0E10D + foreground + #4dd0e1 + + + + scope + .source.json .meta.structure.dictionary .meta.structure.dictionary.key .string .punctuation.definition.string + settings + + foreground + #4dd0e1 + + + + scope + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .punctuation.section.dictionary + settings + + foreground + #4dd0e1 + + + + scope + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string + settings + + background + #AED5810D + foreground + #aed581 + + + + scope + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string .punctuation.definition.string + settings + + foreground + #aed581 + + + + scope + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .punctuation.section.dictionary + settings + + foreground + #aed581 + + + + scope + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string + settings + + background + #FF8A650D + foreground + #ff8a65 + + + + scope + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string .punctuation.definition.string + settings + + foreground + #ff8a65 + + + + scope + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .punctuation.section.dictionary + settings + + foreground + #ff8a65 + + + + scope + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string + settings + + background + #4DB6AC1A + foreground + #4db6ac + + + + scope + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string .punctuation.definition.string + settings + + foreground + #4db6ac + + + + scope + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .punctuation.section.dictionary + settings + + foreground + #4db6ac + + + + scope + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string + settings + + background + #F062921A + foreground + #f06292 + + + + scope + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string .punctuation.definition.string + settings + + foreground + #f06292 + + + + scope + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .punctuation.section.dictionary + settings + + foreground + #f06292 + + + + scope + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string + settings + + background + #BA68C81A + foreground + #ba68c8 + + + + scope + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string .punctuation.definition.string + settings + + foreground + #ba68c8 + + + + scope + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .punctuation.section.dictionary + settings + + foreground + #ba68c8 + + + + scope + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string + settings + + background + #FFD54F0D + foreground + #ffd54f + + + + scope + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string .punctuation.definition.string + settings + + foreground + #ffd54f + + + + scope + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .punctuation.section.dictionary + settings + + foreground + #ffd54f + + + + scope + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string + settings + + background + #FFD54F0D + foreground + #ffd54f + + + + scope + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string .punctuation.definition.string + settings + + foreground + #ffd54f @@ -2088,6 +2371,26 @@ #ffecb3 + + scope + .string + settings + + background + #FFD54F09 + foreground + #ffd54f + + + + scope + .string .punctuation.definition.string + settings + + foreground + #ffd54f + + scope .variable.other.type From 7198aa330fbd93f3df3df4cfaea51e57c9bef289 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 31 Dec 2017 00:53:47 -0200 Subject: [PATCH 323/407] [FJSX15] Add meta block scope to class and function body --- syntaxes/fjsx15/class/body.sublime-syntax | 4 +++- syntaxes/fjsx15/function/body.sublime-syntax | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/syntaxes/fjsx15/class/body.sublime-syntax b/syntaxes/fjsx15/class/body.sublime-syntax index d6777d53..8580c05e 100644 --- a/syntaxes/fjsx15/class/body.sublime-syntax +++ b/syntaxes/fjsx15/class/body.sublime-syntax @@ -26,7 +26,9 @@ contexts: set: [ body-end, statements-and-expressions ] body-end: - - meta_scope: meta.class.js.fjsx15 + - meta_scope: >- + meta.class.js.fjsx15 + meta.block.js.fjsx15 - include: comment-no-pop - match: \s*(?>(,)|(;)) captures: diff --git a/syntaxes/fjsx15/function/body.sublime-syntax b/syntaxes/fjsx15/function/body.sublime-syntax index 8baec237..913d8b55 100644 --- a/syntaxes/fjsx15/function/body.sublime-syntax +++ b/syntaxes/fjsx15/function/body.sublime-syntax @@ -28,7 +28,9 @@ contexts: ] close-body: - - meta_scope: meta.function.js.fjsx15 + - meta_scope: >- + meta.function.js.fjsx15 + meta.block.js.fjsx15 - match: \s*(}) captures: 1: punctuation.section.block.end.js.fjsx15 From 8382d77e02582732f08f9f17e97abff134550891 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Sun, 31 Dec 2017 01:35:05 -0200 Subject: [PATCH 324/407] [FJSX15] Specialize class modifier --- syntaxes/fjsx15/class.sublime-syntax | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/class.sublime-syntax b/syntaxes/fjsx15/class.sublime-syntax index e9a52bce..6e1f570c 100644 --- a/syntaxes/fjsx15/class.sublime-syntax +++ b/syntaxes/fjsx15/class.sublime-syntax @@ -49,7 +49,7 @@ contexts: # Extensions. - match: \s*(extends)\b captures: - 1: storage.modifier.js.fjsx15 + 1: storage.modifier.extends.js.fjsx15 push: [ optional-template-arguments, target-class-or-namespace From 5397b0342e7d421fbd0da58be7731e7915a0d2ec Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 1 Jan 2018 15:47:08 -0200 Subject: [PATCH 325/407] [FJSX15] Add missing meta scopes --- syntaxes/fjsx15/arrow-function/body.sublime-syntax | 4 +++- syntaxes/fjsx15/function-call/arguments.sublime-syntax | 1 + syntaxes/fjsx15/function/parameters.sublime-syntax | 4 +++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/syntaxes/fjsx15/arrow-function/body.sublime-syntax b/syntaxes/fjsx15/arrow-function/body.sublime-syntax index fe34b893..b5b1f8ef 100644 --- a/syntaxes/fjsx15/arrow-function/body.sublime-syntax +++ b/syntaxes/fjsx15/arrow-function/body.sublime-syntax @@ -33,7 +33,9 @@ contexts: - include: optional-expression close-body: - - meta_scope: meta.function.js.fjsx15 + - meta_scope: >- + meta.function.js.fjsx15 + meta.block.js.fjsx15 - match: \s*(}) captures: 1: punctuation.section.block.end.js.fjsx15 diff --git a/syntaxes/fjsx15/function-call/arguments.sublime-syntax b/syntaxes/fjsx15/function-call/arguments.sublime-syntax index 85c947d0..0646f9f7 100644 --- a/syntaxes/fjsx15/function-call/arguments.sublime-syntax +++ b/syntaxes/fjsx15/function-call/arguments.sublime-syntax @@ -25,6 +25,7 @@ contexts: set: [ delimiter, optional-expression ] delimiter: + - meta_scope: meta.group.js.fjsx15 - match: \s*(\)) captures: 1: punctuation.section.group.end.js.fjsx15 diff --git a/syntaxes/fjsx15/function/parameters.sublime-syntax b/syntaxes/fjsx15/function/parameters.sublime-syntax index 75e4c1a2..fb3fcdb7 100644 --- a/syntaxes/fjsx15/function/parameters.sublime-syntax +++ b/syntaxes/fjsx15/function/parameters.sublime-syntax @@ -25,7 +25,9 @@ contexts: set: [ delimiters, optional-parameter ] delimiters: - - meta_scope: meta.function.parameters.js.fjsx15 + - meta_scope: >- + meta.function.parameters.js.fjsx15 + meta.group.js.fjsx15 - include: comment-no-pop - match: \s*(\,) captures: From 3946cd7e9e1a32a2e72335594fcac79f11f51bec Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 1 Jan 2018 15:47:32 -0200 Subject: [PATCH 326/407] [FJSX15] Normalize flow statements scopes --- syntaxes/fjsx15/statement.sublime-syntax | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/syntaxes/fjsx15/statement.sublime-syntax b/syntaxes/fjsx15/statement.sublime-syntax index 52d86c81..e93bba99 100644 --- a/syntaxes/fjsx15/statement.sublime-syntax +++ b/syntaxes/fjsx15/statement.sublime-syntax @@ -140,11 +140,12 @@ contexts: break-continue: - match: | (?xi) - \s*(break|continue)\b + \s*(?>(break)|(continue))\b (?:\s+({{commonIdentifier}}))? captures: - 1: keyword.control.loop.js.fjsx15 - 2: entity.name.label.js.fjsx15 + 1: keyword.control.flow.break.js.fjsx15 + 2: keyword.control.flow.break.continue.js.fjsx15 + 3: entity.name.label.js.fjsx15 pop: true debugger: @@ -224,7 +225,7 @@ contexts: return: - match: \s*(return)\b captures: - 1: keyword.control.flow.js.fjsx15 + 1: keyword.control.flow.return.js.fjsx15 set: asi-checked-optional-expression switch-case: @@ -252,7 +253,7 @@ contexts: throw: - match: \s*(throw)\b captures: - 1: keyword.control.trycatch.js.fjsx15 + 1: keyword.control.flow.break.throw.js.fjsx15 set: asi-checked-optional-expression try-catch-finally: From 3ac75dc0b2813cd26652c5092dad17954a9fdfa8 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 1 Jan 2018 15:47:49 -0200 Subject: [PATCH 327/407] [FJSX15] Simplify jest globals --- syntaxes/fjsx15/jest.sublime-syntax | 112 ++++++++++++++++++++-------- 1 file changed, 80 insertions(+), 32 deletions(-) diff --git a/syntaxes/fjsx15/jest.sublime-syntax b/syntaxes/fjsx15/jest.sublime-syntax index 81468a7d..bb8bbb76 100644 --- a/syntaxes/fjsx15/jest.sublime-syntax +++ b/syntaxes/fjsx15/jest.sublime-syntax @@ -19,51 +19,98 @@ scope: ... contexts: main: - - include: core - - include: matchers - - include: jest-fn - - arguments: - - include: Packages/Naomi/syntaxes/fjsx15/function-call/arguments.sublime-syntax - - jest-fn: + # jest. - match: | (?x) (?- - support.lib.jest.fjsx15 - entity.name.variable.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 - 3: >- - support.lib.jest.fjsx15 - entity.name.function.js.fjsx15 - set: arguments - - core: + 1: support.type.object.jest.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + set: jest-property-or-function + # afterAll/Each, beforeAll/Each, describe, it, test. - match: | (?x) (? after(?>All|Each) | before(?>All|Each) | describe - | expect | it | test )) - (?:(.)((?>only|skip)))? - (?=\s*\() captures: - 1: support.function.fjsx15 - 2: punctuation.accessor.js.fjsx15 - 3: support.function.fjsx15 - set: arguments + 1: support.function.jest.fn.js.fjsx15 + set: [ + meta-scope, + arguments, + optional-skip-only + ] + # expect + - match: (? Date: Mon, 1 Jan 2018 15:48:19 -0200 Subject: [PATCH 328/407] [FJSX15] Fix function call meta scopes in expressions --- syntaxes/fjsx15/expression.sublime-syntax | 25 ++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/syntaxes/fjsx15/expression.sublime-syntax b/syntaxes/fjsx15/expression.sublime-syntax index f8ad7e56..48b4a55c 100644 --- a/syntaxes/fjsx15/expression.sublime-syntax +++ b/syntaxes/fjsx15/expression.sublime-syntax @@ -108,9 +108,16 @@ contexts: optional-tail: - include: comment-no-pop - include: globals - # Property access and function call. - - match: (?=\s*[\[(]) - set: [ optional-tail, tail ] + # Function call. + - match: (?=\s*\() + set: [ + optional-tail, + function-call-meta-scope, + function-call + ] + # Property access. + - match: (?=\s*\[) + set: [ optional-tail, property-access ] # Other operators. At this point, operators will have a higher priority than # regex literals. - include: Packages/Naomi/syntaxes/fjsx15/operator.sublime-syntax @@ -118,7 +125,15 @@ contexts: - match: (?=\s*\S) pop: true - tail: + function-call-meta-scope: + - meta_scope: meta.function-call.js.fjsx15 + - match: "" + pop: true + + function-call: - include: comment-no-pop - - include: Packages/Naomi/syntaxes/fjsx15/property-access.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function-call/arguments.sublime-syntax + + property-access: + - include: comment-no-pop + - include: Packages/Naomi/syntaxes/fjsx15/property-access.sublime-syntax From e27befa2ab72d87f28a99158f3c2ca3f14dc1044 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 1 Jan 2018 15:48:33 -0200 Subject: [PATCH 329/407] [FJSX15] Rename operator --- syntaxes/fjsx15/operator/other.sublime-syntax | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/operator/other.sublime-syntax b/syntaxes/fjsx15/operator/other.sublime-syntax index 29a0e1ce..df96541c 100644 --- a/syntaxes/fjsx15/operator/other.sublime-syntax +++ b/syntaxes/fjsx15/operator/other.sublime-syntax @@ -22,7 +22,7 @@ contexts: # |:----------:|:--------------------| # | ... | Spread. | # | :: | Bind. | - # | . | Member access. | + # | . | Accessor. | # | ?. | Optional chain. | # | ?? | Nullish coalescing. | # | ? | Ternary. | From 571bd508aba9b16faf470a385c691d594ffb5d18 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 1 Jan 2018 15:48:52 -0200 Subject: [PATCH 330/407] [FLOW] Change existential scope --- syntaxes/flow1/simple.sublime-syntax | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/flow1/simple.sublime-syntax b/syntaxes/flow1/simple.sublime-syntax index 3b5efa76..83ed2765 100644 --- a/syntaxes/flow1/simple.sublime-syntax +++ b/syntaxes/flow1/simple.sublime-syntax @@ -28,7 +28,7 @@ contexts: # Existential. - match: \s*(\*) captures: - 1: entity.name.type.existential.flow + 1: support.type.existential.flow pop: true # Predefined types. - match: | From 8f75fbfaa35053ffadd8207f6ca01c740556618f Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 1 Jan 2018 15:56:54 -0200 Subject: [PATCH 331/407] Add helper function --- Candyman.scsscheme | 1 + schemes/candyman/_repeatString.scss | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 schemes/candyman/_repeatString.scss diff --git a/Candyman.scsscheme b/Candyman.scsscheme index 20af2b65..81c73e15 100644 --- a/Candyman.scsscheme +++ b/Candyman.scsscheme @@ -12,6 +12,7 @@ @name 'Candyman'; @import 'schemes/candyman/palette'; +@import 'schemes/candyman/repeatString'; // Old scopes. @import 'schemes/candyman/old'; diff --git a/schemes/candyman/_repeatString.scss b/schemes/candyman/_repeatString.scss new file mode 100644 index 00000000..59e5204f --- /dev/null +++ b/schemes/candyman/_repeatString.scss @@ -0,0 +1,29 @@ +// Licensed under the Apache License, Version 2.0 (the “License”); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +@function repeatString($string, $times, $separator: ' ') { + @if $times <= 0 { + @return ''; + } + + $i: 0; + $result: ''; + @while $i < $times { + @if $i > 0 { + $result: $result + $separator; + } + $result: $result + $string; + $i: $i + 1; + } + + @return $result; +} From 08c2199e26e9cdb678b0fb6971bcb8a1bed3bbfa Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 1 Jan 2018 16:07:31 -0200 Subject: [PATCH 332/407] Add globals color --- Candyman.scsscheme | 2 + schemes/candyman/global/_console.scss | 68 +++++++++++++++++++++++++++ schemes/candyman/global/_jest.scss | 61 ++++++++++++++++++++++++ 3 files changed, 131 insertions(+) create mode 100644 schemes/candyman/global/_console.scss create mode 100644 schemes/candyman/global/_jest.scss diff --git a/Candyman.scsscheme b/Candyman.scsscheme index 81c73e15..9003c3c8 100644 --- a/Candyman.scsscheme +++ b/Candyman.scsscheme @@ -23,6 +23,8 @@ @import 'schemes/candyman/constant'; @import 'schemes/candyman/comment'; @import 'schemes/candyman/function'; +@import 'schemes/candyman/global/console'; +@import 'schemes/candyman/global/jest'; @import 'schemes/candyman/json'; @import 'schemes/candyman/number'; @import 'schemes/candyman/punctuation'; diff --git a/schemes/candyman/global/_console.scss b/schemes/candyman/global/_console.scss new file mode 100644 index 00000000..977fb481 --- /dev/null +++ b/schemes/candyman/global/_console.scss @@ -0,0 +1,68 @@ +// Licensed under the Apache License, Version 2.0 (the “License”); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +.support.function.console { + &.error { + foreground: $red-300; + } + + &.info { + foreground: $teal-300; + } + + &.log { + foreground: $brown-200; + } + + &.warn { + foreground: $deep-orange-300; + } +} + +// Console function call punctuations. +.meta.function-call.console { + &.error .meta.group { + .punctuation { + &.section.group, + &.separator.comma { + foreground: $red-300; + } + } + } + + &.info .meta.group { + .punctuation { + &.section.group, + &.separator.comma { + foreground: $teal-300; + } + } + } + + &.log .meta.group { + .punctuation { + &.section.group, + &.separator.comma { + foreground: $brown-200; + } + } + } + + &.warn .meta.group { + .punctuation { + &.section.group, + &.separator.comma { + foreground: $deep-orange-300; + } + } + } +} diff --git a/schemes/candyman/global/_jest.scss b/schemes/candyman/global/_jest.scss new file mode 100644 index 00000000..7e20aba3 --- /dev/null +++ b/schemes/candyman/global/_jest.scss @@ -0,0 +1,61 @@ +// Licensed under the Apache License, Version 2.0 (the “License”); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +.support.type.object.jest { + foreground: $deep-orange-300; + background: rgba($deep-orange-300, .1); + + &.matcher.not { + foreground: $red-300; + fontStyle: bold; + } +} + +.support.function.jest { + foreground: $pink-300; + + &.matcher { + foreground: $green-200; + } + + &.skip, + &.only { + foreground: $red-300; + background: rgba($deep-orange-300, .1); + fontStyle: bold; + } +} + +// Global function call punctuation. +@for $i from 0 through 7 { + #{repeatString('.meta.function', $i)} + .meta.function-call.jest + .meta.group { + .punctuation { + &.section.group, + &.separator.comma { + foreground: $pink-300; + } + } + } +} + +// Matcher function call punctuation. +.meta.function-call.jest.matcher +.meta.group { + .punctuation { + &.section.group, + &.separator.comma { + foreground: $green-200; + } + } +} From 95a6d7794e6aa16a9e975803ef0b2515adeb9d18 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 1 Jan 2018 16:07:59 -0200 Subject: [PATCH 333/407] Add rules for function parameters and punctuation --- Candyman.scsscheme | 1 + schemes/candyman/_punctuation.scss | 115 +++++++++++++++++++-- schemes/candyman/_variable.scss | 5 - schemes/candyman/function/_parameters.scss | 35 +++++++ 4 files changed, 143 insertions(+), 13 deletions(-) create mode 100644 schemes/candyman/function/_parameters.scss diff --git a/Candyman.scsscheme b/Candyman.scsscheme index 9003c3c8..bdebeafa 100644 --- a/Candyman.scsscheme +++ b/Candyman.scsscheme @@ -23,6 +23,7 @@ @import 'schemes/candyman/constant'; @import 'schemes/candyman/comment'; @import 'schemes/candyman/function'; +@import 'schemes/candyman/function/parameters'; @import 'schemes/candyman/global/console'; @import 'schemes/candyman/global/jest'; @import 'schemes/candyman/json'; diff --git a/schemes/candyman/_punctuation.scss b/schemes/candyman/_punctuation.scss index f058a81a..d370166d 100644 --- a/schemes/candyman/_punctuation.scss +++ b/schemes/candyman/_punctuation.scss @@ -15,6 +15,37 @@ &.terminator { foreground: $green-a200; } + + &.separator.comma, + &.section.group { + foreground: $amber-100; + } +} + +// Group inside function parameters. +@for $i from 1 through 7 { + #{repeatString('meta.function.parameters meta.group', $i)} + .meta.group { + .punctuation { + &.section.group, + &.separator.comma { + foreground: $amber-100; + } + } + } +} + +// Group inside function call. +@for $i from 1 through 7 { + #{repeatString('meta.function-call meta.group', $i)} + .meta.group { + .punctuation { + &.section.group, + &.separator.comma { + foreground: $amber-100; + } + } + } } .meta.generic { @@ -24,14 +55,82 @@ } } -.meta.group { - .punctuation.separator.comma { - foreground: $green-a200; - } - .punctuation.section.group { - foreground: $amber-100; - } -} +// Groups inside function calls. +// @for $i from 1 through 100 { +// .animation#{$i} { +// animation-delay: random(100) * 0.1 + s !important; +// animation-duration: max(random(20), 10) + s; +// animation-iteration-count: infinite; +// animation-name: pulsatingBlock; +// } +// } + + +// .meta.function-call +// .meta.group +// .meta.group, + +// .meta.function-call +// .meta.group +// .meta.function-call +// .meta.group +// .meta.group, + +// .meta.function-call +// .meta.group +// .meta.function-call +// .meta.group +// .meta.function-call +// .meta.group +// .meta.group, + +// .meta.function-call +// .meta.group +// .meta.function-call +// .meta.group +// .meta.function-call +// .meta.group +// .meta.function-call +// .meta.group +// .meta.group, + +// .meta.function-call +// .meta.group +// .meta.function-call +// .meta.group +// .meta.function-call +// .meta.group +// .meta.function-call +// .meta.group +// .meta.function-call +// .meta.group +// .meta.group { +// .punctuation { +// &.separator.comma { +// foreground: $green-a200; +// } +// &.section.group { +// foreground: $amber-100; +// } +// } +// } + + +// .meta.conditional { +// .meta.block +// .punctuation.section.block { +// foreground: $green-200; +// } + +// .meta.group { +// .punctuation { +// &.separator.comma, +// &.section.group { +// foreground: $green-200; +// } +// } +// } +// } // .punctuation.other.property.access { // foreground: $light-green-300; diff --git a/schemes/candyman/_variable.scss b/schemes/candyman/_variable.scss index eed1cb0e..41c6086f 100644 --- a/schemes/candyman/_variable.scss +++ b/schemes/candyman/_variable.scss @@ -20,8 +20,3 @@ .support.variable { foreground: $deep-orange-a100; } - - -.variable.parameter.function { - foreground: $orange-200; -} diff --git a/schemes/candyman/function/_parameters.scss b/schemes/candyman/function/_parameters.scss new file mode 100644 index 00000000..4378dd50 --- /dev/null +++ b/schemes/candyman/function/_parameters.scss @@ -0,0 +1,35 @@ +// Licensed under the Apache License, Version 2.0 (the “License”); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +.variable.parameter.function { + foreground: $orange-200; +} + +.meta.function.parameters { + .punctuation.section.group { + foreground: $light-blue-300; + } +} + +// Function parameters of a function inside groups. +@for $i from 1 through 7 { + #{repeatString('meta.group', $i)} + .meta.function.parameters + .meta.group { + .punctuation { + &.section.group, + &.separator.comma { + foreground: $light-blue-300; + } + } + } +} From ca5b63d314ba171701b8beb0d8974c525ed4d26a Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 1 Jan 2018 16:09:04 -0200 Subject: [PATCH 334/407] Add rules for class body --- Candyman.scsscheme | 1 + schemes/candyman/class/_body.scss | 37 ++++++++++++++++++++++++ schemes/candyman/function/_body.scss | 42 ++++++++++++++++++++++++++++ 3 files changed, 80 insertions(+) create mode 100644 schemes/candyman/class/_body.scss create mode 100644 schemes/candyman/function/_body.scss diff --git a/Candyman.scsscheme b/Candyman.scsscheme index bdebeafa..ac9e33e4 100644 --- a/Candyman.scsscheme +++ b/Candyman.scsscheme @@ -21,6 +21,7 @@ @import 'schemes/candyman/annotation'; @import 'schemes/candyman/class'; @import 'schemes/candyman/constant'; +@import 'schemes/candyman/class/body'; @import 'schemes/candyman/comment'; @import 'schemes/candyman/function'; @import 'schemes/candyman/function/parameters'; diff --git a/schemes/candyman/class/_body.scss b/schemes/candyman/class/_body.scss new file mode 100644 index 00000000..f908d6ef --- /dev/null +++ b/schemes/candyman/class/_body.scss @@ -0,0 +1,37 @@ +// Licensed under the Apache License, Version 2.0 (the “License”); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +.meta.class { + .punctuation.section.block { + foreground: $light-green-300; + } +} + +/** + * Inside function. + */ + +// Level 1. +.meta.function .meta.class { + .punctuation.section.block { + foreground: $light-green-300; + } +} +// Level 2 - N. +@for $i from 1 through 7 { + #{repeatString('.meta.class .meta.function ', $i)} + .meta.class { + .punctuation.section.block { + foreground: $light-green-300; + } + } +} diff --git a/schemes/candyman/function/_body.scss b/schemes/candyman/function/_body.scss new file mode 100644 index 00000000..06357f7a --- /dev/null +++ b/schemes/candyman/function/_body.scss @@ -0,0 +1,42 @@ +// Licensed under the Apache License, Version 2.0 (the “License”); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +.storage.type.function.arrow { + foreground: $light-blue-300; +} + +.meta.function { + .punctuation.section.block { + foreground: $light-blue-300; + } +} + +/** + * Inside classes. + */ + +// Level 1. +.meta.class .meta.function { + .punctuation.section.block { + foreground: $light-blue-300; + } +} + +// Level 2 - N. +@for $i from 1 through 7 { + #{repeatString('.meta.function .meta.class', $i)} + .meta.function { + .punctuation.section.block { + foreground: $light-blue-300; + } + } +} From a31f1176292364c12f78251c8ae2d83b9ec8d1aa Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 1 Jan 2018 16:09:25 -0200 Subject: [PATCH 335/407] Add rules for function call --- Candyman.scsscheme | 1 + schemes/candyman/_function-call.scss | 34 ++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 schemes/candyman/_function-call.scss diff --git a/Candyman.scsscheme b/Candyman.scsscheme index ac9e33e4..cc85de3f 100644 --- a/Candyman.scsscheme +++ b/Candyman.scsscheme @@ -24,6 +24,7 @@ @import 'schemes/candyman/class/body'; @import 'schemes/candyman/comment'; @import 'schemes/candyman/function'; +@import 'schemes/candyman/function-call'; @import 'schemes/candyman/function/parameters'; @import 'schemes/candyman/global/console'; @import 'schemes/candyman/global/jest'; diff --git a/schemes/candyman/_function-call.scss b/schemes/candyman/_function-call.scss new file mode 100644 index 00000000..ea6633ef --- /dev/null +++ b/schemes/candyman/_function-call.scss @@ -0,0 +1,34 @@ +// Licensed under the Apache License, Version 2.0 (the “License”); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +.meta.function-call { + .punctuation { + &.section.group, + &.separator.comma { + foreground: $light-blue-300; + } + } +} + +// Function call inside groups. +@for $i from 1 through 7 { + #{repeatString('meta.group', $i)} + .meta.function-call + .meta.group { + .punctuation { + &.section.group, + &.separator.comma { + foreground: $light-blue-300; + } + } + } +} From 2554627255d9c79a7d210d7ece6a1e8a9fea97f1 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 1 Jan 2018 16:09:39 -0200 Subject: [PATCH 336/407] Link function body new rules --- Candyman.scsscheme | 1 + 1 file changed, 1 insertion(+) diff --git a/Candyman.scsscheme b/Candyman.scsscheme index cc85de3f..5638b3c9 100644 --- a/Candyman.scsscheme +++ b/Candyman.scsscheme @@ -25,6 +25,7 @@ @import 'schemes/candyman/comment'; @import 'schemes/candyman/function'; @import 'schemes/candyman/function-call'; +@import 'schemes/candyman/function/body'; @import 'schemes/candyman/function/parameters'; @import 'schemes/candyman/global/console'; @import 'schemes/candyman/global/jest'; From 42001709e9e65bba4b2d8170eac08b07833122ac Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 1 Jan 2018 16:10:00 -0200 Subject: [PATCH 337/407] Add rule for regexp --- schemes/candyman/_string.scss | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/schemes/candyman/_string.scss b/schemes/candyman/_string.scss index 4aceda39..d6cfebc9 100644 --- a/schemes/candyman/_string.scss +++ b/schemes/candyman/_string.scss @@ -18,3 +18,13 @@ foreground: $amber-300; } } + + +.string.regexp { + foreground: $teal-300; + background: rgba($teal-300, .035); + + .punctuation.definition.string { + foreground: $teal-300; + } +} From b24a5da1b49a8acf28b24b7f52ecd4af0a612e69 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 1 Jan 2018 16:11:10 -0200 Subject: [PATCH 338/407] Cleanup --- Candyman.scsscheme | 2 +- schemes/candyman/_class.scss | 46 --------------------------------- schemes/candyman/_function.scss | 10 ------- 3 files changed, 1 insertion(+), 57 deletions(-) diff --git a/Candyman.scsscheme b/Candyman.scsscheme index 5638b3c9..94dc6c2c 100644 --- a/Candyman.scsscheme +++ b/Candyman.scsscheme @@ -20,9 +20,9 @@ // New scopes. @import 'schemes/candyman/annotation'; @import 'schemes/candyman/class'; -@import 'schemes/candyman/constant'; @import 'schemes/candyman/class/body'; @import 'schemes/candyman/comment'; +@import 'schemes/candyman/constant'; @import 'schemes/candyman/function'; @import 'schemes/candyman/function-call'; @import 'schemes/candyman/function/body'; diff --git a/schemes/candyman/_class.scss b/schemes/candyman/_class.scss index 1806faca..b4e7f766 100644 --- a/schemes/candyman/_class.scss +++ b/schemes/candyman/_class.scss @@ -10,12 +10,6 @@ // License for the specific language governing permissions and limitations under // the License. -.meta.class { - .punctuation.section.block { - foreground: $light-green-300; - } -} - .entity.name.class { foreground: $light-green-300; background: rgba($light-green-300, .025); @@ -25,43 +19,3 @@ foreground: $purple-a100; background: rgba($purple-a100, .025); } - -// .support.type { -// foreground: $deep-orange-a100; -// fontStyle: italic; -// } - -// foreground: $light-green-300; - -// .meta.group { -// .punctuation.separator.comma { -// foreground: $green-a200; -// } -// .punctuation.section.group { -// foreground: $amber-100; -// } -// } - -// .meta.function { -// &.parameters { -// .punctuation.section.group { -// foreground: $light-blue-300; -// } -// } - -// .punctuation.section.block { -// foreground: $light-blue-300; -// } -// .punctuation.other.property.access { -// foreground: $light-green-300; -// } - -// .punctuation.definition.block, -// .punctuation.definition.control { -// foreground: $pink-a100; -// } - -// .punctuation.definition.extend-list.separator, -// .punctuation.definition.implement-list.separator { -// foreground: $purple-200; -// } diff --git a/schemes/candyman/_function.scss b/schemes/candyman/_function.scss index 01d85c75..22eee984 100644 --- a/schemes/candyman/_function.scss +++ b/schemes/candyman/_function.scss @@ -19,16 +19,6 @@ foreground: $light-blue-300; } -.meta.function { - .punctuation { - &.section.block, - &.section.group, - &.separator.comma { - foreground: $light-blue-300; - } - } -} - .support.function { foreground: $deep-orange-300; } From 6446e8fdb62214419b182a6b7d50db8cf7d760df Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 1 Jan 2018 16:11:42 -0200 Subject: [PATCH 339/407] Change annotations color --- schemes/candyman/_annotation.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schemes/candyman/_annotation.scss b/schemes/candyman/_annotation.scss index 330ec1e4..72a85472 100644 --- a/schemes/candyman/_annotation.scss +++ b/schemes/candyman/_annotation.scss @@ -15,7 +15,7 @@ .punctuation.section.group, .punctuation.separator.comma, .punctuation.definition.annotation { - foreground: $deep-purple-200; + foreground: $purple-a100; fontStyle: italic; } } From 5cd3d3effa1b7229e313dc1a626c439bf1511338 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 1 Jan 2018 17:09:58 -0200 Subject: [PATCH 340/407] Add array rules --- Candyman.scsscheme | 1 + schemes/candyman/_array.scss | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 schemes/candyman/_array.scss diff --git a/Candyman.scsscheme b/Candyman.scsscheme index 94dc6c2c..86c7cda4 100644 --- a/Candyman.scsscheme +++ b/Candyman.scsscheme @@ -19,6 +19,7 @@ // New scopes. @import 'schemes/candyman/annotation'; +@import 'schemes/candyman/array'; @import 'schemes/candyman/class'; @import 'schemes/candyman/class/body'; @import 'schemes/candyman/comment'; diff --git a/schemes/candyman/_array.scss b/schemes/candyman/_array.scss new file mode 100644 index 00000000..eb2efc33 --- /dev/null +++ b/schemes/candyman/_array.scss @@ -0,0 +1,20 @@ +// Licensed under the Apache License, Version 2.0 (the “License”); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +.meta.sequence +.punctuation { + &.section.brackets, + &.separator.comma { + foreground: $deep-orange-300; + fontStyle: italic bold; + } +} From b0f57a8b0e4ff06390f797f1ff65cf31d10d845d Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 1 Jan 2018 17:10:16 -0200 Subject: [PATCH 341/407] Add keyword rules --- Candyman.scsscheme | 2 ++ schemes/candyman/_keyword.scss | 37 +++++++++++++++++++++++++++++++++ schemes/candyman/_modifier.scss | 19 +++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 schemes/candyman/_keyword.scss create mode 100644 schemes/candyman/_modifier.scss diff --git a/Candyman.scsscheme b/Candyman.scsscheme index 86c7cda4..0037a6dc 100644 --- a/Candyman.scsscheme +++ b/Candyman.scsscheme @@ -31,6 +31,8 @@ @import 'schemes/candyman/global/console'; @import 'schemes/candyman/global/jest'; @import 'schemes/candyman/json'; +@import 'schemes/candyman/keyword'; +@import 'schemes/candyman/modifier'; @import 'schemes/candyman/number'; @import 'schemes/candyman/punctuation'; @import 'schemes/candyman/string'; diff --git a/schemes/candyman/_keyword.scss b/schemes/candyman/_keyword.scss new file mode 100644 index 00000000..8f596c74 --- /dev/null +++ b/schemes/candyman/_keyword.scss @@ -0,0 +1,37 @@ +// Licensed under the Apache License, Version 2.0 (the “License”); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +.keyword { + foreground: $pink-a100; +} + +.keyword.control.conditional { + foreground: $green-200; +} + +.keyword.control.flow { + foreground: $deep-orange-300; + background: rgba($deep-orange-300, .05); + fontStyle: italic; +} + +.keyword.control.loop { + foreground: $orange-300; + background: rgba($orange-300, .05); + fontStyle: italic; +} + +.keyword.control.trycatch { + foreground: $pink-300; + background: rgba($pink-300, .05); + fontStyle: italic; +} diff --git a/schemes/candyman/_modifier.scss b/schemes/candyman/_modifier.scss new file mode 100644 index 00000000..c870310f --- /dev/null +++ b/schemes/candyman/_modifier.scss @@ -0,0 +1,19 @@ +// Licensed under the Apache License, Version 2.0 (the “License”); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +.storage { + &.modifier + &.type { + foreground: $deep-purple-200; + fontStyle: italic; + } +} From 952037c426548ca06974b17182c52015ec2bccd9 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 1 Jan 2018 17:10:30 -0200 Subject: [PATCH 342/407] [FJSX15] Fix array literal scopes typo --- syntaxes/fjsx15/literal/array.sublime-syntax | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/syntaxes/fjsx15/literal/array.sublime-syntax b/syntaxes/fjsx15/literal/array.sublime-syntax index fd6dac7f..fd460d76 100644 --- a/syntaxes/fjsx15/literal/array.sublime-syntax +++ b/syntaxes/fjsx15/literal/array.sublime-syntax @@ -21,18 +21,18 @@ contexts: main: - match: \s*(\[) captures: - 1: punctionation.section.brackets.begin.js.fjsx15 + 1: punctuation.section.brackets.begin.js.fjsx15 set: [ delimiters, optional-expression ] delimiters: - meta_scope: meta.sequence.js.fjsx15 - match: \s*(]) captures: - 1: punctionation.section.brackets.end.js.fjsx15 + 1: punctuation.section.brackets.end.js.fjsx15 pop: true - match: \s*(,) captures: - 1: punctuation.separator.js.fjsx15 + 1: punctuation.separator.comma.js.fjsx15 push: optional-expression optional-expression: From 9aeca8d02dfd63353ff641f89d3a10c763deaf80 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 1 Jan 2018 17:33:40 -0200 Subject: [PATCH 343/407] Make comments darker --- schemes/candyman/_comment.scss | 3 +-- schemes/candyman/_function-call.scss | 2 ++ schemes/candyman/_punctuation.scss | 4 ++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/schemes/candyman/_comment.scss b/schemes/candyman/_comment.scss index 32f7a55a..9becaea4 100644 --- a/schemes/candyman/_comment.scss +++ b/schemes/candyman/_comment.scss @@ -12,7 +12,7 @@ .comment, .comment .punctuation.definition { - foreground: $blue-gray-300; + foreground: $blue-gray-500; } .comment .entity { @@ -21,4 +21,3 @@ foreground: $blue-gray-100; } } - diff --git a/schemes/candyman/_function-call.scss b/schemes/candyman/_function-call.scss index ea6633ef..49b2a616 100644 --- a/schemes/candyman/_function-call.scss +++ b/schemes/candyman/_function-call.scss @@ -15,6 +15,7 @@ &.section.group, &.separator.comma { foreground: $light-blue-300; + fontStyle: bold; } } } @@ -28,6 +29,7 @@ &.section.group, &.separator.comma { foreground: $light-blue-300; + fontStyle: bold; } } } diff --git a/schemes/candyman/_punctuation.scss b/schemes/candyman/_punctuation.scss index d370166d..616bd76a 100644 --- a/schemes/candyman/_punctuation.scss +++ b/schemes/candyman/_punctuation.scss @@ -14,11 +14,13 @@ &.accessor, &.terminator { foreground: $green-a200; + fontStyle: bold; } &.separator.comma, &.section.group { foreground: $amber-100; + fontStyle: none; } } @@ -30,6 +32,7 @@ &.section.group, &.separator.comma { foreground: $amber-100; + fontStyle: none; } } } @@ -43,6 +46,7 @@ &.section.group, &.separator.comma { foreground: $amber-100; + fontStyle: none; } } } From 196caef0e690cc97f873746d756c691b1abe712b Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 1 Jan 2018 21:42:56 -0200 Subject: [PATCH 344/407] [FJSX15] FIx object literal meta scope --- syntaxes/fjsx15/literal/object.sublime-syntax | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/literal/object.sublime-syntax b/syntaxes/fjsx15/literal/object.sublime-syntax index cef0a58e..ebd98a66 100644 --- a/syntaxes/fjsx15/literal/object.sublime-syntax +++ b/syntaxes/fjsx15/literal/object.sublime-syntax @@ -33,7 +33,9 @@ contexts: set: [ delimiters, statements-and-expressions ] delimiters: - - meta_scope: meta.object-literal.js.fjsx15 + - meta_scope: >- + meta.object-literal.js.fjsx15 + meta.block.js.fjsx15 - include: comment-no-pop - match: \s*(,) captures: From 96199c5dfc64705e35febdbd23ef4112ceab2499 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 1 Jan 2018 21:45:25 -0200 Subject: [PATCH 345/407] [FJSX15] Normalize object literal key --- .../literal/object/property.sublime-syntax | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/syntaxes/fjsx15/literal/object/property.sublime-syntax b/syntaxes/fjsx15/literal/object/property.sublime-syntax index b5d0484d..f5bd55db 100644 --- a/syntaxes/fjsx15/literal/object/property.sublime-syntax +++ b/syntaxes/fjsx15/literal/object/property.sublime-syntax @@ -225,9 +225,7 @@ contexts: (?x)\s* ([_[:upper:]])\b captures: - 1: >- - meta.object-literal.key.js.fjsx15 - variable.other.constant.js.fjsx15 + 1: meta.object-literal.key.uppercase.js.fjsx15 set: associated-value # Two or more characters. - match: | @@ -239,9 +237,7 @@ contexts: ) ) captures: - 1: >- - meta.object-literal.key.js.fjsx15 - variable.other.constant.js.fjsx15 + 1: meta.object-literal.key.uppercase.js.fjsx15 set: associated-value variable: @@ -252,9 +248,7 @@ contexts: | [_[:alpha:]]\b )) captures: - 1: >- - meta.object-literal.key.js.fjsx15 - variable.other.readwrite.js.fjsx15 + 1: meta.object-literal.key.js.fjsx15 set: associated-value # Two or more characters. - match: | @@ -266,9 +260,7 @@ contexts: ) ) captures: - 1: >- - meta.object-literal.key.js.fjsx15 - variable.other.readwrite.js.fjsx15 + 1: meta.object-literal.key.js.fjsx15 set: associated-value optional-expression: From 95f1480eb71dcb4e113644114ad8c4eb60090f77 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 1 Jan 2018 21:45:47 -0200 Subject: [PATCH 346/407] [FJSX15] Normalize import origin scope --- syntaxes/fjsx15/import.sublime-syntax | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/import.sublime-syntax b/syntaxes/fjsx15/import.sublime-syntax index 3c2bb60b..75b34de3 100644 --- a/syntaxes/fjsx15/import.sublime-syntax +++ b/syntaxes/fjsx15/import.sublime-syntax @@ -69,7 +69,7 @@ contexts: origin: - match: \s*(from)\b captures: - 1: keyword.control.import.origin.js.fjsx15 + 1: keyword.control.import-export.origin.js.fjsx15 set: origin-path origin-path: From 533b0b6d07d2a66e28c3b567fdd96230a75aa7bb Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 1 Jan 2018 21:46:10 -0200 Subject: [PATCH 347/407] [FJSX15] Normalize await scope --- syntaxes/fjsx15/operator/await.sublime-syntax | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/operator/await.sublime-syntax b/syntaxes/fjsx15/operator/await.sublime-syntax index 77993744..25716ab7 100644 --- a/syntaxes/fjsx15/operator/await.sublime-syntax +++ b/syntaxes/fjsx15/operator/await.sublime-syntax @@ -21,7 +21,7 @@ contexts: main: - match: \s*(await)\b captures: - 1: keyword.other.js.fjsx15 + 1: keyword.control.flow.await.js.fjsx15 set: optional-expression optional-expression: From 83a6552f3b56cafd17b275c03fd27f8a3efe5c85 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 1 Jan 2018 21:46:27 -0200 Subject: [PATCH 348/407] [FJSX15] Fix new scope typo --- syntaxes/fjsx15/operator/new.sublime-syntax | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/operator/new.sublime-syntax b/syntaxes/fjsx15/operator/new.sublime-syntax index b706e694..f6b124a3 100644 --- a/syntaxes/fjsx15/operator/new.sublime-syntax +++ b/syntaxes/fjsx15/operator/new.sublime-syntax @@ -76,7 +76,7 @@ contexts: (?xi) \s*({{commonIdentifier}}) captures: - 1: variable.type.js.fjsx15 + 1: variable.other.type.js.fjsx15 pop: true optional-arguments: From a0f6e857f7a709824f1bfddccbf656cf157d681d Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 1 Jan 2018 22:00:10 -0200 Subject: [PATCH 349/407] Add missing keyword colors --- schemes/candyman/_keyword.scss | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/schemes/candyman/_keyword.scss b/schemes/candyman/_keyword.scss index 8f596c74..76207c45 100644 --- a/schemes/candyman/_keyword.scss +++ b/schemes/candyman/_keyword.scss @@ -24,6 +24,12 @@ fontStyle: italic; } +.keyword.control.import-export { + foreground: $teal-200; + background: rgba($teal-300, .05); + fontStyle: italic; +} + .keyword.control.loop { foreground: $orange-300; background: rgba($orange-300, .05); @@ -35,3 +41,14 @@ background: rgba($pink-300, .05); fontStyle: italic; } + +.keyword.operator { + foreground: $green-a200; + fontStyle: bold; + + &.word { + foreground: $pink-a100; + fontStyle: italic; + } +} + From ec42da8b1c2260391ab5d558643e53bbc172bc86 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 1 Jan 2018 22:00:19 -0200 Subject: [PATCH 350/407] Make conditionals brown --- schemes/candyman/_keyword.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schemes/candyman/_keyword.scss b/schemes/candyman/_keyword.scss index 76207c45..712cd1ef 100644 --- a/schemes/candyman/_keyword.scss +++ b/schemes/candyman/_keyword.scss @@ -15,7 +15,7 @@ } .keyword.control.conditional { - foreground: $green-200; + foreground: $brown-200; } .keyword.control.flow { From 8ba5bce8b9d0f4cc6b0afd770ac95e06fc1c421d Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 1 Jan 2018 22:01:07 -0200 Subject: [PATCH 351/407] Remove dead code --- schemes/candyman/_annotation.scss | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/schemes/candyman/_annotation.scss b/schemes/candyman/_annotation.scss index 72a85472..14bd1d46 100644 --- a/schemes/candyman/_annotation.scss +++ b/schemes/candyman/_annotation.scss @@ -12,9 +12,7 @@ .meta.annotation { .variable.annotation, - .punctuation.section.group, - .punctuation.separator.comma, - .punctuation.definition.annotation { + .punctuation.definition { foreground: $purple-a100; fontStyle: italic; } From 7ced644f9dbdf0d678d43cd60e710c2d47653e79 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 1 Jan 2018 22:04:19 -0200 Subject: [PATCH 352/407] Disable punctuation color but let the code for reference --- schemes/candyman/_annotation.scss | 9 +++ schemes/candyman/_array.scss | 16 ++--- schemes/candyman/_function-call.scss | 46 +++++++-------- schemes/candyman/_keyword.scss | 33 +++++++++++ schemes/candyman/_punctuation.scss | 62 +++++++++---------- schemes/candyman/class/_body.scss | 36 ++++------- schemes/candyman/function/_body.scss | 39 +++++------- schemes/candyman/function/_parameters.scss | 38 ++++++------ schemes/candyman/global/_console.scss | 69 +++++++++++----------- schemes/candyman/global/_jest.scss | 46 +++++++-------- 10 files changed, 207 insertions(+), 187 deletions(-) diff --git a/schemes/candyman/_annotation.scss b/schemes/candyman/_annotation.scss index 14bd1d46..e2c9047f 100644 --- a/schemes/candyman/_annotation.scss +++ b/schemes/candyman/_annotation.scss @@ -16,4 +16,13 @@ foreground: $purple-a100; fontStyle: italic; } + +// .meta.group { +// .punctuation { +// &.section.group, +// &.separator.comma { +// foreground: $purple-a100; +// } +// } +// } } diff --git a/schemes/candyman/_array.scss b/schemes/candyman/_array.scss index eb2efc33..3f3efdd3 100644 --- a/schemes/candyman/_array.scss +++ b/schemes/candyman/_array.scss @@ -10,11 +10,11 @@ // License for the specific language governing permissions and limitations under // the License. -.meta.sequence -.punctuation { - &.section.brackets, - &.separator.comma { - foreground: $deep-orange-300; - fontStyle: italic bold; - } -} +// .meta.sequence +// .punctuation { +// &.section.brackets, +// &.separator.comma { +// foreground: $deep-orange-300; +// fontStyle: italic bold; +// } +// } diff --git a/schemes/candyman/_function-call.scss b/schemes/candyman/_function-call.scss index 49b2a616..213f98cf 100644 --- a/schemes/candyman/_function-call.scss +++ b/schemes/candyman/_function-call.scss @@ -10,27 +10,27 @@ // License for the specific language governing permissions and limitations under // the License. -.meta.function-call { - .punctuation { - &.section.group, - &.separator.comma { - foreground: $light-blue-300; - fontStyle: bold; - } - } -} +// .meta.function-call { +// .punctuation { +// &.section.group, +// &.separator.comma { +// foreground: $light-blue-300; +// fontStyle: bold; +// } +// } +// } -// Function call inside groups. -@for $i from 1 through 7 { - #{repeatString('meta.group', $i)} - .meta.function-call - .meta.group { - .punctuation { - &.section.group, - &.separator.comma { - foreground: $light-blue-300; - fontStyle: bold; - } - } - } -} +// // Function call inside groups. +// @for $i from 1 through 7 { +// #{repeatString('meta.group', $i)} +// .meta.function-call +// .meta.group { +// .punctuation { +// &.section.group, +// &.separator.comma { +// foreground: $light-blue-300; +// fontStyle: bold; +// } +// } +// } +// } diff --git a/schemes/candyman/_keyword.scss b/schemes/candyman/_keyword.scss index 712cd1ef..06b8b1d6 100644 --- a/schemes/candyman/_keyword.scss +++ b/schemes/candyman/_keyword.scss @@ -52,3 +52,36 @@ } } +// .meta.conditional { +// .meta.group { +// .punctuation { +// &.section.group, +// &.separator.comma { +// foreground: $brown-200; +// fontStyle: none; +// } +// } +// } + +// .punctuation.section.block { +// foreground: $brown-200; +// fontStyle: none; +// } +// } + +// .meta.loop { +// .meta.group { +// .punctuation { +// &.section.group, +// &.separator.comma { +// foreground: $orange-300; +// fontStyle: none; +// } +// } +// } + +// .punctuation.section.block { +// foreground: $orange-300; +// fontStyle: none; +// } +// } diff --git a/schemes/candyman/_punctuation.scss b/schemes/candyman/_punctuation.scss index 616bd76a..b66da1dd 100644 --- a/schemes/candyman/_punctuation.scss +++ b/schemes/candyman/_punctuation.scss @@ -24,40 +24,40 @@ } } -// Group inside function parameters. -@for $i from 1 through 7 { - #{repeatString('meta.function.parameters meta.group', $i)} - .meta.group { - .punctuation { - &.section.group, - &.separator.comma { - foreground: $amber-100; - fontStyle: none; - } - } - } +// &.separator.comma, +// &.section.group { +// foreground: $amber-200; +// fontStyle: none; +// } } -// Group inside function call. -@for $i from 1 through 7 { - #{repeatString('meta.function-call meta.group', $i)} - .meta.group { - .punctuation { - &.section.group, - &.separator.comma { - foreground: $amber-100; - fontStyle: none; - } - } - } -} +// .meta.generic { +// .punctuation.separator.comma, +// .punctuation.definition.generic { +// foreground: $brown-300; +// } +// } -.meta.generic { - .punctuation.separator.comma, - .punctuation.definition.generic { - foreground: $brown-300; - } -} +// .meta.template. + +// @for $i from 1 through 7 { +// #{repeatString('meta.annotation .meta.group', $i)} +// .meta.group, +// #{repeatString('meta.conditional .meta.group', $i)} +// .meta.group, +// #{repeatString('meta.function.parameters meta.group', $i)} +// .meta.group, +// #{repeatString('meta.function-call meta.group', $i)} +// .meta.group { +// .punctuation { +// &.section.group, +// &.separator.comma { +// foreground: $amber-200; +// fontStyle: none; +// } +// } +// } +// } // Groups inside function calls. // @for $i from 1 through 100 { diff --git a/schemes/candyman/class/_body.scss b/schemes/candyman/class/_body.scss index f908d6ef..a815693a 100644 --- a/schemes/candyman/class/_body.scss +++ b/schemes/candyman/class/_body.scss @@ -10,28 +10,16 @@ // License for the specific language governing permissions and limitations under // the License. -.meta.class { - .punctuation.section.block { - foreground: $light-green-300; - } -} +// .meta.class { +// .punctuation.section.block { +// foreground: $light-green-300; +// } +// } -/** - * Inside function. - */ - -// Level 1. -.meta.function .meta.class { - .punctuation.section.block { - foreground: $light-green-300; - } -} -// Level 2 - N. -@for $i from 1 through 7 { - #{repeatString('.meta.class .meta.function ', $i)} - .meta.class { - .punctuation.section.block { - foreground: $light-green-300; - } - } -} +// @for $i from 1 through 7 { +// #{repeatString('.meta.function .meta.class ', $i)} { +// .punctuation.section.block { +// foreground: $light-green-300; +// } +// } +// } diff --git a/schemes/candyman/function/_body.scss b/schemes/candyman/function/_body.scss index 06357f7a..10c84b07 100644 --- a/schemes/candyman/function/_body.scss +++ b/schemes/candyman/function/_body.scss @@ -14,29 +14,18 @@ foreground: $light-blue-300; } -.meta.function { - .punctuation.section.block { - foreground: $light-blue-300; - } -} - -/** - * Inside classes. - */ +// .meta.function { +// .punctuation.section.block { +// foreground: $light-blue-300; +// } +// } -// Level 1. -.meta.class .meta.function { - .punctuation.section.block { - foreground: $light-blue-300; - } -} - -// Level 2 - N. -@for $i from 1 through 7 { - #{repeatString('.meta.function .meta.class', $i)} - .meta.function { - .punctuation.section.block { - foreground: $light-blue-300; - } - } -} +// @for $i from 1 through 7 { +// #{repeatString('.meta.conditional .meta.function', $i)}, +// #{repeatString('.meta.class .meta.function', $i)}, +// #{repeatString('.meta.loop .meta.function', $i)} { +// .punctuation.section.block { +// foreground: $light-blue-300; +// } +// } +// } diff --git a/schemes/candyman/function/_parameters.scss b/schemes/candyman/function/_parameters.scss index 4378dd50..d3679df6 100644 --- a/schemes/candyman/function/_parameters.scss +++ b/schemes/candyman/function/_parameters.scss @@ -14,22 +14,24 @@ foreground: $orange-200; } -.meta.function.parameters { - .punctuation.section.group { - foreground: $light-blue-300; - } -} +// .meta.function.parameters { +// .punctuation.section.group { +// foreground: $light-blue-300; +// fontStyle: none; +// } +// } -// Function parameters of a function inside groups. -@for $i from 1 through 7 { - #{repeatString('meta.group', $i)} - .meta.function.parameters - .meta.group { - .punctuation { - &.section.group, - &.separator.comma { - foreground: $light-blue-300; - } - } - } -} +// // Function parameters of a function inside groups. +// @for $i from 1 through 7 { +// #{repeatString('meta.group', $i)} +// .meta.function.parameters +// .meta.group { +// .punctuation { +// &.section.group, +// &.separator.comma { +// foreground: $light-blue-300; +// fontStyle: none; +// } +// } +// } +// } diff --git a/schemes/candyman/global/_console.scss b/schemes/candyman/global/_console.scss index 977fb481..b8d7080e 100644 --- a/schemes/candyman/global/_console.scss +++ b/schemes/candyman/global/_console.scss @@ -28,41 +28,40 @@ } } -// Console function call punctuations. -.meta.function-call.console { - &.error .meta.group { - .punctuation { - &.section.group, - &.separator.comma { - foreground: $red-300; - } - } - } +// .meta.function-call.console { +// &.error .meta.group { +// .punctuation { +// &.section.group, +// &.separator.comma { +// foreground: $red-300; +// } +// } +// } - &.info .meta.group { - .punctuation { - &.section.group, - &.separator.comma { - foreground: $teal-300; - } - } - } +// &.info .meta.group { +// .punctuation { +// &.section.group, +// &.separator.comma { +// foreground: $teal-300; +// } +// } +// } - &.log .meta.group { - .punctuation { - &.section.group, - &.separator.comma { - foreground: $brown-200; - } - } - } +// &.log .meta.group { +// .punctuation { +// &.section.group, +// &.separator.comma { +// foreground: $brown-200; +// } +// } +// } - &.warn .meta.group { - .punctuation { - &.section.group, - &.separator.comma { - foreground: $deep-orange-300; - } - } - } -} +// &.warn .meta.group { +// .punctuation { +// &.section.group, +// &.separator.comma { +// foreground: $deep-orange-300; +// } +// } +// } +// } diff --git a/schemes/candyman/global/_jest.scss b/schemes/candyman/global/_jest.scss index 7e20aba3..c6a0c991 100644 --- a/schemes/candyman/global/_jest.scss +++ b/schemes/candyman/global/_jest.scss @@ -35,27 +35,27 @@ } } -// Global function call punctuation. -@for $i from 0 through 7 { - #{repeatString('.meta.function', $i)} - .meta.function-call.jest - .meta.group { - .punctuation { - &.section.group, - &.separator.comma { - foreground: $pink-300; - } - } - } -} +// // Global function call punctuation. +// @for $i from 0 through 7 { +// #{repeatString('.meta.function', $i)} +// .meta.function-call.jest +// .meta.group { +// .punctuation { +// &.section.group, +// &.separator.comma { +// foreground: $pink-300; +// } +// } +// } +// } -// Matcher function call punctuation. -.meta.function-call.jest.matcher -.meta.group { - .punctuation { - &.section.group, - &.separator.comma { - foreground: $green-200; - } - } -} +// // Matcher function call punctuation. +// .meta.function-call.jest.matcher +// .meta.group { +// .punctuation { +// &.section.group, +// &.separator.comma { +// foreground: $green-200; +// } +// } +// } From 96dde8a82ff5b77b6d435624bb51cefe904e063f Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 1 Jan 2018 22:05:12 -0200 Subject: [PATCH 353/407] Update template expresssion color --- schemes/candyman/_punctuation.scss | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/schemes/candyman/_punctuation.scss b/schemes/candyman/_punctuation.scss index b66da1dd..9d394e3a 100644 --- a/schemes/candyman/_punctuation.scss +++ b/schemes/candyman/_punctuation.scss @@ -17,12 +17,9 @@ fontStyle: bold; } - &.separator.comma, - &.section.group { - foreground: $amber-100; - fontStyle: none; + &.definition.template-expression { + foreground: $red-300; } -} // &.separator.comma, // &.section.group { From d907e578831c2e0ebd2ce9acde564f9270c65043 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 1 Jan 2018 22:05:20 -0200 Subject: [PATCH 354/407] Update comma operator color --- schemes/candyman/_punctuation.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/schemes/candyman/_punctuation.scss b/schemes/candyman/_punctuation.scss index 9d394e3a..7206979b 100644 --- a/schemes/candyman/_punctuation.scss +++ b/schemes/candyman/_punctuation.scss @@ -12,6 +12,7 @@ .punctuation { &.accessor, + &.comma, &.terminator { foreground: $green-a200; fontStyle: bold; From c47dbe16a6489221c49c5e8f87b3c183833446b9 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 1 Jan 2018 22:05:50 -0200 Subject: [PATCH 355/407] Change global console object color --- schemes/candyman/_type.scss | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/schemes/candyman/_type.scss b/schemes/candyman/_type.scss index 9b9126fc..4500c2e7 100644 --- a/schemes/candyman/_type.scss +++ b/schemes/candyman/_type.scss @@ -16,7 +16,14 @@ .support.type { foreground: $deep-orange-a100; +} + +.support.type.object { fontStyle: italic; + &.console { + foreground: $green-200; + background: rgba($green-200, .05); + } } // foreground: $light-green-300; From 75ab6318153f4a4a3d3501b582332269c30f57b7 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 1 Jan 2018 22:08:19 -0200 Subject: [PATCH 356/407] Fix modifier rules and style --- schemes/candyman/_modifier.scss | 4 ++-- schemes/candyman/_object.scss | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 schemes/candyman/_object.scss diff --git a/schemes/candyman/_modifier.scss b/schemes/candyman/_modifier.scss index c870310f..2dbdf9cd 100644 --- a/schemes/candyman/_modifier.scss +++ b/schemes/candyman/_modifier.scss @@ -11,9 +11,9 @@ // the License. .storage { - &.modifier + &.modifier, &.type { foreground: $deep-purple-200; - fontStyle: italic; + fontStyle: none; } } diff --git a/schemes/candyman/_object.scss b/schemes/candyman/_object.scss new file mode 100644 index 00000000..075a5754 --- /dev/null +++ b/schemes/candyman/_object.scss @@ -0,0 +1,16 @@ +// Licensed under the Apache License, Version 2.0 (the “License”); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +.meta.object-literal.key { + foreground: $brown-200; + fontStyle: italic; +} From 2f2b9764ffdabee4734c31fc4c34bbe78f1be83a Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 1 Jan 2018 22:08:52 -0200 Subject: [PATCH 357/407] Add the root color settings --- Candyman.scsscheme | 1 + schemes/candyman/_main.scss | 33 ++++++++++++++ schemes/candyman/old/_main.scss | 81 --------------------------------- 3 files changed, 34 insertions(+), 81 deletions(-) create mode 100644 schemes/candyman/_main.scss delete mode 100644 schemes/candyman/old/_main.scss diff --git a/Candyman.scsscheme b/Candyman.scsscheme index 0037a6dc..2431b01a 100644 --- a/Candyman.scsscheme +++ b/Candyman.scsscheme @@ -13,6 +13,7 @@ @name 'Candyman'; @import 'schemes/candyman/palette'; @import 'schemes/candyman/repeatString'; +@import 'schemes/candyman/main'; // Old scopes. @import 'schemes/candyman/old'; diff --git a/schemes/candyman/_main.scss b/schemes/candyman/_main.scss new file mode 100644 index 00000000..bfb68022 --- /dev/null +++ b/schemes/candyman/_main.scss @@ -0,0 +1,33 @@ +// Licensed under the Apache License, Version 2.0 (the “License”); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +* { + background: $blue-gray-900; + foreground: $blue-gray-200; + gutterForeground: $blue-gray-400; + invisibles: $blue-gray-800; + + caret: $light-green-a200; + lineHighlight: rgba(0,0,0,.1); + selection: $blue-gray-700; + + bracketsForeground: $gray-0; + bracketsOptions: stippled_underline; + tagsOptions: stippled_underline; + + findHighlight: $teal-300; + findHighlightForeground: $teal-800; + + guide: $blue-gray-800; + activeGuide: $blue-gray-600; + stackGuide: $blue-gray-800; +} diff --git a/schemes/candyman/old/_main.scss b/schemes/candyman/old/_main.scss deleted file mode 100644 index f5d8769b..00000000 --- a/schemes/candyman/old/_main.scss +++ /dev/null @@ -1,81 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -* { - background: $blue-gray-900; - foreground: $blue-gray-200; - gutterForeground: $blue-gray-400; - invisibles: $blue-gray-800; - - caret: $light-green-a200; - lineHighlight: rgba(0,0,0,.1); - selection: $blue-gray-700; - - bracketsForeground: $gray-0; - bracketsOptions: stippled_underline; - tagsOptions: stippled_underline; - - findHighlight: $teal-300; - findHighlightForeground: $teal-800; - - guide: $blue-gray-800; - activeGuide: $blue-gray-600; - stackGuide: $blue-gray-800; -} - -@import "shared/alias"; -@import "shared/ambiguous"; -@import "shared/array"; -@import "shared/cast"; -@import "shared/class"; -@import "shared/color"; -@import "shared/comment"; -@import "shared/constant"; -@import "shared/datetime"; -@import "shared/embedded-expression"; -@import "shared/enumeration"; -@import "shared/function"; -@import "shared/gitgutter"; -@import "shared/interface"; -@import "shared/keyword"; -@import "shared/label"; -@import "shared/namespace"; -@import "shared/number"; -@import "shared/object"; -@import "shared/operator"; -@import "shared/preprocessor"; -@import "shared/punctuation"; -@import "shared/regex"; -@import "shared/string"; -@import "shared/structure"; -@import "shared/template"; -@import "shared/trait"; -@import "shared/type"; -@import "shared/unknown"; -@import "shared/variable"; - -@import "shared/docblock/alias"; -@import "shared/docblock/class"; -@import "shared/docblock/constant"; -@import "shared/docblock/function"; -@import "shared/docblock/import"; -@import "shared/docblock/interface"; -@import "shared/docblock/keyword"; -@import "shared/docblock/modifier"; -@import "shared/docblock/namespace"; -@import "shared/docblock/number"; -@import "shared/docblock/operator"; -@import "shared/docblock/punctuation"; -@import "shared/docblock/string"; -@import "shared/docblock/structure"; -@import "shared/docblock/type"; -@import "shared/docblock/variable"; From 235192e77dc1953186809a71cc13daaf054a03e0 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 1 Jan 2018 22:09:06 -0200 Subject: [PATCH 358/407] Add the object literal key color --- Candyman.scsscheme | 1 + 1 file changed, 1 insertion(+) diff --git a/Candyman.scsscheme b/Candyman.scsscheme index 2431b01a..d7e4ce47 100644 --- a/Candyman.scsscheme +++ b/Candyman.scsscheme @@ -35,6 +35,7 @@ @import 'schemes/candyman/keyword'; @import 'schemes/candyman/modifier'; @import 'schemes/candyman/number'; +@import 'schemes/candyman/object'; @import 'schemes/candyman/punctuation'; @import 'schemes/candyman/string'; @import 'schemes/candyman/type'; From 01be59f63b1cf51d99211ed1e68d447fe855ddec Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Mon, 1 Jan 2018 22:09:26 -0200 Subject: [PATCH 359/407] Add specific constants color --- schemes/candyman/_constant.scss | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/schemes/candyman/_constant.scss b/schemes/candyman/_constant.scss index 0c4f5472..b4fac995 100644 --- a/schemes/candyman/_constant.scss +++ b/schemes/candyman/_constant.scss @@ -19,3 +19,19 @@ .support.constant { foreground: $deep-orange-a100; } + +.constant.language { + foreground: $red-300; + background: rgba($red-300, .05); +} + +.constant.language.infinity, +.constant.language.nan { + foreground: $purple-a100; + background: rgba($purple-a100, .05); +} + +.constant.language.boolean { + foreground: $green-200; + background: rgba($green-200, .05); +} From 6bcba344cf7380b0cdaf0c2bc9ddbc63e4c6169f Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Tue, 2 Jan 2018 08:33:58 -0200 Subject: [PATCH 360/407] [FJSX15] Simplify statements --- syntaxes/fjsx15/statement.sublime-syntax | 128 ++++++++++++----------- 1 file changed, 68 insertions(+), 60 deletions(-) diff --git a/syntaxes/fjsx15/statement.sublime-syntax b/syntaxes/fjsx15/statement.sublime-syntax index e93bba99..fbe7ae57 100644 --- a/syntaxes/fjsx15/statement.sublime-syntax +++ b/syntaxes/fjsx15/statement.sublime-syntax @@ -58,45 +58,39 @@ contexts: - match: (?=\s*\S) pop: true - optional-block-or-statement-or-expression: - - include: block - - include: optional-statements-and-expressions - asi-checked-optional-expression: - match: (?=\s*\n) pop: true - include: optional-expression - header-end: - - match: \s*(\)) - captures: - 1: punctuation.section.group.end.js.fjsx15 - pop: true - - expression-only-header: - - match: \s*(\() - captures: - 1: >- - meta.group.js.fjsx15 - punctuation.section.group.begin.js.fjsx15 - set: [ - meta-group, - header-end, - optional-expression - ] - - statements-and-expressions-header: - - match: \s*(\() - captures: - 1: punctuation.section.group.begin.js.fjsx15 - set: [ - meta-group, - header-end, - optional-statements-and-expressions - ] + # header-end: + # - match: \s*(\)) + # captures: + # 1: punctuation.section.group.end.js.fjsx15 + # pop: true + + # expression-only-header: + # - match: \s*(\() + # captures: + # 1: punctuation.section.group.begin.js.fjsx15 + # set: [ + # meta-group, + # # header-end, + # optional-expression + # ] + + # statements-and-expressions-header: + # - match: \s*(\() + # captures: + # 1: punctuation.section.group.begin.js.fjsx15 + # set: [ + # meta-group, + # header-end, + # optional-statements-and-expressions + # ] meta-group: - - meta_content_scope: meta.group.js.fjsx15 + - meta_scope: meta.group.js.fjsx15 - match: "" pop: true @@ -105,15 +99,25 @@ contexts: - match: "" pop: true + meta-loop-dowhile: + - meta_content_scope: meta.loop.for.js.fjsx15 + - match: "" + pop: true + + meta-loop-for: + - meta_content_scope: meta.loop.for.js.fjsx15 + - match: "" + pop: true + meta-switch: - meta_content_scope: meta.switch.js.fjsx15 - match: "" pop: true - optional-expression-only-header: - - include: expression-only-header - - match: (?=\s*\S) - pop: true + # optional-expression-only-header: + # - include: expression-only-header + # - match: (?=\s*\S) + # pop: true block: - match: \s*({) @@ -162,7 +166,7 @@ contexts: - match: \s*(while)\b captures: 1: keyword.control.loop.js.fjsx15 - set: expression-only-header + set: optional-expression empty: - match: \s*(;) @@ -173,9 +177,13 @@ contexts: for: - match: \s*(for)\b captures: - 1: keyword.control.loop.js.fjsx15 + 1: >- + meta.loop.for.js.fjsx15 + keyword.control.loop.js.fjsx15 set: [ - statements-and-expressions-header, + meta-loop-for, + optional-statements-and-expressions, + optional-expression, optional-await ] @@ -187,30 +195,30 @@ contexts: keyword.control.conditional.js.fjsx15 set: [ meta-conditional, - optional-block-or-statement-or-expression, - expression-only-header - ] - - match: \s*(else)\b - captures: - 0: meta.conditional.js.fjsx15 - 1: keyword.control.conditional.js.fjsx15 - set: [ - meta-conditional, - else-body, + optional-statements-and-expressions, + optional-expression ] + # - match: \s*(else)\b + # captures: + # 0: meta.conditional.js.fjsx15 + # 1: keyword.control.conditional.js.fjsx15 + # set: [ + # meta-conditional, + # else-body, + # ] else-body: - include: no-meta-if - - include: optional-block-or-statement-or-expression + - include: optional-statements-and-expressions - no-meta-if: - - match: \s*(if)\b - captures: - 1: keyword.control.conditional.js.fjsx15 - set: [ - optional-block-or-statement-or-expression, - expression-only-header - ] + # no-meta-if: + # - match: \s*(if)\b + # captures: + # 1: keyword.control.conditional.js.fjsx15 + # set: [ + # optional-statements-and-expressions, + # expression-only-header + # ] label: - match: | @@ -234,7 +242,7 @@ contexts: 1: keyword.control.switch.js.fjsx15 set: [ meta-switch, - expression-only-header + optional-expression ] - match: \s*(case)\b captures: @@ -264,7 +272,7 @@ contexts: - match: \s*(catch)\b captures: 1: keyword.control.trycatch.js.fjsx15 - set: optional-expression-only-header + set: optional-expression - match: \s*(finally)\b captures: 1: keyword.control.trycatch.js.fjsx15 From 65351cb78e866ddeb4a6f3bdacc5a649c85b8ad0 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Tue, 2 Jan 2018 08:35:13 -0200 Subject: [PATCH 361/407] [FJSX15] Disable many core globals temporarily but leave console --- syntaxes/fjsx15/core.sublime-syntax | 458 ++++++---------------------- 1 file changed, 101 insertions(+), 357 deletions(-) diff --git a/syntaxes/fjsx15/core.sublime-syntax b/syntaxes/fjsx15/core.sublime-syntax index 1fb50906..9e8ee189 100644 --- a/syntaxes/fjsx15/core.sublime-syntax +++ b/syntaxes/fjsx15/core.sublime-syntax @@ -19,391 +19,135 @@ scope: ... contexts: main: - - include: array-functions + # - include: array-functions + - include: console - include: console-functions - - include: math-constants - - include: math-functions - - include: object-functions - - include: symbol-functions - - include: symbol-properties + - include: console-function-calls + # - include: math-constants + # - include: math-functions + # - include: object-functions + # - include: symbol-functions + # - include: symbol-properties # https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects - include: constants - - include: variables - - include: functions - - include: import-properties - - include: fundamental-objects - - include: numbers-and-dates - - include: text-processing - - include: indexed-collections - - include: keyed-collections - - include: structured-data - - include: control-abstraction-objects - - include: reflection - - include: internationalization - - include: web-assembly - - optional-template-and-arguments: - - include: Packages/Naomi/syntaxes/flow1/template/arguments.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/function-call/arguments.sublime-syntax + # - include: variables + # - include: functions + # - include: import-properties + # - include: fundamental-objects + # - include: numbers-and-dates + # - include: text-processing + # - include: indexed-collections + # - include: keyed-collections + # - include: structured-data + # - include: control-abstraction-objects + # - include: reflection + # - include: internationalization + # - include: web-assembly + + escape: - match: (?=\s*\S) pop: true - array-functions: - - match: | - (?x) - \s*(Array) - \s*(\.)\s* - ((?> from - | isArray - ))\b - captures: - 1: support.class.builtin.js.fjsx15 - 2: punctuation.accessor.js.fjsx15 - 3: support.function.js.fjsx15 - set: optional-template-and-arguments - - console-functions: - - match: | - (?x) - \s*(console)\b - (?: - \s*(\.)\s* - ((?> assert - | clear - | count - | error - | group(?>Collapsed|End)? - | info - | log - | table - | time(?>End|Stamp)? - | trace - | warn - ))\b - ) - captures: - 1: support.type.object.console.js.fjsx15 - 2: punctuation.accessor.js.fjsx15 - 3: support.function.console.js.fjsx15 - set: optional-template-and-arguments - - math-constants: - - match: | - (?x) - \s*(Math) - \s*(\.)\s* - ((?> E - | LN(?>10|2) - | LOG(?>10E|2E) - | PI - | SQRT(?>1_2|2) - ))\b - captures: - 1: support.class.builtin.js.fjsx15 - 2: punctuation.accessor.js.fjsx15 - 3: support.constant.js.fjsx15 + pop-now: + - match: "" pop: true - math-functions: - - match: | - (?x) - \s*(Math)\b - \s*(\.)\s* - ((?> abs - | acosh? - | asinh? - | atan(?>2|h)? - | cbrt - | ceil - | clz32 - | cosh? - | exp - | exp(?:m1)? - | floor - | fround - | hypot - | imul - | log(?>10|1p|2)? - | max - | min - | pow - | random - | round - | sign - | sinh? - | sqrt - | tanh? - | trunc - ))\b - captures: - 1: support.class.builtin.js.fjsx15 - 2: punctuation.accessor.js.fjsx15 - 3: support.function.js.fjsx15 - set: optional-template-and-arguments + arguments: + - include: Packages/Naomi/syntaxes/fjsx15/function-call/arguments.sublime-syntax - object-functions: + console: - match: | (?x) - \s*(Object)\b - \s*(\.)\s* - ((?> assign - | create - | definePropert(?>ies|y) - | freeze - | getOwnProperty(?>Descriptors?|Names|Symbols) - | getPrototypeOf - | is(?>Extensible|Frozen|Sealed)? - | keys - | preventExtensions - | seal - | setPrototypeOf - ))\b + \s*(console) + \s*(\.) captures: - 1: support.class.builtin.js.fjsx15 + 1: support.type.object.console.js.fjsx15 2: punctuation.accessor.js.fjsx15 - 3: support.function.js.fjsx15 - set: optional-template-and-arguments + set: console-property-or-function - symbol-functions: - - match: | - (?x) - \s*(Symbol) - \s*(\.)\s* - ((?> for - | keyFor - ))\b + console-property-or-function: + # error + - match: \s*(error)(?=\s*\() captures: - 1: support.class.builtin.js.fjsx15 - 2: punctuation.accessor.js.fjsx15 - 3: support.function.js.fjsx15 - set: optional-template-and-arguments - - symbol-properties: - - match: | - (?x) - \s*(Symbol) - \s*(\.)\s* - ((?> asyncIterator - | hasInstance - | isConcatSpreadable - | iterator - | match - | replace - | search - | species - | split - | toPrimitive - | toStringTag - | unscopables - ))\b + 1: support.function.console.error.js.fjsx15 + set: [ + console-error-meta-scope, + arguments + ] + - match: \s*(error) captures: - 1: support.class.builtin.js.fjsx15 - 2: punctuation.accessor.js.fjsx15 - 3: support.variable.js.fjsx15 + 1: support.function.console.error.js.fjsx15 pop: true - - constants: - - match: | - (?x)\s* - ((?> false - | true - )) + # info + - match: \s*(info)(?=\s*\() captures: - 1: constant.language.boolean.js.fjsx15 - pop: true - - match: | - (?x)\s* - ((?> Infinity - | NaN - | null - | undefined - )) + 1: support.function.console.info.js.fjsx15 + set: [ + console-info-meta-scope, + arguments + ] + - match: \s*(info) captures: - 1: constant.language.js.fjsx15 + 1: support.function.console.info.js.fjsx15 pop: true - - variables: - - match: \s*(super)\b + # log + - match: \s*(log)(?=\s*\() captures: - 1: variable.language.super.js.fjsx15 - pop: true - - match: \s*(this)\b + 1: support.function.console.log.js.fjsx15 + set: [ + console-log-meta-scope, + arguments + ] + - match: \s*(log) captures: - 1: variable.language.this.js.fjsx15 + 1: support.function.console.log.js.fjsx15 pop: true - - functions: - - match: | - (?x)\s* - ((?> decodeURI(?:Component)? - | encodeURI(?:Component)? - | eval - | is(?>Finite|NaN) - | parse(?>Float|Int) - | super - )) - (?=\s*\() + # warn + - match: \s*(warn)(?=\s*\() captures: - 1: support.function.js.fjsx15 - set: optional-template-and-arguments - - function-properties: - - match: | - (?x)\s* - (function)(.)(sent) + 1: support.function.console.warn.js.fjsx15 + set: [ + console-warn-meta-scope, + arguments + ] + - match: \s*(warn) captures: - 1: support.type.object.js.fjsx15 - 2: punctuation.accessor.js.fjsx15 - 3: support.variable.js.fjsx15 - pop: true - - import-properties: - - match: | - (?x)\s* - (import)(.)(meta)\b - captures: - 1: support.type.object.js.fjsx15 - 2: punctuation.accessor.js.fjsx15 - 3: support.type.object.js.fjsx15 + 1: support.function.console.warn.js.fjsx15 pop: true + # Anything else. + - include: escape - fundamental-objects: - - match: | - (?x)\s* - ((?> Boolean - | Error - | EvalError - | Function - | InternalError - | Object - | RangeError - | ReferenceError - | SyntaxError - | TypeError - | URIError - ))\b - captures: - 1: support.class.builtin.js.fjsx15 - set: optional-template-and-arguments - - numbers-and-dates: - - match: | - (?x)\s* - ((?> Date - | Math - | Number - ))\b - captures: - 1: support.class.builtin.js.fjsx15 - set: optional-template-and-arguments - - text-processing: - - match: | - (?x)\s* - ((?> RegExp - | String - ))\b - captures: - 1: support.class.builtin.js.fjsx15 - set: optional-template-and-arguments - - indexed-collections: - - match: | - (?x)\s* - ((?> Array - | Float(?>32|64)Array - | Int(?>8|16|32)Array - | Uint(?>8|16|32)Array - | Uint8ClampedArray - ))\b - captures: - 1: support.class.builtin.js.fjsx15 - set: optional-template-and-arguments - - keyed-collections: - - match: | - (?x)\s* - ((?> Map - | Set - | Weak(?>Map|Set) - ))\b - captures: - 1: support.class.builtin.js.fjsx15 - 2: punctuation.accessor.js.fjsx15 - 3: support.function.js.fjsx15 - set: optional-template-and-arguments - - structured-data: - - match: | - (?x)\s* - ((?> ArrayBuffer - | DataView - | JSON - ))\b - captures: - 1: support.class.builtin.js.fjsx15 - 2: punctuation.accessor.js.fjsx15 - 3: support.function.js.fjsx15 - set: optional-template-and-arguments + console-error-meta-scope: + - meta_scope: meta.function-call.console.error.js.fjsx15 + - include: pop-now - control-abstraction-objects: - - match: | - (?x)\s* - ((?> Generator(?:Function)? - | Promise - ))\b - captures: - 1: support.class.builtin.js.fjsx15 - 2: punctuation.accessor.js.fjsx15 - 3: support.function.js.fjsx15 - set: optional-template-and-arguments + console-info-meta-scope: + - meta_scope: meta.function-call.console.info.js.fjsx15 + - include: pop-now - reflection: - - match: | - (?x)\s* - ((?> Proxy - | Reflect - ))\b - captures: - 1: support.class.builtin.js.fjsx15 - 2: punctuation.accessor.js.fjsx15 - 3: support.function.js.fjsx15 - set: optional-template-and-arguments + console-log-meta-scope: + - meta_scope: meta.function-call.console.log.js.fjsx15 + - include: pop-now - internationalization: - - match: | - (?x) - \s*(Intl)\b - (?: - \s*(\.)\s* - ((?> Collator - | DateTimeFormat - | NumberFormat - ))\b - )? - captures: - 1: support.class.builtin.js.fjsx15 - 2: punctuation.accessor.js.fjsx15 - 3: support.function.js.fjsx15 - set: optional-template-and-arguments + console-warn-meta-scope: + - meta_scope: meta.function-call.console.warn.js.fjsx15 + - include: pop-now - web-assembly: - - match: | - (?x) - \s*(WebAssembly)\b - (?: - \s*(\.)\s* - ((?> CompileError - | Instance - | LinkError - | Memory - | Module - | RuntimeError - | Table - ))\b - )? - captures: - 1: support.class.builtin.js.fjsx15 - 2: punctuation.accessor.js.fjsx15 - 3: support.function.js.fjsx15 - set: optional-template-and-arguments + constants: + - match: | + (?x)\s* + (?> (false) + | (Infinity) + | (NaN) + | (null) + | (true) + | (undefined) + ) + captures: + 1: constant.language.boolean.false.js.fjsx15 + 2: constant.language.infinity.js.fjsx15 + 3: constant.language.nan.js.fjsx15 + 4: constant.language.null.js.fjsx15 + 5: constant.language.boolean.true.js.fjsx15 + 6: constant.language.undefined.js.fjsx15 + pop: true From f24e5968e161b094a2d8b754768e9ef0a6134e54 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Tue, 2 Jan 2018 08:35:34 -0200 Subject: [PATCH 362/407] Make function declarations pop --- schemes/candyman/_function.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schemes/candyman/_function.scss b/schemes/candyman/_function.scss index 22eee984..f6c653f5 100644 --- a/schemes/candyman/_function.scss +++ b/schemes/candyman/_function.scss @@ -12,7 +12,7 @@ .entity.name.function { foreground: $light-blue-300; - background: rgba($light-blue-300, .025); + background: rgba($light-blue-300, .05); } .variable.function { From a4d2ab21969ae3fc953eed2f6579712b255c87b6 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Tue, 2 Jan 2018 23:13:47 -0200 Subject: [PATCH 363/407] [FJSX15] Normalize operator scopes --- syntaxes/fjsx15/operator/await.sublime-syntax | 2 +- syntaxes/fjsx15/operator/new.sublime-syntax | 2 +- syntaxes/fjsx15/operator/of.sublime-syntax | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/syntaxes/fjsx15/operator/await.sublime-syntax b/syntaxes/fjsx15/operator/await.sublime-syntax index 25716ab7..7fc0a072 100644 --- a/syntaxes/fjsx15/operator/await.sublime-syntax +++ b/syntaxes/fjsx15/operator/await.sublime-syntax @@ -30,5 +30,5 @@ contexts: just-pop: - match: \s*(await)\b captures: - 1: keyword.other.js.fjsx15 + 1: keyword.control.flow.await.js.fjsx15 pop: true diff --git a/syntaxes/fjsx15/operator/new.sublime-syntax b/syntaxes/fjsx15/operator/new.sublime-syntax index f6b124a3..65232da2 100644 --- a/syntaxes/fjsx15/operator/new.sublime-syntax +++ b/syntaxes/fjsx15/operator/new.sublime-syntax @@ -65,7 +65,7 @@ contexts: - include: escape meta-instance-call-constructor-scope: - - meta_scope: meta.instance.js.fjsx15 + - meta_scope: meta.instance.constructor.js.fjsx15 - meta_content_scope: meta.function-call.constructor.js.fjsx15 - include: escape diff --git a/syntaxes/fjsx15/operator/of.sublime-syntax b/syntaxes/fjsx15/operator/of.sublime-syntax index 3fef974d..61347d21 100644 --- a/syntaxes/fjsx15/operator/of.sublime-syntax +++ b/syntaxes/fjsx15/operator/of.sublime-syntax @@ -22,7 +22,7 @@ contexts: # Technically there’s no “of” operator, but this will simplify for loops. - match: \s*(of)\b captures: - 1: keyword.operator.js.fjsx15 + 1: keyword.operator.word.of.js.fjsx15 set: optional-expression optional-expression: From d2a2c3b551110873c9e7c1a538bcc76e44e6b328 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Tue, 2 Jan 2018 23:14:04 -0200 Subject: [PATCH 364/407] [FJSX15] Normalize function meta scopes --- syntaxes/fjsx15/function.sublime-syntax | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/function.sublime-syntax b/syntaxes/fjsx15/function.sublime-syntax index ea182add..12856bb7 100644 --- a/syntaxes/fjsx15/function.sublime-syntax +++ b/syntaxes/fjsx15/function.sublime-syntax @@ -56,7 +56,11 @@ contexts: push: template-parameters # Parameters. - match: (?=\s*\() - push: parameters + set: [ + optional-body, + meta-declaration-scope, + parameters + ] # Identifier. - match: | (?xi)\s* @@ -69,6 +73,18 @@ contexts: - match: (?=\s*\S) pop: true + meta-declaration-scope: + - meta_scope: meta.declaration.function.js.fjsx15 + - match: "" + pop: true + + optional-body: + - match: (?=\s*\{) + set: body + # Anything else. + - match: (?=\s*\S) + pop: true + comment-no-pop: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax From 1100fa9a0f8cf8c2bbad6417d6282d7698c65156 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Wed, 3 Jan 2018 08:23:55 -0200 Subject: [PATCH 365/407] [FJSX15] Normalize await scopes --- syntaxes/fjsx15/export.sublime-syntax | 4 ++-- syntaxes/fjsx15/import.sublime-syntax | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/syntaxes/fjsx15/export.sublime-syntax b/syntaxes/fjsx15/export.sublime-syntax index beed03df..b9214bd1 100644 --- a/syntaxes/fjsx15/export.sublime-syntax +++ b/syntaxes/fjsx15/export.sublime-syntax @@ -106,7 +106,7 @@ contexts: 1: keyword.control.import-export.js.fjsx15 2: >- storage.modifier.js.fjsx15 - keyword.control.export.default.js.fjsx15 + keyword.control.import-export.default.js.fjsx15 set: origin # Export statements. - match: | @@ -136,7 +136,7 @@ contexts: 1: keyword.control.import-export.js.fjsx15 2: >- storage.modifier.js.fjsx15 - keyword.control.export.default.js.fjsx15 + keyword.control.import-export.default.js.fjsx15 # set: statement-and-expression # Other. - match: | diff --git a/syntaxes/fjsx15/import.sublime-syntax b/syntaxes/fjsx15/import.sublime-syntax index 75b34de3..9adc11fa 100644 --- a/syntaxes/fjsx15/import.sublime-syntax +++ b/syntaxes/fjsx15/import.sublime-syntax @@ -112,7 +112,7 @@ contexts: captures: 1: >- storage.modifier.js.fjsx15 - keyword.control.export.default.js.fjsx15 + keyword.control.import-export.default.js.fjsx15 set: optional-alias # All. - match: \s*(\*) From 55b47fb190871c079b4735a8f231ab263042ae68 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Wed, 3 Jan 2018 08:24:18 -0200 Subject: [PATCH 366/407] [FJSX15] Fix for statement header --- syntaxes/fjsx15/statement.sublime-syntax | 76 ++++++++++++++---------- 1 file changed, 43 insertions(+), 33 deletions(-) diff --git a/syntaxes/fjsx15/statement.sublime-syntax b/syntaxes/fjsx15/statement.sublime-syntax index fbe7ae57..ccfa702f 100644 --- a/syntaxes/fjsx15/statement.sublime-syntax +++ b/syntaxes/fjsx15/statement.sublime-syntax @@ -63,11 +63,11 @@ contexts: pop: true - include: optional-expression - # header-end: - # - match: \s*(\)) - # captures: - # 1: punctuation.section.group.end.js.fjsx15 - # pop: true + header-end: + - match: \s*(\)) + captures: + 1: punctuation.section.group.end.js.fjsx15 + pop: true # expression-only-header: # - match: \s*(\() @@ -79,15 +79,24 @@ contexts: # optional-expression # ] - # statements-and-expressions-header: - # - match: \s*(\() - # captures: - # 1: punctuation.section.group.begin.js.fjsx15 - # set: [ - # meta-group, - # header-end, - # optional-statements-and-expressions - # ] + statements-and-expressions-header: + - match: \s*(\() + captures: + 1: punctuation.section.group.begin.js.fjsx15 + set: [ + meta-group, + header-end, + statements-and-expressions-header-content + ] + + statements-and-expressions-header-content: + - match: (?=\s*\)) + pop: true + - match: "" + push: + - include: optional-statements-and-expressions + - match: "" + pop: true meta-group: - meta_scope: meta.group.js.fjsx15 @@ -183,7 +192,7 @@ contexts: set: [ meta-loop-for, optional-statements-and-expressions, - optional-expression, + statements-and-expressions-header, optional-await ] @@ -198,27 +207,28 @@ contexts: optional-statements-and-expressions, optional-expression ] - # - match: \s*(else)\b - # captures: - # 0: meta.conditional.js.fjsx15 - # 1: keyword.control.conditional.js.fjsx15 - # set: [ - # meta-conditional, - # else-body, - # ] - - else-body: + - match: \s*(else)\b + captures: + 1: >- + meta.conditional.js.fjsx15 + keyword.control.conditional.js.fjsx15 + set: [ + meta-conditional, + optional-else-if + ] + + optional-else-if: - include: no-meta-if - include: optional-statements-and-expressions - # no-meta-if: - # - match: \s*(if)\b - # captures: - # 1: keyword.control.conditional.js.fjsx15 - # set: [ - # optional-statements-and-expressions, - # expression-only-header - # ] + no-meta-if: + - match: \s*(if)\b + captures: + 1: keyword.control.conditional.js.fjsx15 + set: [ + optional-statements-and-expressions, + optional-expression + ] label: - match: | From 54ce797017623502aa1bdebd04cefefa8e263cec Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Wed, 3 Jan 2018 12:44:27 -0200 Subject: [PATCH 367/407] Balance colors and simplify --- schemes/candyman/_constant.scss | 3 - schemes/candyman/_function.scss | 1 - schemes/candyman/_json.scss | 78 ++-------------------- schemes/candyman/_keyword.scss | 70 +++++++++++-------- schemes/candyman/_number.scss | 2 +- schemes/candyman/_punctuation.scss | 10 +-- schemes/candyman/_string.scss | 15 +---- schemes/candyman/_type.scss | 1 + schemes/candyman/_variable.scss | 5 ++ schemes/candyman/function/_parameters.scss | 2 +- schemes/candyman/global/_jest.scss | 5 +- 11 files changed, 66 insertions(+), 126 deletions(-) diff --git a/schemes/candyman/_constant.scss b/schemes/candyman/_constant.scss index b4fac995..d744f8a0 100644 --- a/schemes/candyman/_constant.scss +++ b/schemes/candyman/_constant.scss @@ -22,16 +22,13 @@ .constant.language { foreground: $red-300; - background: rgba($red-300, .05); } .constant.language.infinity, .constant.language.nan { foreground: $purple-a100; - background: rgba($purple-a100, .05); } .constant.language.boolean { foreground: $green-200; - background: rgba($green-200, .05); } diff --git a/schemes/candyman/_function.scss b/schemes/candyman/_function.scss index f6c653f5..35493fef 100644 --- a/schemes/candyman/_function.scss +++ b/schemes/candyman/_function.scss @@ -12,7 +12,6 @@ .entity.name.function { foreground: $light-blue-300; - background: rgba($light-blue-300, .05); } .variable.function { diff --git a/schemes/candyman/_json.scss b/schemes/candyman/_json.scss index 692bcb90..9d9122c1 100644 --- a/schemes/candyman/_json.scss +++ b/schemes/candyman/_json.scss @@ -21,7 +21,6 @@ .meta.structure.dictionary.key { .string { foreground: $cyan-300; - background: rgba($cyan-300, .05); .punctuation.definition.string { foreground: $cyan-300; @@ -31,9 +30,7 @@ } // Level 2. - .meta.structure.dictionary - .meta.structure.dictionary - .meta.structure.dictionary { + #{repeatString('.meta.structure.dictionary', 3)} { .punctuation.section.dictionary { foreground: $cyan-300; } @@ -41,7 +38,6 @@ .meta.structure.dictionary.key { .string { foreground: $light-green-300; - background: rgba($light-green-300, .05); .punctuation.definition.string { foreground: $light-green-300; @@ -51,11 +47,7 @@ } // Level 3. - .meta.structure.dictionary - .meta.structure.dictionary - .meta.structure.dictionary - .meta.structure.dictionary - .meta.structure.dictionary { + #{repeatString('.meta.structure.dictionary', 5)} { .punctuation.section.dictionary { foreground: $light-green-300; } @@ -63,7 +55,6 @@ .meta.structure.dictionary.key { .string { foreground: $deep-orange-300; - background: rgba($deep-orange-300, .05); .punctuation.definition.string { foreground: $deep-orange-300; @@ -73,13 +64,7 @@ } // Level 4. - .meta.structure.dictionary - .meta.structure.dictionary - .meta.structure.dictionary - .meta.structure.dictionary - .meta.structure.dictionary - .meta.structure.dictionary - .meta.structure.dictionary { + #{repeatString('.meta.structure.dictionary', 7)} { .punctuation.section.dictionary { foreground: $deep-orange-300; } @@ -87,7 +72,6 @@ .meta.structure.dictionary.key { .string { foreground: $teal-300; - background: rgba($teal-300, .1); .punctuation.definition.string { foreground: $teal-300; @@ -97,15 +81,7 @@ } // Level 5. - .meta.structure.dictionary - .meta.structure.dictionary - .meta.structure.dictionary - .meta.structure.dictionary - .meta.structure.dictionary - .meta.structure.dictionary - .meta.structure.dictionary - .meta.structure.dictionary - .meta.structure.dictionary { + #{repeatString('.meta.structure.dictionary', 9)} { .punctuation.section.dictionary { foreground: $teal-300; } @@ -113,7 +89,6 @@ .meta.structure.dictionary.key { .string { foreground: $pink-300; - background: rgba($pink-300, .1); .punctuation.definition.string { foreground: $pink-300; @@ -123,17 +98,7 @@ } // Level 6. - .meta.structure.dictionary - .meta.structure.dictionary - .meta.structure.dictionary - .meta.structure.dictionary - .meta.structure.dictionary - .meta.structure.dictionary - .meta.structure.dictionary - .meta.structure.dictionary - .meta.structure.dictionary - .meta.structure.dictionary - .meta.structure.dictionary { + #{repeatString('.meta.structure.dictionary', 11)} { .punctuation.section.dictionary { foreground: $pink-300; } @@ -141,7 +106,6 @@ .meta.structure.dictionary.key { .string { foreground: $purple-300; - background: rgba($purple-300, .1); .punctuation.definition.string { foreground: $purple-300; @@ -151,19 +115,7 @@ } // Level 7. - .meta.structure.dictionary - .meta.structure.dictionary - .meta.structure.dictionary - .meta.structure.dictionary - .meta.structure.dictionary - .meta.structure.dictionary - .meta.structure.dictionary - .meta.structure.dictionary - .meta.structure.dictionary - .meta.structure.dictionary - .meta.structure.dictionary - .meta.structure.dictionary - .meta.structure.dictionary { + #{repeatString('.meta.structure.dictionary', 13)} { .punctuation.section.dictionary { foreground: $purple-300; } @@ -171,7 +123,6 @@ .meta.structure.dictionary.key { .string { foreground: $amber-300; - background: rgba($amber-300, .05); .punctuation.definition.string { foreground: $amber-300; @@ -181,21 +132,7 @@ } // Level 8 - n. - .meta.structure.dictionary - .meta.structure.dictionary - .meta.structure.dictionary - .meta.structure.dictionary - .meta.structure.dictionary - .meta.structure.dictionary - .meta.structure.dictionary - .meta.structure.dictionary - .meta.structure.dictionary - .meta.structure.dictionary - .meta.structure.dictionary - .meta.structure.dictionary - .meta.structure.dictionary - .meta.structure.dictionary - .meta.structure.dictionary { + #{repeatString('.meta.structure.dictionary', 15)} { .punctuation.section.dictionary { foreground: $amber-300; } @@ -203,7 +140,6 @@ .meta.structure.dictionary.key { .string { foreground: $amber-300; - background: rgba($amber-300, .05); .punctuation.definition.string { foreground: $amber-300; diff --git a/schemes/candyman/_keyword.scss b/schemes/candyman/_keyword.scss index 06b8b1d6..414504fe 100644 --- a/schemes/candyman/_keyword.scss +++ b/schemes/candyman/_keyword.scss @@ -11,44 +11,62 @@ // the License. .keyword { - foreground: $pink-a100; -} + foreground: $red-a100; -.keyword.control.conditional { - foreground: $brown-200; -} + &.control { + &.conditional { + foreground: $teal-a400; + fontStyle: italic; + } -.keyword.control.flow { - foreground: $deep-orange-300; - background: rgba($deep-orange-300, .05); - fontStyle: italic; -} + &.flow { + foreground: $green-200; + fontStyle: italic; -.keyword.control.import-export { - foreground: $teal-200; - background: rgba($teal-300, .05); - fontStyle: italic; -} + &.break.throw { + foreground: $purple-a100; + } -.keyword.control.loop { - foreground: $orange-300; - background: rgba($orange-300, .05); - fontStyle: italic; -} + &.return { + foreground: $purple-a100; + } + } + + &.import-export { + foreground: $green-200; + fontStyle: none; -.keyword.control.trycatch { - foreground: $pink-300; - background: rgba($pink-300, .05); - fontStyle: italic; + &.default { + foreground: $deep-purple-200; + } + } + + &.loop { + foreground: $deep-orange-300; + fontStyle: italic; + } + + &.trycatch { + foreground: $red-a200; + fontStyle: italic; + } + } } .keyword.operator { foreground: $green-a200; - fontStyle: bold; + + &.pipe { + foreground: $light-blue-300; + } &.word { - foreground: $pink-a100; + foreground: $red-a100; fontStyle: italic; + + &.of { + foreground: $green-200; + } } } diff --git a/schemes/candyman/_number.scss b/schemes/candyman/_number.scss index 771b9e3c..c55ef5ac 100644 --- a/schemes/candyman/_number.scss +++ b/schemes/candyman/_number.scss @@ -15,7 +15,7 @@ } .constant.numeric { - foreground: $orange-200; + foreground: $orange-400; &.float { foreground: $purple-200; diff --git a/schemes/candyman/_punctuation.scss b/schemes/candyman/_punctuation.scss index 7206979b..1ef6b05a 100644 --- a/schemes/candyman/_punctuation.scss +++ b/schemes/candyman/_punctuation.scss @@ -12,21 +12,17 @@ .punctuation { &.accessor, - &.comma, + &.separator.comma, &.terminator { foreground: $green-a200; fontStyle: bold; } &.definition.template-expression { - foreground: $red-300; + foreground: $gray-100; + fontStyle: none; } -// &.separator.comma, -// &.section.group { -// foreground: $amber-200; -// fontStyle: none; -// } } // .meta.generic { diff --git a/schemes/candyman/_string.scss b/schemes/candyman/_string.scss index d6cfebc9..6c82a117 100644 --- a/schemes/candyman/_string.scss +++ b/schemes/candyman/_string.scss @@ -11,20 +11,9 @@ // the License. .string { - foreground: $amber-300; - background: rgba($amber-300, .035); + foreground: $lime-300; .punctuation.definition.string { - foreground: $amber-300; - } -} - - -.string.regexp { - foreground: $teal-300; - background: rgba($teal-300, .035); - - .punctuation.definition.string { - foreground: $teal-300; + foreground: $lime-300; } } diff --git a/schemes/candyman/_type.scss b/schemes/candyman/_type.scss index 4500c2e7..f5b52955 100644 --- a/schemes/candyman/_type.scss +++ b/schemes/candyman/_type.scss @@ -10,6 +10,7 @@ // License for the specific language governing permissions and limitations under // the License. +.variable.type, .variable.other.type { foreground: $light-green-300; } diff --git a/schemes/candyman/_variable.scss b/schemes/candyman/_variable.scss index 41c6086f..64b64ea9 100644 --- a/schemes/candyman/_variable.scss +++ b/schemes/candyman/_variable.scss @@ -17,6 +17,11 @@ fontStyle: none; } +.variable.other.object { + foreground: $brown-200; + fontStyle: italic; +} + .support.variable { foreground: $deep-orange-a100; } diff --git a/schemes/candyman/function/_parameters.scss b/schemes/candyman/function/_parameters.scss index d3679df6..5922ddb2 100644 --- a/schemes/candyman/function/_parameters.scss +++ b/schemes/candyman/function/_parameters.scss @@ -11,7 +11,7 @@ // the License. .variable.parameter.function { - foreground: $orange-200; + foreground: $amber-200; } // .meta.function.parameters { diff --git a/schemes/candyman/global/_jest.scss b/schemes/candyman/global/_jest.scss index c6a0c991..d7518d54 100644 --- a/schemes/candyman/global/_jest.scss +++ b/schemes/candyman/global/_jest.scss @@ -12,7 +12,6 @@ .support.type.object.jest { foreground: $deep-orange-300; - background: rgba($deep-orange-300, .1); &.matcher.not { foreground: $red-300; @@ -21,10 +20,10 @@ } .support.function.jest { - foreground: $pink-300; + foreground: $red-300; &.matcher { - foreground: $green-200; + foreground: $deep-orange-300; } &.skip, From e52282ee9858d966eef2f11f0ec7d809a86630cb Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Wed, 3 Jan 2018 12:46:15 -0200 Subject: [PATCH 368/407] Make operators bold --- schemes/candyman/_keyword.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/schemes/candyman/_keyword.scss b/schemes/candyman/_keyword.scss index 414504fe..b1541e59 100644 --- a/schemes/candyman/_keyword.scss +++ b/schemes/candyman/_keyword.scss @@ -55,6 +55,7 @@ .keyword.operator { foreground: $green-a200; + fontStyle: bold; &.pipe { foreground: $light-blue-300; From ba6491a6acefcc0ad13d98ea2d65aabd5e69f6e0 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Wed, 3 Jan 2018 20:28:51 -0200 Subject: [PATCH 369/407] [FJSX15] Add core functions again --- syntaxes/fjsx15/core.sublime-syntax | 354 ++++++++++++++++++++++++++-- 1 file changed, 332 insertions(+), 22 deletions(-) diff --git a/syntaxes/fjsx15/core.sublime-syntax b/syntaxes/fjsx15/core.sublime-syntax index 9e8ee189..4273487e 100644 --- a/syntaxes/fjsx15/core.sublime-syntax +++ b/syntaxes/fjsx15/core.sublime-syntax @@ -17,32 +17,75 @@ hidden: true scope: ... +variables: + mathFunctions: | + (?> abs + | acosh? + | asinh? + | atan(?>2|h)? + | cbrt + | ceil + | clz32 + | cosh? + | exp + | exp(?:m1)? + | floor + | fround + | hypot + | imul + | log(?>10|1p|2)? + | max + | min + | pow + | random + | round + | sign + | sinh? + | sqrt + | tanh? + | trunc + )\b + + objectFunctions: | + (?> assign + | create + | definePropert(?>ies|y) + | freeze + | getOwnProperty(?>Descriptors?|Names|Symbols) + | getPrototypeOf + | is(?>Extensible|Frozen|Sealed)? + | keys + | preventExtensions + | seal + | setPrototypeOf + )\b + + symbolFunctions: | + (?> for + | KeyFor + )\b + + contexts: main: - # - include: array-functions - include: console - - include: console-functions - - include: console-function-calls - # - include: math-constants - # - include: math-functions - # - include: object-functions - # - include: symbol-functions - # - include: symbol-properties # https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects - include: constants + - include: variables + - include: functions # - include: variables # - include: functions # - include: import-properties - # - include: fundamental-objects - # - include: numbers-and-dates - # - include: text-processing - # - include: indexed-collections - # - include: keyed-collections - # - include: structured-data - # - include: control-abstraction-objects - # - include: reflection - # - include: internationalization - # - include: web-assembly + - include: fundamental-objects + - include: numbers-and-dates + - include: text-processing + - include: indexed-collections + - include: keyed-collections + - include: structured-data + - include: control-abstraction-objects + - include: reflection + - include: internationalization + - include: web-assembly escape: - match: (?=\s*\S) @@ -55,11 +98,12 @@ contexts: arguments: - include: Packages/Naomi/syntaxes/fjsx15/function-call/arguments.sublime-syntax + function-call-meta-scope: + - meta_scope: meta.function-call.js.fjsx15 + - include: pop-now + console: - - match: | - (?x) - \s*(console) - \s*(\.) + - match: \s*(console)\s*(\.) captures: 1: support.type.object.console.js.fjsx15 2: punctuation.accessor.js.fjsx15 @@ -151,3 +195,269 @@ contexts: 5: constant.language.boolean.true.js.fjsx15 6: constant.language.undefined.js.fjsx15 pop: true + + variables: + - match: \s*(prototype)\b + captures: + 1: variable.language.prototype.js.fjsx15 + pop: true + - match: \s*(super)\b + captures: + 1: variable.language.super.js.fjsx15 + pop: true + - match: \s*(this)\b + captures: + 1: variable.language.this.js.fjsx15 + pop: true + + functions: + - match: | + (?x)\s* + ((?> decodeURI(?:Component)? + | encodeURI(?:Component)? + | eval + | is(?>Finite|NaN) + | parse(?>Float|Int) + )) + (?=\s*\() + captures: + 1: support.function.js.fjsx15 + set: [ + function-call-meta-scope, + arguments + ] + + fundamental-objects: + - match: \s*(Object)\s*(\.) + captures: + 1: support.type.object.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + set: object-property-or-function + - match: \s*(Symbol)\s*(\.) + captures: + 1: support.type.object.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + set: symbol-property-or-function + - match: | + (?x)\s* + ((?> Boolean + | Error + | EvalError + | Function + | InternalError + | Object + | RangeError + | ReferenceError + | Symbol + | SyntaxError + | TypeError + | URIError + ))\b + captures: + 1: support.type.object.js.fjsx15 + pop: true + + object-property-or-function: + # Function call. + - match: | + (?x) + ({{objectFunctions}}) + (?=\s*\() + captures: + 1: support.function.js.fjsx15 + set: [ + function-call-meta-scope, + arguments + ] + # Function reference. + - match: | + (?x) + ({{objectFunctions}}) + captures: + 1: support.function.js.fjsx15 + pop: true + + symbol-property-or-function: + # Function call. + - match: | + (?x) + ({{symbolFunctions}}) + (?=\s*\() + captures: + 1: support.function.js.fjsx15 + set: [ + function-call-meta-scope, + arguments + ] + # Function reference. + - match: | + (?x) + ({{symbolFunctions}}) + captures: + 1: support.function.js.fjsx15 + pop: true + numbers-and-dates: + - match: \s*(Math)\s*(\.) + captures: + 1: support.type.object.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + set: math-property-or-function + - match: | + (?x)\s* + ((?> Date + | Math + | Number + ))\b + captures: + 1: support.type.object.js.fjsx15 + pop: true + + math-property-or-function: + # Function call. + - match: | + (?x) + ({{mathFunctions}}) + (?=\s*\() + captures: + 1: support.function.js.fjsx15 + set: [ + function-call-meta-scope, + arguments + ] + # Function reference. + - match: | + (?x) + ({{mathFunctions}}) + captures: + 1: support.function.js.fjsx15 + pop: true + # Constants. + - match: | + (?x)\s* + ((?> E + | LN(?>10|2) + | LOG(?>10E|2E) + | PI + | SQRT(?>1_2|2) + ))\b + captures: + 1: support.constant.js.fjsx15 + pop: true + + text-processing: + - match: | + (?x)\s* + ((?> RegExp + | String + ))\b + captures: + 1: support.type.object.js.fjsx15 + pop: true + + indexed-collections: + - match: \s*(Array)\s*(\.) + captures: + 1: support.type.object.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + set: array-property-or-function + - match: | + (?x)\s* + ((?> Array + | Float(?>32|64)Array + | Int(?>8|16|32)Array + | Uint(?>8|16|32)Array + | Uint8ClampedArray + ))\b + captures: + 1: support.type.object.js.fjsx15 + pop: true + + array-property-or-function: + # Function. + - match: | + (?x)\s* + ((?> from + | isArray + ))\b + captures: + 1: support.function.js.fjsx15 + set: [ + function-call-meta-scope, + arguments + ] + + keyed-collections: + - match: | + (?x)\s* + ((?> Map + | Set + | Weak(?>Map|Set) + ))\b + captures: + 1: support.type.object.js.fjsx15 + pop: true + + structured-data: + - match: | + (?x)\s* + ((?> ArrayBuffer + | DataView + | JSON + ))\b + captures: + 1: support.type.object.js.fjsx15 + pop: true + + control-abstraction-objects: + - match: | + (?x)\s* + ((?> Generator(?:Function)? + | Promise + ))\b + captures: + 1: support.type.object.js.fjsx15 + pop: true + + reflection: + - match: | + (?x)\s* + ((?> Proxy + | Reflect + ))\b + captures: + 1: support.type.object.js.fjsx15 + pop: true + + internationalization: + - match: | + (?x) + \s*(Intl)\b + (?: + \s*(\.)\s* + ((?> Collator + | DateTimeFormat + | NumberFormat + ))\b + )? + captures: + 1: support.type.object.js.fjsx15 + pop: true + + web-assembly: + - match: | + (?x) + \s*(WebAssembly)\b + (?: + \s*(\.)\s* + ((?> CompileError + | Instance + | LinkError + | Memory + | Module + | RuntimeError + | Table + ))\b + )? + captures: + 1: support.type.object.js.fjsx15 + pop: true From abab79ad9aec9e9b3f0bc1c8c473568af46fb41c Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Wed, 3 Jan 2018 20:29:05 -0200 Subject: [PATCH 370/407] [FJSX15] Normalize scopes --- syntaxes/fjsx15/jsx1.sublime-syntax | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/syntaxes/fjsx15/jsx1.sublime-syntax b/syntaxes/fjsx15/jsx1.sublime-syntax index 129d8cbd..09cf8483 100644 --- a/syntaxes/fjsx15/jsx1.sublime-syntax +++ b/syntaxes/fjsx15/jsx1.sublime-syntax @@ -41,7 +41,7 @@ contexts: # Embedded javascript. - match: \s*(\{) captures: - 1: keyword.operator.other.embedded.js.begin.jsx.jsx1 + 1: punctuation.definition.template-expression.begin.jsx.jsx1 push: [ embedded-js-close, optional-expression @@ -53,7 +53,7 @@ contexts: - meta_scope: source.js.fjsx15 - match: \s*(}) captures: - 1: keyword.operator.other.embedded.js.end.jsx.jsx1 + 1: punctuation.definition.template-expression.end.jsx.jsx1 pop: true optional-expression: From 4d51eaf7ebe57e803a6bdd5cfeb34fcaeb377305 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Wed, 3 Jan 2018 20:29:29 -0200 Subject: [PATCH 371/407] Add markup colors --- Candyman.scsscheme | 1 + schemes/candyman/_markup.scss | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 schemes/candyman/_markup.scss diff --git a/Candyman.scsscheme b/Candyman.scsscheme index d7e4ce47..5e3266e2 100644 --- a/Candyman.scsscheme +++ b/Candyman.scsscheme @@ -33,6 +33,7 @@ @import 'schemes/candyman/global/jest'; @import 'schemes/candyman/json'; @import 'schemes/candyman/keyword'; +@import 'schemes/candyman/markup'; @import 'schemes/candyman/modifier'; @import 'schemes/candyman/number'; @import 'schemes/candyman/object'; diff --git a/schemes/candyman/_markup.scss b/schemes/candyman/_markup.scss new file mode 100644 index 00000000..0ab323d1 --- /dev/null +++ b/schemes/candyman/_markup.scss @@ -0,0 +1,20 @@ +// Licensed under the Apache License, Version 2.0 (the “License”); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +.meta.tag { + foreground: $brown-200; +} + +.entity.other.attribute-name { + foreground: $green-200; + fontStyle: italic; +} From e0e234fafcdee26300af8990f231971be2259804 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Wed, 3 Jan 2018 20:29:48 -0200 Subject: [PATCH 372/407] Add label rules --- Candyman.scsscheme | 1 + schemes/candyman/_label.scss | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 schemes/candyman/_label.scss diff --git a/Candyman.scsscheme b/Candyman.scsscheme index 5e3266e2..3fda8b25 100644 --- a/Candyman.scsscheme +++ b/Candyman.scsscheme @@ -33,6 +33,7 @@ @import 'schemes/candyman/global/jest'; @import 'schemes/candyman/json'; @import 'schemes/candyman/keyword'; +@import 'schemes/candyman/label'; @import 'schemes/candyman/markup'; @import 'schemes/candyman/modifier'; @import 'schemes/candyman/number'; diff --git a/schemes/candyman/_label.scss b/schemes/candyman/_label.scss new file mode 100644 index 00000000..d6214947 --- /dev/null +++ b/schemes/candyman/_label.scss @@ -0,0 +1,17 @@ +// Licensed under the Apache License, Version 2.0 (the “License”); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +.variable.other.label, +.entity.name.label { + foreground: $gray-300; + fontStyle: italic bold; +} From 0b8b6bb3840ba4d0d05ef8835d26bd62fb7606b3 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Wed, 3 Jan 2018 20:30:26 -0200 Subject: [PATCH 373/407] Balance color and token weights --- schemes/candyman/_constant.scss | 9 +- schemes/candyman/_function.scss | 8 +- schemes/candyman/_punctuation.scss | 134 +++------------------------ schemes/candyman/_type.scss | 3 +- schemes/candyman/_variable.scss | 27 +++++- schemes/candyman/function/_body.scss | 1 + schemes/candyman/global/_jest.scss | 2 +- 7 files changed, 49 insertions(+), 135 deletions(-) diff --git a/schemes/candyman/_constant.scss b/schemes/candyman/_constant.scss index d744f8a0..85d5016f 100644 --- a/schemes/candyman/_constant.scss +++ b/schemes/candyman/_constant.scss @@ -10,14 +10,17 @@ // License for the specific language governing permissions and limitations under // the License. +entity.name.constant { + foreground: $purple-200; +} + .variable.other.constant, -.entity.name.constant, .punctuation.definition.constant { - foreground: $purple-200; + foreground: $brown-200; } .support.constant { - foreground: $deep-orange-a100; + foreground: $purple-a100; } .constant.language { diff --git a/schemes/candyman/_function.scss b/schemes/candyman/_function.scss index 35493fef..b4842673 100644 --- a/schemes/candyman/_function.scss +++ b/schemes/candyman/_function.scss @@ -11,13 +11,15 @@ // the License. .entity.name.function { - foreground: $light-blue-300; + foreground: $blue-300; + fontStyle: italic; } .variable.function { - foreground: $light-blue-300; + foreground: $blue-300; } .support.function { - foreground: $deep-orange-300; + foreground: $purple-a100; + fontStyle: italic; } diff --git a/schemes/candyman/_punctuation.scss b/schemes/candyman/_punctuation.scss index 1ef6b05a..7c4147f6 100644 --- a/schemes/candyman/_punctuation.scss +++ b/schemes/candyman/_punctuation.scss @@ -18,128 +18,18 @@ fontStyle: bold; } - &.definition.template-expression { - foreground: $gray-100; - fontStyle: none; + &.separator.key-value { + foreground: $deep-orange-300; } + &.definition { + &.tag { + foreground: $brown-300; + fontStyle: none; + } + &.template-expression { + foreground: $deep-orange-300; + fontStyle: bold; + } + } } - -// .meta.generic { -// .punctuation.separator.comma, -// .punctuation.definition.generic { -// foreground: $brown-300; -// } -// } - -// .meta.template. - -// @for $i from 1 through 7 { -// #{repeatString('meta.annotation .meta.group', $i)} -// .meta.group, -// #{repeatString('meta.conditional .meta.group', $i)} -// .meta.group, -// #{repeatString('meta.function.parameters meta.group', $i)} -// .meta.group, -// #{repeatString('meta.function-call meta.group', $i)} -// .meta.group { -// .punctuation { -// &.section.group, -// &.separator.comma { -// foreground: $amber-200; -// fontStyle: none; -// } -// } -// } -// } - -// Groups inside function calls. -// @for $i from 1 through 100 { -// .animation#{$i} { -// animation-delay: random(100) * 0.1 + s !important; -// animation-duration: max(random(20), 10) + s; -// animation-iteration-count: infinite; -// animation-name: pulsatingBlock; -// } -// } - - -// .meta.function-call -// .meta.group -// .meta.group, - -// .meta.function-call -// .meta.group -// .meta.function-call -// .meta.group -// .meta.group, - -// .meta.function-call -// .meta.group -// .meta.function-call -// .meta.group -// .meta.function-call -// .meta.group -// .meta.group, - -// .meta.function-call -// .meta.group -// .meta.function-call -// .meta.group -// .meta.function-call -// .meta.group -// .meta.function-call -// .meta.group -// .meta.group, - -// .meta.function-call -// .meta.group -// .meta.function-call -// .meta.group -// .meta.function-call -// .meta.group -// .meta.function-call -// .meta.group -// .meta.function-call -// .meta.group -// .meta.group { -// .punctuation { -// &.separator.comma { -// foreground: $green-a200; -// } -// &.section.group { -// foreground: $amber-100; -// } -// } -// } - - -// .meta.conditional { -// .meta.block -// .punctuation.section.block { -// foreground: $green-200; -// } - -// .meta.group { -// .punctuation { -// &.separator.comma, -// &.section.group { -// foreground: $green-200; -// } -// } -// } -// } - -// .punctuation.other.property.access { -// foreground: $light-green-300; -// } - -// .punctuation.definition.block, -// .punctuation.definition.control { -// foreground: $pink-a100; -// } - -// .punctuation.definition.extend-list.separator, -// .punctuation.definition.implement-list.separator { -// foreground: $purple-200; -// } diff --git a/schemes/candyman/_type.scss b/schemes/candyman/_type.scss index f5b52955..7508ab4f 100644 --- a/schemes/candyman/_type.scss +++ b/schemes/candyman/_type.scss @@ -16,14 +16,13 @@ } .support.type { - foreground: $deep-orange-a100; + foreground: $deep-purple-a100; } .support.type.object { fontStyle: italic; &.console { foreground: $green-200; - background: rgba($green-200, .05); } } diff --git a/schemes/candyman/_variable.scss b/schemes/candyman/_variable.scss index 64b64ea9..0594b247 100644 --- a/schemes/candyman/_variable.scss +++ b/schemes/candyman/_variable.scss @@ -13,13 +13,32 @@ .variable.other.readwrite, .entity.name.variable, .punctuation.definition.variable { - foreground: $gray-400; + foreground: $gray-300; fontStyle: none; } -.variable.other.object { - foreground: $brown-200; - fontStyle: italic; +.variable { + &.other.object { + foreground: $brown-200; + fontStyle: italic; + } + + &.language { + &.prototype, + &.this { + foreground: $red-300; + fontStyle: italic; + } + + &.super { + foreground: $deep-orange-300; + } + + &.this { + foreground: $purple-a100; + fontStyle: italic; + } + } } .support.variable { diff --git a/schemes/candyman/function/_body.scss b/schemes/candyman/function/_body.scss index 10c84b07..537b5688 100644 --- a/schemes/candyman/function/_body.scss +++ b/schemes/candyman/function/_body.scss @@ -12,6 +12,7 @@ .storage.type.function.arrow { foreground: $light-blue-300; + fontStyle: bold; } // .meta.function { diff --git a/schemes/candyman/global/_jest.scss b/schemes/candyman/global/_jest.scss index d7518d54..a90a3b3b 100644 --- a/schemes/candyman/global/_jest.scss +++ b/schemes/candyman/global/_jest.scss @@ -11,7 +11,7 @@ // the License. .support.type.object.jest { - foreground: $deep-orange-300; + foreground: $red-300; &.matcher.not { foreground: $red-300; From a1423be5b57e912b3ecd91343465bc2319800f40 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Wed, 3 Jan 2018 20:32:23 -0200 Subject: [PATCH 374/407] Remove dead code --- schemes/candyman/old.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/schemes/candyman/old.scss b/schemes/candyman/old.scss index 55f47235..85ce79cc 100644 --- a/schemes/candyman/old.scss +++ b/schemes/candyman/old.scss @@ -14,7 +14,6 @@ @import 'old/js'; @import 'old/json'; @import 'old/jsx'; -@import 'old/main'; @import 'old/markup'; @import 'old/md'; @import 'old/mql'; From ba2ef8d69d37100ea4cd6c05822a92422db6ad5d Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Wed, 3 Jan 2018 20:32:31 -0200 Subject: [PATCH 375/407] Build candyman --- Candyman.tmTheme | 1257 ++++++++++++---------------------------------- 1 file changed, 311 insertions(+), 946 deletions(-) diff --git a/Candyman.tmTheme b/Candyman.tmTheme index d0c71f42..2a122361 100644 --- a/Candyman.tmTheme +++ b/Candyman.tmTheme @@ -565,1631 +565,1017 @@ scope - .entity.name.alias + .entity.name.attribute settings foreground - #ffecb3 + #9ccc65 scope - .entity.name.ambiguous + .section.cdata settings foreground - #ffecb3 + #ff80ab scope - .entity.name.type.array, .punctuation.definition.array + .section.cdata .entity.name settings foreground - #ff9e80 + #ff80ab scope - .punctuation.definition.array.access + .section.cdata .punctuation.definition settings foreground - #ffd180 + #FF80ABB2 scope - .keyword.operator.cast, .punctuation.definition.cast + .entity.name.data-attribute settings foreground - #bcaaa4 + #ffffff scope - .entity.name.class, .punctuation.definition.class + .declaration.doctype settings foreground - #aed581 + #ff80ab scope - .support .entity.name.class + .declaration.doctype .entity.name settings foreground - #ff9e80 + #ff80ab scope - .punctuation.definition.color + .declaration.doctype .punctuation.definition.declaration settings foreground - #FFCC8080 + #FF80ABB2 scope - .constant.color + .text.html .keyword.operator settings foreground - #ffcc80 + #CE93D8B2 scope - .comment, .comment .punctuation.definition + .instruction.prolog settings foreground - #607d8b + #ff80ab scope - .comment .entity.email, .comment .entity.link + .instruction.prolog .entity.name settings foreground - #90a4ae + #ff80ab scope - .entity.name.constant, .punctuation.definition.constant + .instruction.prolog .punctuation.definition.instruction settings foreground - #ce93d8 + #FF80ABB2 scope - .support .entity.name.constant + .source.jsx, .text.html, .text.md, .text.xml settings foreground - #ff9e80 + #BDBDBD66 scope - .punctuation.definition.datetime + .punctuation.definition.code-block settings foreground - #FFCC8080 + #ff80ab scope - .constant.datetime + .level-1 .entity.name.header, .level-1 .punctuation.definition.header settings foreground - #ffcc80 + #ce93d8 scope - .keyword.operator.other.embedded-expression + .level-2 .entity.name.header, .level-2 .punctuation.definition.header settings foreground - #CE93D8B2 + #4dd0e1 scope - .entity.name.enum, .punctuation.definition.enum + .level-3 .entity.name.header, .level-3 .punctuation.definition.header settings foreground - #aed581 + #9ccc65 scope - .function.call .entity.name.variable + .level-4 .entity.name.header, .level-4 .punctuation.definition.header settings foreground - #4fc3f7 + #4db6ac scope - .entity.name.function, .keyword.operator.other.computed-function, .punctuation.definition.function + .level-5 .entity.name.header, .level-5 .punctuation.definition.header settings foreground - #4fc3f7 + #ffab91 scope - .support .entity.name.function, .support .keyword.operator.other.computed-function, .support .punctuation.definition.function + .level-6 .entity.name.header, .level-6 .punctuation.definition.header settings foreground - #ff9e80 + #ffe082 scope - .function.parameter .entity.name.variable, .function.parameter .punctuation.definition.variable + .support .entity.name.property.mql settings foreground - #ffcc80 + #ff9e80 scope - .markup.deleted.git_gutter + .entity.name.selector settings foreground - #f36c60 + #ff80ab scope - .markup.inserted.git_gutter + .punctuation.definition.selector settings foreground - #aed581 + #FF80AB80 scope - .markup.changed.git_gutter + .extension .entity.name.selector settings foreground - #ff9e80 + #e0e0e0 scope - .markup.ignored.git_gutter + .extension .punctuation.definition.selector settings foreground - #4dd0e1 + #E0E0E0B2 scope - .markup.untracked.git_gutter + .entity.name.selector.class settings foreground - #ffffff + #4dd0e1 scope - .entity.name.interface, .punctuation.definition.interface + .punctuation.definition.selector.class settings foreground - #aed581 + #4DD0E1B2 scope - .support .entity.name.interface + .entity.name.selector.id settings foreground - #ff9e80 + #ec407a scope - .keyword + .punctuation.definition.selector.id settings foreground - #ff80ab + #EC407AB2 scope - .storage.modifier + .entity.name.selector.placeholder settings foreground - #b39ddb + #ffcc80 scope - .storage.modifier .keyword, .storage.modifier .keyword.operator + .punctuation.definition.selector.placeholder settings foreground - #b39ddb + #FFCC8080 scope - .storage.type + .entity.name.selector.tag settings foreground - #b39ddb + #bcaaa4 scope - .storage.type .keyword + .source.css .support .entity.name.attribute, .source.scss .support .entity.name.attribute settings foreground - #b39ddb + #aed581 scope - .entity.name.label, .punctuation.definition.label + .source.css .extension .entity.name.attribute, .source.scss .extension .entity.name.attribute settings foreground - #ffffff + #e0e0e0 scope - .entity.name.namespace + .entity.name.mixin, .punctuation.definition.mixin settings foreground - #bcaaa4 + #4fc3f7 scope - .punctuation.definition.namespace + .source.scss .keyword.operator.other.comma, .source.scss .keyword.operator.other.association, .source.scss .keyword.other.terminator settings foreground - #BCAAA480 + #ffffff scope - .constant.numeric + .source.scss .punctuation.definition.body settings foreground - #ffcc80 + #ffffff scope - .constant.numeric.float + source.scss .keyword.modifier.unit settings foreground - #ce93d8 + #ff9e80 scope - .constant.numeric.binary + .source.scss .declaration .entity.name.variable settings foreground - #4dd0e1 + #bcaaa4 scope - .constant.numeric.octal + .meta.annotation .variable.annotation, .meta.annotation .punctuation.definition settings + fontStyle + italic foreground - #dce775 + #ea80fc scope - .constant.numeric.hex + .entity.name.class settings + background + #AED58106 foreground - #e0e0e0 + #aed581 scope - .punctuation.definition.object + .entity.other.inherited-class settings + background + #EA80FC06 foreground - #aed581 + #ea80fc scope - .object .keyword.operator + .comment, .comment .punctuation.definition settings foreground - #aed581 + #607d8b scope - .object.property .entity.name.variable + .comment .entity.email, .comment .entity.link settings foreground - #bcaaa4 + #cfd8dc scope - .keyword.operator + entity.name.constant settings foreground - #5af158 + #ce93d8 scope - .word .keyword.operator + .variable.other.constant, .punctuation.definition.constant settings foreground - #ff80ab + #bcaaa4 scope - .keyword.preprocessor + .support.constant settings foreground - #ffcc80 + #ea80fc scope - .punctuation.definition + .constant.language settings foreground - #ffecb3 + #f36c60 scope - .punctuation.other.property.access + .constant.language.infinity, .constant.language.nan settings foreground - #aed581 + #ea80fc scope - .punctuation.definition.block, .punctuation.definition.control + .constant.language.boolean settings foreground - #ff80ab + #72d572 scope - .punctuation.definition.extend-list.separator, .punctuation.definition.implement-list.separator + .entity.name.function settings + fontStyle + italic foreground - #ce93d8 + #64b5f6 scope - .string.unquoted.regex, .string.unquoted.regex .punctuation.definition + .variable.function settings foreground - #26a69a + #64b5f6 scope - .string + .support.function settings + fontStyle + italic foreground - #f36c60 + #ea80fc scope - .string .punctuation.definition + .storage.type.function.arrow settings + fontStyle + bold foreground - #F36C6080 + #4fc3f7 scope - .constant.character + .variable.parameter.function settings foreground - #f36c60 + #ffe082 scope - .constant.character.escape.a + .support.function.console.error settings foreground - #80deea + #f36c60 scope - .constant.character.escape.b + .support.function.console.info settings foreground - #aed581 + #4db6ac scope - .string .variable.a .entity.name.variable, .string .variable.a .punctuation.definition.variable, .string .variable.a .keyword.operator + .support.function.console.log settings foreground - #ce93d8 + #bcaaa4 scope - .string .variable.b .entity.name.variable, .string .variable.b .punctuation.definition.variable, .string .variable.b .keyword.operator + .support.function.console.warn settings foreground - #f06292 + #ff8a65 scope - .string .variable .array.key + .support.type.object.jest settings foreground - #a1887f + #f36c60 scope - .entity.name.struct, .punctuation.definition.struct + .support.type.object.jest.matcher.not settings + fontStyle + bold foreground - #aed581 + #f36c60 scope - .support .entity.name.struct + .support.function.jest settings foreground - #ff9e80 + #f36c60 scope - .punctuation.definition.template + .support.function.jest.matcher settings foreground - #bcaaa4 + #ff8a65 scope - .entity.name.trait, .punctuation.definition.trait + .support.function.jest.skip, .support.function.jest.only settings + background + #FF8A651A + fontStyle + bold foreground - #aed581 + #f36c60 scope - .support .entity.name.trait + .source.json .punctuation.section.dictionary settings foreground - #ff9e80 + #ce93d8 scope - .entity.name.type, .punctuation.definition.type + .source.json .meta.structure.dictionary .meta.structure.dictionary.key .string settings foreground - #aed581 + #4dd0e1 scope - .support .entity.name.type, .support .punctuation.definition.type + .source.json .meta.structure.dictionary .meta.structure.dictionary.key .string .punctuation.definition.string settings foreground - #ff9e80 + #4dd0e1 scope - .entity.name.unknown + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .punctuation.section.dictionary settings foreground - #ffecb3 + #4dd0e1 scope - .entity.name.variable, .punctuation.definition.variable + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string settings - fontStyle - foreground - #bdbdbd + #aed581 scope - .support .entity.name.variable, .support .punctuation.definition.variable + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string .punctuation.definition.string settings foreground - #ff9e80 + #aed581 scope - .comment .entity.name.alias + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .punctuation.section.dictionary settings foreground - #FFECB3B2 + #aed581 scope - .comment .entity.name.class, .comment .punctuation.definition.class + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string settings foreground - #AED581B2 + #ff8a65 scope - .comment .support .entity.name.class + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string .punctuation.definition.string settings foreground - #FF9E80B2 + #ff8a65 scope - .comment .entity.name.constant, .comment .punctuation.definition.constant + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .punctuation.section.dictionary settings foreground - #CE93D8B2 + #ff8a65 scope - .comment .support .entity.name.constant, .comment .support .punctuation.definition.constant + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string settings foreground - #FF9E80B2 + #4db6ac scope - .comment .entity.name.function, .comment .punctuation.definition.function + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string .punctuation.definition.string settings foreground - #4FC3F7B2 + #4db6ac scope - .comment .support .entity.name.function, .comment .support .punctuation.definition.function + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .punctuation.section.dictionary settings foreground - #FF9E80B2 + #4db6ac scope - .comment .function.parameter .entity.name.variable, .comment .function.parameter .punctuation.definition.variable + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string settings foreground - #FFCC80B2 + #f06292 scope - .comment .entity.name.namespace + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string .punctuation.definition.string settings foreground - #BCAAA4B2 + #f06292 scope - .comment .punctuation.definition.namespace + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .punctuation.section.dictionary settings foreground - #BCAAA466 + #f06292 scope - .comment .import .entity.name.aliased, .comment .import .entity.name.ambiguous + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string settings foreground - #BCAAA4B2 + #ba68c8 scope - .comment .punctuation.definition.import + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string .punctuation.definition.string settings foreground - #FFFFFFB2 + #ba68c8 scope - .comment .entity.name.interface, .comment .punctuation.definition.interface + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .punctuation.section.dictionary settings foreground - #AED581B2 + #ba68c8 scope - .comment .support .entity.name.interface + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string settings foreground - #FF9E80B2 + #ffd54f scope - .comment .keyword, .comment .punctuation.definition.keyword + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string .punctuation.definition.string settings foreground - #FF80ABB2 + #ffd54f scope - .comment .statement.modifier .keyword, .comment .statement.modifier .keyword.operator, .comment .statement.modifier .keyword.operator.other, .comment .storage.modifier .keyword, .comment .storage.modifier .keyword.operator, .comment .storage.modifier .keyword.operator.other, .comment .storage.type .keyword, .comment .storage.type .keyword.operator, .comment .storage.type .keyword.operator.other + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .punctuation.section.dictionary settings foreground - #B39DDBB2 + #ffd54f scope - .comment .entity.name.namespace + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string settings foreground - #BCAAA4B2 + #ffd54f scope - .comment .punctuation.definition.namespace + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string .punctuation.definition.string settings foreground - #BCAAA466 + #ffd54f scope - .comment .constant.numeric + .keyword settings foreground - #FFCC80B2 + #ff7997 scope - .comment .constant.numeric.float + .keyword.control.conditional settings + fontStyle + italic foreground - #CE93D8B2 + #1de9b6 scope - .comment .constant.numeric.binary - settings - - foreground - #4DD0E1B2 - - - - scope - .comment .constant.numeric.octal - settings - - foreground - #DCE775B2 - - - - scope - .comment .constant.numeric.hex - settings - - foreground - #E0E0E0B2 - - - - scope - .comment .keyword.operator - settings - - foreground - #5AF158B2 - - - - scope - .comment .keyword.operator.other.word - settings - - foreground - #FF80ABB2 - - - - scope - .comment .punctuation.definition.expression.group.a - settings - - foreground - #FFECB3B2 - - - - scope - .comment .punctuation.definition.expression.group.b - settings - - foreground - #BCAAA4B2 - - - - scope - .comment .punctuation.definition.control - settings - - foreground - #FF80ABB2 - - - - scope - .comment .string - settings - - foreground - #F36C60B2 - - - - scope - .comment .string .punctuation.definition - settings - - foreground - #F36C60B2 - - - - scope - .comment .constant.character - settings - - foreground - #F36C60B2 - - - - scope - .comment .constant.character.escape.a - settings - - foreground - #80DEEAB2 - - - - scope - .comment .constant.character.escape.b - settings - - foreground - #AED581B2 - - - - scope - .comment .entity.name.struct, .comment .punctuation.definition.struct - settings - - foreground - #AED581B2 - - - - scope - .comment .support .entity.name.struct - settings - - foreground - #FF9E80B2 - - - - scope - .comment .entity.name.type, .comment .punctuation.definition.type - settings - - foreground - #AED581B2 - - - - scope - .comment .support .entity.name.type, .comment .support .punctuation.definition.type - settings - - foreground - #FF9E80B2 - - - - scope - .comment .entity.name.variable, .comment .punctuation.definition.variable - settings - - foreground - #BDBDBDB2 - - - - scope - .comment .support .entity.name.variable, .comment .support .punctuation.definition.variable - settings - - foreground - #FF9E80B2 - - - - scope - .entity.name.attribute - settings - - foreground - #9ccc65 - - - - scope - .section.cdata - settings - - foreground - #ff80ab - - - - scope - .section.cdata .entity.name - settings - - foreground - #ff80ab - - - - scope - .section.cdata .punctuation.definition - settings - - foreground - #FF80ABB2 - - - - scope - .entity.name.data-attribute - settings - - foreground - #ffffff - - - - scope - .declaration.doctype - settings - - foreground - #ff80ab - - - - scope - .declaration.doctype .entity.name - settings - - foreground - #ff80ab - - - - scope - .declaration.doctype .punctuation.definition.declaration - settings - - foreground - #FF80ABB2 - - - - scope - .text.html .keyword.operator - settings - - foreground - #CE93D8B2 - - - - scope - .instruction.prolog - settings - - foreground - #ff80ab - - - - scope - .instruction.prolog .entity.name - settings - - foreground - #ff80ab - - - - scope - .instruction.prolog .punctuation.definition.instruction - settings - - foreground - #FF80ABB2 - - - - scope - .source.jsx, .text.html, .text.md, .text.xml - settings - - foreground - #BDBDBD66 - - - - scope - .punctuation.definition.code-block - settings - - foreground - #ff80ab - - - - scope - .level-1 .entity.name.header, .level-1 .punctuation.definition.header - settings - - foreground - #ce93d8 - - - - scope - .level-2 .entity.name.header, .level-2 .punctuation.definition.header - settings - - foreground - #4dd0e1 - - - - scope - .level-3 .entity.name.header, .level-3 .punctuation.definition.header - settings - - foreground - #9ccc65 - - - - scope - .level-4 .entity.name.header, .level-4 .punctuation.definition.header - settings - - foreground - #4db6ac - - - - scope - .level-5 .entity.name.header, .level-5 .punctuation.definition.header - settings - - foreground - #ffab91 - - - - scope - .level-6 .entity.name.header, .level-6 .punctuation.definition.header - settings - - foreground - #ffe082 - - - - scope - .support .entity.name.property.mql - settings - - foreground - #ff9e80 - - - - scope - .entity.name.selector - settings - - foreground - #ff80ab - - - - scope - .punctuation.definition.selector - settings - - foreground - #FF80AB80 - - - - scope - .extension .entity.name.selector - settings - - foreground - #e0e0e0 - - - - scope - .extension .punctuation.definition.selector - settings - - foreground - #E0E0E0B2 - - - - scope - .entity.name.selector.class - settings - - foreground - #4dd0e1 - - - - scope - .punctuation.definition.selector.class - settings - - foreground - #4DD0E1B2 - - - - scope - .entity.name.selector.id - settings - - foreground - #ec407a - - - - scope - .punctuation.definition.selector.id - settings - - foreground - #EC407AB2 - - - - scope - .entity.name.selector.placeholder - settings - - foreground - #ffcc80 - - - - scope - .punctuation.definition.selector.placeholder - settings - - foreground - #FFCC8080 - - - - scope - .entity.name.selector.tag - settings - - foreground - #bcaaa4 - - - - scope - .source.css .support .entity.name.attribute, .source.scss .support .entity.name.attribute - settings - - foreground - #aed581 - - - - scope - .source.css .extension .entity.name.attribute, .source.scss .extension .entity.name.attribute - settings - - foreground - #e0e0e0 - - - - scope - .entity.name.mixin, .punctuation.definition.mixin - settings - - foreground - #4fc3f7 - - - - scope - .source.scss .keyword.operator.other.comma, .source.scss .keyword.operator.other.association, .source.scss .keyword.other.terminator - settings - - foreground - #ffffff - - - - scope - .source.scss .punctuation.definition.body - settings - - foreground - #ffffff - - - - scope - source.scss .keyword.modifier.unit - settings - - foreground - #ff9e80 - - - - scope - .source.scss .declaration .entity.name.variable - settings - - foreground - #bcaaa4 - - - - scope - .meta.annotation .variable.annotation, .meta.annotation .punctuation.section.group, .meta.annotation .punctuation.separator.comma, .meta.annotation .punctuation.definition.annotation - settings - - fontStyle - italic - foreground - #b39ddb - - - - scope - .meta.class .punctuation.section.block - settings - - foreground - #aed581 - - - - scope - .entity.name.class - settings - - background - #AED58106 - foreground - #aed581 - - - - scope - .entity.other.inherited-class - settings - - background - #EA80FC06 - foreground - #ea80fc - - - - scope - .variable.other.constant, .entity.name.constant, .punctuation.definition.constant - settings - - foreground - #ce93d8 - - - - scope - .support.constant - settings - - foreground - #ff9e80 - - - - scope - .comment, .comment .punctuation.definition + .keyword.control.flow settings + fontStyle + italic foreground - #90a4ae + #72d572 scope - .comment .entity.email, .comment .entity.link + .keyword.control.flow.break.throw settings foreground - #cfd8dc + #ea80fc scope - .entity.name.function + .keyword.control.flow.return settings - background - #4FC3F706 foreground - #4fc3f7 + #ea80fc scope - .variable.function + .keyword.control.import-export settings + fontStyle + foreground - #4fc3f7 + #72d572 scope - .meta.function .punctuation.section.block, .meta.function .punctuation.section.group, .meta.function .punctuation.separator.comma + .keyword.control.import-export.default settings foreground - #4fc3f7 + #b39ddb scope - .support.function + .keyword.control.loop settings + fontStyle + italic foreground #ff8a65 scope - .source.json .punctuation.section.dictionary - settings - - foreground - #ce93d8 - - - - scope - .source.json .meta.structure.dictionary .meta.structure.dictionary.key .string - settings - - background - #4DD0E10D - foreground - #4dd0e1 - - - - scope - .source.json .meta.structure.dictionary .meta.structure.dictionary.key .string .punctuation.definition.string - settings - - foreground - #4dd0e1 - - - - scope - .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .punctuation.section.dictionary - settings - - foreground - #4dd0e1 - - - - scope - .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string - settings - - background - #AED5810D - foreground - #aed581 - - - - scope - .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string .punctuation.definition.string - settings - - foreground - #aed581 - - - - scope - .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .punctuation.section.dictionary + .keyword.control.trycatch settings + fontStyle + italic foreground - #aed581 + #ff5177 scope - .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string + .keyword.operator settings - background - #FF8A650D + fontStyle + bold foreground - #ff8a65 + #5af158 scope - .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string .punctuation.definition.string + .keyword.operator.pipe settings foreground - #ff8a65 + #4fc3f7 scope - .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .punctuation.section.dictionary + .keyword.operator.word settings + fontStyle + italic foreground - #ff8a65 + #ff7997 scope - .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string + .keyword.operator.word.of settings - background - #4DB6AC1A foreground - #4db6ac + #72d572 scope - .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string .punctuation.definition.string + .variable.other.label, .entity.name.label settings + fontStyle + italic bold foreground - #4db6ac + #e0e0e0 scope - .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .punctuation.section.dictionary + .meta.tag settings foreground - #4db6ac + #bcaaa4 scope - .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string + .entity.other.attribute-name settings - background - #F062921A + fontStyle + italic foreground - #f06292 + #72d572 scope - .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string .punctuation.definition.string + .storage.modifier, .storage.type settings + fontStyle + foreground - #f06292 + #b39ddb scope - .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .punctuation.section.dictionary + .storage.type.numeric settings foreground - #f06292 + #ffa726 scope - .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string + .constant.numeric settings - background - #BA68C81A foreground - #ba68c8 + #ffa726 scope - .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string .punctuation.definition.string + .constant.numeric.float settings foreground - #ba68c8 + #ce93d8 scope - .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .punctuation.section.dictionary + .constant.numeric.float .punctuation.defintion settings foreground @@ -2198,110 +1584,114 @@ scope - .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string + .constant.numeric.binary settings - background - #FFD54F0D foreground - #ffd54f + #4dd0e1 scope - .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string .punctuation.definition.string + .constant.numeric.binary .punctuation.definition settings foreground - #ffd54f + #4dd0e1 scope - .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .punctuation.section.dictionary + .constant.numeric.octal settings foreground - #ffd54f + #dce775 scope - .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string + .constant.numeric.octal .punctuation.definition settings - background - #FFD54F0D foreground - #ffd54f + #dce775 scope - .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string .punctuation.definition.string + .constant.numeric.hex settings foreground - #ffd54f + #e0e0e0 scope - .storage.type.numeric + .constant.numeric.hex .punctuation.definition settings foreground - #ffa726 + #e0e0e0 scope - .constant.numeric + .meta.object-literal.key settings + fontStyle + italic foreground - #ffcc80 + #bcaaa4 scope - .constant.numeric.float + .punctuation.accessor, .punctuation.separator.comma, .punctuation.terminator settings + fontStyle + bold foreground - #ce93d8 + #5af158 scope - .constant.numeric.float .punctuation.defintion + .punctuation.separator.key-value settings foreground - #ba68c8 + #ff8a65 scope - .constant.numeric.binary + .punctuation.definition.tag settings + fontStyle + foreground - #4dd0e1 + #a1887f scope - .constant.numeric.binary .punctuation.definition + .punctuation.definition.template-expression settings + fontStyle + bold foreground - #4dd0e1 + #ff8a65 scope - .constant.numeric.octal + .string settings foreground @@ -2310,7 +1700,7 @@ scope - .constant.numeric.octal .punctuation.definition + .string .punctuation.definition.string settings foreground @@ -2319,107 +1709,91 @@ scope - .constant.numeric.hex - settings - - foreground - #e0e0e0 - - - - scope - .constant.numeric.hex .punctuation.definition + .variable.type, .variable.other.type settings foreground - #e0e0e0 + #aed581 scope - .punctuation.accessor, .punctuation.terminator + .support.type settings foreground - #5af158 + #b388ff scope - .meta.generic .punctuation.separator.comma, .meta.generic .punctuation.definition.generic + .support.type.object settings - foreground - #a1887f + fontStyle + italic scope - .meta.group .punctuation.separator.comma + .support.type.object.console settings foreground - #5af158 + #72d572 scope - .meta.group .punctuation.section.group + .variable.other.readwrite, .entity.name.variable, .punctuation.definition.variable settings + fontStyle + foreground - #ffecb3 + #e0e0e0 scope - .string + .variable.other.object settings - background - #FFD54F09 + fontStyle + italic foreground - #ffd54f + #bcaaa4 scope - .string .punctuation.definition.string + .variable.language.prototype, .variable.language.this settings + fontStyle + italic foreground - #ffd54f + #f36c60 scope - .variable.other.type + .variable.language.super settings foreground - #aed581 + #ff8a65 scope - .support.type + .variable.language.this settings fontStyle italic foreground - #ff9e80 - - - - scope - .variable.other.readwrite, .entity.name.variable, .punctuation.definition.variable - settings - - fontStyle - - foreground - #bdbdbd + #ea80fc @@ -2431,15 +1805,6 @@ #ff9e80 - - scope - .variable.parameter.function - settings - - foreground - #ffcc80 - - From 6a894d5b7efec08b877fc652c036be1d288475c3 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Thu, 4 Jan 2018 00:25:32 -0200 Subject: [PATCH 376/407] [FJSX15] Normalize destructuring scopes --- .../fjsx15/destructuring/array.sublime-syntax | 13 +++---- .../destructuring/object.sublime-syntax | 15 ++++---- .../object/property.sublime-syntax | 36 +++++++++---------- 3 files changed, 27 insertions(+), 37 deletions(-) diff --git a/syntaxes/fjsx15/destructuring/array.sublime-syntax b/syntaxes/fjsx15/destructuring/array.sublime-syntax index cca75551..7750584b 100644 --- a/syntaxes/fjsx15/destructuring/array.sublime-syntax +++ b/syntaxes/fjsx15/destructuring/array.sublime-syntax @@ -21,9 +21,7 @@ contexts: main: - match: \s*(\[) captures: - 1: >- - destructuring.array.js.fjsx15 - punctuation.definition.array.begin.js.fjsx15 + 1: punctuation.section.brackets.begin.js.fjsx15 set: [ delimiters, optional-expression, @@ -32,11 +30,10 @@ contexts: ] delimiters: + - meta_scope: meta.destructuring.array.js.fjsx15 - match: \s*(,) captures: - 1: >- - destructuring.array.js.fjsx15 - punctuation.definition.array.js.fjsx15 + 1: punctuation.separator.comma.js.fjsx15 push: [ optional-expression, optional-type, @@ -44,9 +41,7 @@ contexts: ] - match: \s*(]) captures: - 1: >- - destructuring.array.js.fjsx15 - punctuation.definition.array.end.js.fjsx15 + 1: punctuation.section.brackets.end.js.fjsx15 pop: true optional-expression: diff --git a/syntaxes/fjsx15/destructuring/object.sublime-syntax b/syntaxes/fjsx15/destructuring/object.sublime-syntax index fd330750..780c2715 100644 --- a/syntaxes/fjsx15/destructuring/object.sublime-syntax +++ b/syntaxes/fjsx15/destructuring/object.sublime-syntax @@ -26,23 +26,20 @@ contexts: main: - match: \s*(\{) captures: - 1: >- - destructuring.object.js.fjsx15 - punctuation.definition.object.begin.js.fjsx15 + 1: punctuation.section.block.begin.js.fjsx15 set: [ delimiters, optional-variable ] delimiters: + - meta_scope: >- + meta.destructuring.object.js.fjsx15 + meta.block.js.fjsx15 - match: \s*(,) captures: - 1: >- - destructuring.object.js.fjsx15 - punctuation.definition.object.js.fjsx15 + 1: punctuation.definition.object.js.fjsx15 push: optional-variable - match: \s*(}) captures: - 1: >- - destructuring.object.js.fjsx15 - punctuation.definition.object.end.js.fjsx15 + 1: punctuation.section.block.end.js.fjsx15 pop: true # Default value. - match: (?=\s*=) diff --git a/syntaxes/fjsx15/destructuring/object/property.sublime-syntax b/syntaxes/fjsx15/destructuring/object/property.sublime-syntax index 8e639912..b75999a8 100644 --- a/syntaxes/fjsx15/destructuring/object/property.sublime-syntax +++ b/syntaxes/fjsx15/destructuring/object/property.sublime-syntax @@ -28,16 +28,16 @@ contexts: - match: (?=\s*(?>'|"|`)) set: [ optional-alias, + meta-key, string ] # Computed property name. - match: \s*(\[) captures: - 1: >- - destructuring.object.js.fjsx15 - punctuation.definition.object.computed-property.begin.js.fjsx15 + 1: punctuation.section.brackets.begin.js.fjsx15 set: [ optional-alias, + meta-key, computed-property-end, optional-expression ] @@ -46,12 +46,15 @@ contexts: (?xi) \s*({{commonIdentifier}}) (?=\s*:) - captures: - 1: >- - destructuring.object.js.fjsx15 - object.property.js.fjsx15 - entity.name.variable.js.fjsx15 - set: optional-alias + set: [ + optional-alias, + meta-key + ] + + meta-key: + - meta_scope: meta.object-literal.key.js.fjsx15 + - match: "" + pop: true string: - include: Packages/Naomi/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax @@ -61,21 +64,18 @@ contexts: optional-alias: - match: \s*(:) captures: - 1: >- - destructuring.object.js.fjsx15 - keyword.operator.other.association.js.fjsx15 - set: optional-parameter + 1: punctuation.separator.key-value.js.fjsx15 + set: alias - match: (?=\s*\S) pop: true - optional-parameter: + alias: - include: comment-no-pop - match: (?=\s*\)) pop: true - include: Packages/Naomi/syntaxes/fjsx15/destructuring/array.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/destructuring/object.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/constant.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/variable.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/variable-declaration.sublime-syntax#variable-or-constant comment-no-pop: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax @@ -86,7 +86,5 @@ contexts: computed-property-end: - match: \s*(]) captures: - 1: >- - destructuring.object.js.fjsx15 - punctuation.definition.object.computed-property.end.js.fjsx15 + 1: punctuation.section.brackets.end.js.fjsx15 pop: true From f86419929fb0b5c3350435af4a0e08cd67ba2897 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Thu, 4 Jan 2018 00:25:44 -0200 Subject: [PATCH 377/407] [FJSX15] Fix object literal scopes --- syntaxes/fjsx15/literal/object/property.sublime-syntax | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/syntaxes/fjsx15/literal/object/property.sublime-syntax b/syntaxes/fjsx15/literal/object/property.sublime-syntax index f5bd55db..a2456bd8 100644 --- a/syntaxes/fjsx15/literal/object/property.sublime-syntax +++ b/syntaxes/fjsx15/literal/object/property.sublime-syntax @@ -157,7 +157,7 @@ contexts: # Computed property name. - match: \s*(\[) captures: - 1: punctuation.definition.object.computed-property.begin.js.fjsx15 + 1: punctuation.section.brackets.begin.js.fjsx15 set: [ associated-value, computed-key-meta-scope, @@ -211,7 +211,7 @@ contexts: computed-property-end: - match: \s*(\]) captures: - 1: punctuation.definition.object.computed-property.end.js.fjsx15 + 1: punctuation.section.brackets.end.js.fjsx15 pop: true string: From 473eff6d5496749cc5bde2e2bc02592e70c9e7fc Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Thu, 4 Jan 2018 00:33:04 -0200 Subject: [PATCH 378/407] Rebalance return, throw and object keys --- Candyman.tmTheme | 8 +++++++- schemes/candyman/_keyword.scss | 2 ++ schemes/candyman/_number.scss | 1 + schemes/candyman/_object.scss | 2 +- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Candyman.tmTheme b/Candyman.tmTheme index 2a122361..90f583e2 100644 --- a/Candyman.tmTheme +++ b/Candyman.tmTheme @@ -1409,6 +1409,8 @@ .keyword.control.flow.break.throw settings + fontStyle + bold italic foreground #ea80fc @@ -1418,6 +1420,8 @@ .keyword.control.flow.return settings + fontStyle + bold italic foreground #ea80fc @@ -1560,6 +1564,8 @@ .constant.numeric settings + fontStyle + foreground #ffa726 @@ -1642,7 +1648,7 @@ settings fontStyle - italic + bold foreground #bcaaa4 diff --git a/schemes/candyman/_keyword.scss b/schemes/candyman/_keyword.scss index b1541e59..0ca63fa4 100644 --- a/schemes/candyman/_keyword.scss +++ b/schemes/candyman/_keyword.scss @@ -25,10 +25,12 @@ &.break.throw { foreground: $purple-a100; + fontStyle: bold italic; } &.return { foreground: $purple-a100; + fontStyle: bold italic; } } diff --git a/schemes/candyman/_number.scss b/schemes/candyman/_number.scss index c55ef5ac..b2cda97c 100644 --- a/schemes/candyman/_number.scss +++ b/schemes/candyman/_number.scss @@ -16,6 +16,7 @@ .constant.numeric { foreground: $orange-400; + fontStyle: none; &.float { foreground: $purple-200; diff --git a/schemes/candyman/_object.scss b/schemes/candyman/_object.scss index 075a5754..624140b8 100644 --- a/schemes/candyman/_object.scss +++ b/schemes/candyman/_object.scss @@ -12,5 +12,5 @@ .meta.object-literal.key { foreground: $brown-200; - fontStyle: italic; + fontStyle: bold; } From f02ff93cb4329edb7b2e09b58f49ba6df564e7d9 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Thu, 4 Jan 2018 00:33:16 -0200 Subject: [PATCH 379/407] [FJSX15] Remove dead code --- .../arrow-function/parameters.sublime-syntax | 61 ------------------- 1 file changed, 61 deletions(-) delete mode 100644 syntaxes/fjsx15/arrow-function/parameters.sublime-syntax diff --git a/syntaxes/fjsx15/arrow-function/parameters.sublime-syntax b/syntaxes/fjsx15/arrow-function/parameters.sublime-syntax deleted file mode 100644 index 92cea892..00000000 --- a/syntaxes/fjsx15/arrow-function/parameters.sublime-syntax +++ /dev/null @@ -1,61 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - -contexts: - main: - - match: \s*(\() - captures: - 1: >- - arrow.js.fjsx15 - punctuation.definition.function.parameters.begin.js.fjsx15 - set: [ delimiters, optional-parameter ] - - delimiters: - - match: \s*(\,) - captures: - 1: >- - arrow.js.fjsx15 - punctuation.definition.function.parameters.js.fjsx15 - push: optional-parameter - - match: \s*(\)) - captures: - 1: >- - arrow.js.fjsx15 - punctuation.definition.function.parameters.end.js.fjsx15 - set: optional-return-type - - optional-parameter: - - include: comment-no-pop - - match: (?=\s*[,)]) - pop: true - - include: Packages/Naomi/syntaxes/fjsx15/operator/rest.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/destructuring/array.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/simple.sublime-syntax - - comment-no-pop: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - - optional-return-type: - - include: Packages/Naomi/syntaxes/flow1/optional-associated-type.sublime-syntax From 67b8391a5724de8ec0feb210e6808f2b4d4cff93 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Thu, 4 Jan 2018 00:44:55 -0200 Subject: [PATCH 380/407] [FJSX15] Add specific scope to destructuring key --- syntaxes/fjsx15/destructuring/object/property.sublime-syntax | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/destructuring/object/property.sublime-syntax b/syntaxes/fjsx15/destructuring/object/property.sublime-syntax index b75999a8..bb2130a0 100644 --- a/syntaxes/fjsx15/destructuring/object/property.sublime-syntax +++ b/syntaxes/fjsx15/destructuring/object/property.sublime-syntax @@ -52,7 +52,7 @@ contexts: ] meta-key: - - meta_scope: meta.object-literal.key.js.fjsx15 + - meta_scope: meta.destructuring.object.key.js.fjsx15 - match: "" pop: true From 318751df889b916f027ca5dee74edfca7bee7bd9 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Thu, 4 Jan 2018 00:45:08 -0200 Subject: [PATCH 381/407] Rebalance theme weights and colors --- Candyman.scsscheme | 1 + Candyman.tmTheme | 15 +++++++++++---- schemes/candyman/_destructuring.scss | 15 +++++++++++++++ schemes/candyman/_label.scss | 2 +- schemes/candyman/_object.scss | 1 - schemes/candyman/_punctuation.scss | 2 +- 6 files changed, 29 insertions(+), 7 deletions(-) create mode 100644 schemes/candyman/_destructuring.scss diff --git a/Candyman.scsscheme b/Candyman.scsscheme index 3fda8b25..588aa2eb 100644 --- a/Candyman.scsscheme +++ b/Candyman.scsscheme @@ -25,6 +25,7 @@ @import 'schemes/candyman/class/body'; @import 'schemes/candyman/comment'; @import 'schemes/candyman/constant'; +@import 'schemes/candyman/destructuring'; @import 'schemes/candyman/function'; @import 'schemes/candyman/function-call'; @import 'schemes/candyman/function/body'; diff --git a/Candyman.tmTheme b/Candyman.tmTheme index 90f583e2..b501e36a 100644 --- a/Candyman.tmTheme +++ b/Candyman.tmTheme @@ -1019,6 +1019,15 @@ #72d572 + + scope + .meta.destructuring.object.key + settings + + foreground + #ff9e80 + + scope .entity.name.function @@ -1514,7 +1523,7 @@ settings fontStyle - italic bold + bold foreground #e0e0e0 @@ -1647,15 +1656,13 @@ .meta.object-literal.key settings - fontStyle - bold foreground #bcaaa4 scope - .punctuation.accessor, .punctuation.separator.comma, .punctuation.terminator + .punctuation.accessor, .punctuation.separator, .punctuation.terminator settings fontStyle diff --git a/schemes/candyman/_destructuring.scss b/schemes/candyman/_destructuring.scss new file mode 100644 index 00000000..b67db353 --- /dev/null +++ b/schemes/candyman/_destructuring.scss @@ -0,0 +1,15 @@ +// Licensed under the Apache License, Version 2.0 (the “License”); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +.meta.destructuring.object.key { + foreground: $deep-orange-a100; +} diff --git a/schemes/candyman/_label.scss b/schemes/candyman/_label.scss index d6214947..80e4f0fc 100644 --- a/schemes/candyman/_label.scss +++ b/schemes/candyman/_label.scss @@ -13,5 +13,5 @@ .variable.other.label, .entity.name.label { foreground: $gray-300; - fontStyle: italic bold; + fontStyle: bold; } diff --git a/schemes/candyman/_object.scss b/schemes/candyman/_object.scss index 624140b8..ee301b68 100644 --- a/schemes/candyman/_object.scss +++ b/schemes/candyman/_object.scss @@ -12,5 +12,4 @@ .meta.object-literal.key { foreground: $brown-200; - fontStyle: bold; } diff --git a/schemes/candyman/_punctuation.scss b/schemes/candyman/_punctuation.scss index 7c4147f6..fa49d5a5 100644 --- a/schemes/candyman/_punctuation.scss +++ b/schemes/candyman/_punctuation.scss @@ -12,7 +12,7 @@ .punctuation { &.accessor, - &.separator.comma, + &.separator, &.terminator { foreground: $green-a200; fontStyle: bold; From 39450aa186bf17df3d3995684f28c5122e9b40d0 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Thu, 4 Jan 2018 09:41:11 -0200 Subject: [PATCH 382/407] [FJSX15] Fix variable declaration scopes in destructuring --- syntaxes/fjsx15/destructuring/array.sublime-syntax | 3 +-- syntaxes/fjsx15/destructuring/object.sublime-syntax | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/syntaxes/fjsx15/destructuring/array.sublime-syntax b/syntaxes/fjsx15/destructuring/array.sublime-syntax index 7750584b..b3073447 100644 --- a/syntaxes/fjsx15/destructuring/array.sublime-syntax +++ b/syntaxes/fjsx15/destructuring/array.sublime-syntax @@ -56,5 +56,4 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/operator/rest.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/destructuring/array.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/destructuring/object.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/constant.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/variable.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/variable-declaration.sublime-syntax#variable-or-constant diff --git a/syntaxes/fjsx15/destructuring/object.sublime-syntax b/syntaxes/fjsx15/destructuring/object.sublime-syntax index 780c2715..8a7cca43 100644 --- a/syntaxes/fjsx15/destructuring/object.sublime-syntax +++ b/syntaxes/fjsx15/destructuring/object.sublime-syntax @@ -53,8 +53,7 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/destructuring/object/property.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/destructuring/array.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/destructuring/object.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/constant.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/variable.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/variable-declaration.sublime-syntax#variable-or-constant default-value: - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax From 60f05fb6d0cb4709bf5262d1d644b26f52887891 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Thu, 4 Jan 2018 09:41:43 -0200 Subject: [PATCH 383/407] [FJSX15] Fix destructuring comma scope --- syntaxes/fjsx15/destructuring/object.sublime-syntax | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/destructuring/object.sublime-syntax b/syntaxes/fjsx15/destructuring/object.sublime-syntax index 8a7cca43..93b753d6 100644 --- a/syntaxes/fjsx15/destructuring/object.sublime-syntax +++ b/syntaxes/fjsx15/destructuring/object.sublime-syntax @@ -35,7 +35,7 @@ contexts: meta.block.js.fjsx15 - match: \s*(,) captures: - 1: punctuation.definition.object.js.fjsx15 + 1: punctuation.separator.comma.js.fjsx15 push: optional-variable - match: \s*(}) captures: From c5688498ece0d45ad1128c9ba398ebe07bc91046 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Thu, 4 Jan 2018 10:01:12 -0200 Subject: [PATCH 384/407] [FJSX15] Normalize import scopes --- syntaxes/fjsx15/import.sublime-syntax | 45 ++++++++++++++------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/syntaxes/fjsx15/import.sublime-syntax b/syntaxes/fjsx15/import.sublime-syntax index 9adc11fa..2fa9e79e 100644 --- a/syntaxes/fjsx15/import.sublime-syntax +++ b/syntaxes/fjsx15/import.sublime-syntax @@ -38,8 +38,11 @@ contexts: (import)\b (?=\s*\() captures: - 1: keyword.control.import-export.js.fjsx15 - set: header + 1: support.function.js.fjsx15 + set: [ + function-call-meta-scope, + arguments + ] # Import the entire module. - match: | (?x)\s* @@ -57,15 +60,17 @@ contexts: 1: keyword.control.import-export.js.fjsx15 set: targets - header: - - include: Packages/Naomi/syntaxes/fjsx15/statement.sublime-syntax#expression-only-header + function-call-meta-scope: + - meta_scope: meta.function-call.js.fjsx15 + - match: "" + pop: true + + arguments: + - include: Packages/Naomi/syntaxes/fjsx15/function-call/arguments.sublime-syntax comment-no-pop: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - function-arguments: - - include: Packages/Naomi/syntaxes/fjsx15/function-call/arguments.sublime-syntax - origin: - match: \s*(from)\b captures: @@ -80,13 +85,13 @@ contexts: punctuation: - match: \s*(\{) captures: - 1: punctuation.definition.import.list.begin.js.fjsx15 + 1: punctuation.section.block.begin.js.fjsx15 - match: \s*(}) captures: - 1: punctuation.definition.import.list.end.js.fjsx15 + 1: punctuation.section.block.end.js.fjsx15 - match: \s*(,) captures: - 1: punctuation.definition.import.item.js.fjsx15 + 1: punctuation.separator.comma.js.fjsx15 targets: - include: comment-no-pop @@ -103,9 +108,7 @@ contexts: # Type. - match: \s*(type)\b captures: - 1: >- - storage.type.flow - keyword.declaration.type-aliasing.flow + 1: storage.type.flow set: types # Default. - match: \s*(default)\b @@ -117,32 +120,30 @@ contexts: # All. - match: \s*(\*) captures: - 1: keyword.operator.other.import.all.js.fjsx15 + 1: keyword.control.import-export.star.js.fjsx15 set: optional-alias # Simple. - match: | (?xi)\s* ({{commonIdentifier}}) captures: - 1: >- - import.js.fjsx15 - variable.other.readwrite.js.fjsx15 + 1: entity.name.readwrite.js.fjsx15 set: optional-alias types: - include: aliased-type - match: \s*(}) captures: - 1: punctuation.definition.import.list.end.js.fjsx15 + 1: punctuation.section.block.end.js.fjsx15 pop: true - match: \s*(\{) captures: - 1: punctuation.definition.import.list.begin.js.fjsx15 + 1: punctuation.section.block.begin.js.fjsx15 push: - include: aliased-type - match: \s*(,) captures: - 1: punctuation.definition.import.item.js.fjsx15 + 1: punctuation.separator.comma.js.fjsx15 - match: (?=\s*}) pop: true @@ -168,7 +169,7 @@ contexts: alias: - match: \s*(as)\b captures: - 1: keyword.other.alias.js.fjsx15 + 1: keyword.control.import-export.as.js.fjsx15 set: alias-name alias-name: @@ -176,5 +177,5 @@ contexts: (?xi)\s* ({{commonIdentifier}}) captures: - 1: entity.name.alias.js.fjsx15 + 1: entity.name.variable.js.fjsx15 pop: true From 94b10766dab04a88865e0f26889009c87610024a Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Thu, 4 Jan 2018 10:01:33 -0200 Subject: [PATCH 385/407] Rebalance candyman colors --- Candyman.tmTheme | 28 ++++++++++++++++++++++++---- schemes/candyman/_constant.scss | 4 ++-- schemes/candyman/_keyword.scss | 4 +++- schemes/candyman/_type.scss | 16 +++++++++++----- schemes/candyman/_variable.scss | 6 +++++- 5 files changed, 45 insertions(+), 13 deletions(-) diff --git a/Candyman.tmTheme b/Candyman.tmTheme index b501e36a..11af59d0 100644 --- a/Candyman.tmTheme +++ b/Candyman.tmTheme @@ -967,7 +967,7 @@ scope - entity.name.constant + .entity.name.constant settings foreground @@ -980,7 +980,7 @@ settings foreground - #bcaaa4 + #e0e0e0 @@ -1448,7 +1448,7 @@ scope - .keyword.control.import-export.default + .keyword.control.import-export.as, .keyword.control.import-export.default, .keyword.control.import-export.star settings foreground @@ -1738,6 +1738,15 @@ #b388ff + + scope + .support.type.existential.flow, .support.type.flow + settings + + foreground + #ffab91 + + scope .support.type.object @@ -1758,7 +1767,7 @@ scope - .variable.other.readwrite, .entity.name.variable, .punctuation.definition.variable + .variable.other.readwrite, .punctuation.definition.variable settings fontStyle @@ -1767,6 +1776,17 @@ #e0e0e0 + + scope + .entity.name.variable + settings + + fontStyle + italic + foreground + #e0e0e0 + + scope .variable.other.object diff --git a/schemes/candyman/_constant.scss b/schemes/candyman/_constant.scss index 85d5016f..8356142b 100644 --- a/schemes/candyman/_constant.scss +++ b/schemes/candyman/_constant.scss @@ -10,13 +10,13 @@ // License for the specific language governing permissions and limitations under // the License. -entity.name.constant { +.entity.name.constant { foreground: $purple-200; } .variable.other.constant, .punctuation.definition.constant { - foreground: $brown-200; + foreground: $gray-300; } .support.constant { diff --git a/schemes/candyman/_keyword.scss b/schemes/candyman/_keyword.scss index 0ca63fa4..e5d806bd 100644 --- a/schemes/candyman/_keyword.scss +++ b/schemes/candyman/_keyword.scss @@ -38,7 +38,9 @@ foreground: $green-200; fontStyle: none; - &.default { + &.as, + &.default, + &.star { foreground: $deep-purple-200; } } diff --git a/schemes/candyman/_type.scss b/schemes/candyman/_type.scss index 7508ab4f..ddb0b9b2 100644 --- a/schemes/candyman/_type.scss +++ b/schemes/candyman/_type.scss @@ -17,15 +17,21 @@ .support.type { foreground: $deep-purple-a100; -} -.support.type.object { - fontStyle: italic; - &.console { - foreground: $green-200; + &.existential.flow, + &.flow { + foreground: $deep-orange-200; + } + + &.object { + fontStyle: italic; + &.console { + foreground: $green-200; + } } } + // foreground: $light-green-300; // .meta.group { diff --git a/schemes/candyman/_variable.scss b/schemes/candyman/_variable.scss index 0594b247..ba0958d1 100644 --- a/schemes/candyman/_variable.scss +++ b/schemes/candyman/_variable.scss @@ -11,12 +11,16 @@ // the License. .variable.other.readwrite, -.entity.name.variable, .punctuation.definition.variable { foreground: $gray-300; fontStyle: none; } +.entity.name.variable { + foreground: $gray-300; + fontStyle: italic; +} + .variable { &.other.object { foreground: $brown-200; From 920f6bb7b66ca2d3e8da41358b216289311452dd Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Thu, 4 Jan 2018 10:01:54 -0200 Subject: [PATCH 386/407] [FLOW] Normalize scopes --- syntaxes/flow1/associated-type.sublime-syntax | 4 +--- syntaxes/flow1/cast.sublime-syntax | 8 ++------ syntaxes/flow1/declare.sublime-syntax | 4 +--- .../flow1/function/parameters.sublime-syntax | 19 +++++++------------ .../function/parameters/simple.sublime-syntax | 9 ++------- .../operator/array-shorthand.sublime-syntax | 11 ++++------- .../contravariant.no-pop.sublime-syntax | 4 +--- .../operator/covariant.no-pop.sublime-syntax | 4 +--- .../operator/intersection.sublime-syntax | 4 +--- .../flow1/operator/nullable.sublime-syntax | 4 +--- syntaxes/flow1/operator/union.sublime-syntax | 4 +--- .../flow1/template/arguments.sublime-syntax | 13 ++++--------- 12 files changed, 26 insertions(+), 62 deletions(-) diff --git a/syntaxes/flow1/associated-type.sublime-syntax b/syntaxes/flow1/associated-type.sublime-syntax index 748bb404..b6f000a9 100644 --- a/syntaxes/flow1/associated-type.sublime-syntax +++ b/syntaxes/flow1/associated-type.sublime-syntax @@ -21,9 +21,7 @@ contexts: main: - match: \s*(:) captures: - 1: >- - flow - keyword.operator.other.association.flow + 1: keyword.operator.other.flow set: optional-type-expression optional-type-expression: diff --git a/syntaxes/flow1/cast.sublime-syntax b/syntaxes/flow1/cast.sublime-syntax index e53d1e4f..0f5bdf16 100644 --- a/syntaxes/flow1/cast.sublime-syntax +++ b/syntaxes/flow1/cast.sublime-syntax @@ -19,13 +19,9 @@ scope: ... contexts: main: - - match: | - (?x) - \s*(:) + - match: \s*(:) captures: - 1: >- - flow - keyword.operator.other.cast.flow + 1: keyword.operator.other.cast.flow set: optional-type-expression optional-type-expression: diff --git a/syntaxes/flow1/declare.sublime-syntax b/syntaxes/flow1/declare.sublime-syntax index 003cdd59..92595b42 100644 --- a/syntaxes/flow1/declare.sublime-syntax +++ b/syntaxes/flow1/declare.sublime-syntax @@ -21,9 +21,7 @@ contexts: main: - match: \s*(declare)\b captures: - 1: >- - flow - keyword.declaration.js.fjsx15 + 1: keyword.declaration.flow set: possible-module possible-module: diff --git a/syntaxes/flow1/function/parameters.sublime-syntax b/syntaxes/flow1/function/parameters.sublime-syntax index 03fa42f2..52754349 100644 --- a/syntaxes/flow1/function/parameters.sublime-syntax +++ b/syntaxes/flow1/function/parameters.sublime-syntax @@ -21,31 +21,26 @@ contexts: main: - match: \s*(\() captures: - 1: >- - flow - punctuation.definition.function.parameters.begin.flow + 1: punctuation.section.group.begin.flow set: [ delimiters, optional-parameter ] delimiters: - match: \s*(,) captures: - 1: >- - flow - punctuation.definition.function.parameters.flow + 1: punctuation.separator.comma.flow push: optional-parameter - match: \s*(\)) captures: - 1: >- - flow - punctuation.definition.function.parameters.end.flow + 1: punctuation.section.group.end.flow pop: true optional-parameter: + - meta_scope: meta.function.parameters.js.fjsx15 # Rest. - match: \s*(\.{3}) captures: - 1: >- - flow - keyword.operator.other.rest.flow + 1: keyword.operator.other.rest.flow + # Parameter and type. - include: Packages/Naomi/syntaxes/flow1/function/parameters/simple.sublime-syntax + # Just the type. - include: Packages/Naomi/syntaxes/flow1/optional-type-expression.sublime-syntax diff --git a/syntaxes/flow1/function/parameters/simple.sublime-syntax b/syntaxes/flow1/function/parameters/simple.sublime-syntax index 8a521310..efe6147c 100644 --- a/syntaxes/flow1/function/parameters/simple.sublime-syntax +++ b/syntaxes/flow1/function/parameters/simple.sublime-syntax @@ -29,13 +29,8 @@ contexts: ({{commonIdentifier}})(\?)? (?=\s*:) captures: - 1: >- - flow - function.parameter.js.fjsx15 - entity.name.variable.js.fjsx15 - 2: >- - flow - keyword.operator.other.optional.flow + 1: variable.parameter.function.js.fjsx15 + 2: storage.modifier.flow set: optional-associated-type optional-associated-type: diff --git a/syntaxes/flow1/operator/array-shorthand.sublime-syntax b/syntaxes/flow1/operator/array-shorthand.sublime-syntax index a1614986..3fddec8e 100644 --- a/syntaxes/flow1/operator/array-shorthand.sublime-syntax +++ b/syntaxes/flow1/operator/array-shorthand.sublime-syntax @@ -19,12 +19,9 @@ scope: ... contexts: main: - - match: \s*(\[)\s*(]) + - match: \s*((\[)\s*(])) captures: - 1: >- - flow - punctuation.definition.array.begin.flow - 2: >- - flow - punctuation.definition.array.end.flow + 1: meta.sequence.flow + 1: punctuation.section.brackets.begin.flow + 2: punctuation.section.brackets.end.flow pop: true diff --git a/syntaxes/flow1/operator/contravariant.no-pop.sublime-syntax b/syntaxes/flow1/operator/contravariant.no-pop.sublime-syntax index 06042eeb..89e077ac 100644 --- a/syntaxes/flow1/operator/contravariant.no-pop.sublime-syntax +++ b/syntaxes/flow1/operator/contravariant.no-pop.sublime-syntax @@ -21,6 +21,4 @@ contexts: main: - match: \s*(-) captures: - 1: >- - flow - keyword.operator.other.contravariant.flow + 1: storage.modifier.contravariant.flow diff --git a/syntaxes/flow1/operator/covariant.no-pop.sublime-syntax b/syntaxes/flow1/operator/covariant.no-pop.sublime-syntax index 0a5bd1b1..0aa791db 100644 --- a/syntaxes/flow1/operator/covariant.no-pop.sublime-syntax +++ b/syntaxes/flow1/operator/covariant.no-pop.sublime-syntax @@ -21,6 +21,4 @@ contexts: main: - match: \s*(\+) captures: - 1: >- - flow - keyword.operator.other.covariant.flow + 1: storage.modifier.covariant.flow diff --git a/syntaxes/flow1/operator/intersection.sublime-syntax b/syntaxes/flow1/operator/intersection.sublime-syntax index 728dc964..3417a007 100644 --- a/syntaxes/flow1/operator/intersection.sublime-syntax +++ b/syntaxes/flow1/operator/intersection.sublime-syntax @@ -21,9 +21,7 @@ contexts: main: - match: \s*(&) captures: - 1: >- - flow - keyword.operator.other.intersection.flow + 1: keyword.operator.other.intersection.flow set: optional-type-expression optional-type-expression: diff --git a/syntaxes/flow1/operator/nullable.sublime-syntax b/syntaxes/flow1/operator/nullable.sublime-syntax index e4d264e2..75e41965 100644 --- a/syntaxes/flow1/operator/nullable.sublime-syntax +++ b/syntaxes/flow1/operator/nullable.sublime-syntax @@ -21,9 +21,7 @@ contexts: main: - match: \s*(\?) captures: - 1: >- - flow - keyword.operator.other.nullable.flow + 1: storage.modifier.nullable.flow set: optional-type-expression optional-type-expression: diff --git a/syntaxes/flow1/operator/union.sublime-syntax b/syntaxes/flow1/operator/union.sublime-syntax index cfc02054..25470536 100644 --- a/syntaxes/flow1/operator/union.sublime-syntax +++ b/syntaxes/flow1/operator/union.sublime-syntax @@ -21,9 +21,7 @@ contexts: main: - match: \s*(\|) captures: - 1: >- - flow - keyword.operator.other.union.flow + 1: keyword.operator.other.union.flow set: optional-type-expression optional-type-expression: diff --git a/syntaxes/flow1/template/arguments.sublime-syntax b/syntaxes/flow1/template/arguments.sublime-syntax index 384b7b79..6e4ef8aa 100644 --- a/syntaxes/flow1/template/arguments.sublime-syntax +++ b/syntaxes/flow1/template/arguments.sublime-syntax @@ -21,23 +21,18 @@ contexts: main: - match: \s*(<) captures: - 1: >- - flow - punctuation.definition.template.arguments.begin.flow + 1: punctuation.section.generic.begin.flow set: [ delimiters, optional-type-expression ] delimiters: + - meta_scope: meta.generic.flow - match: \s*(,) captures: - 1: >- - flow - punctuation.definition.template.arguments.flow + 1: punctuation.separator.comma.flow push: optional-type-expression - match: \s*(>) captures: - 1: >- - flow - punctuation.definition.template.arguments.end.flow + 1: punctuation.section.generic.end.flow pop: true optional-type-expression: From 3fb45b9184d369e87466de78430edea22f8ff7b0 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Thu, 4 Jan 2018 11:12:36 -0200 Subject: [PATCH 387/407] [FJSX15] Normalize scope chain --- syntaxes/fjsx15/operator/other.sublime-syntax | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/operator/other.sublime-syntax b/syntaxes/fjsx15/operator/other.sublime-syntax index df96541c..c7b55617 100644 --- a/syntaxes/fjsx15/operator/other.sublime-syntax +++ b/syntaxes/fjsx15/operator/other.sublime-syntax @@ -37,7 +37,7 @@ contexts: set: optional-expression - match: \s*(\?\.) captures: - 1: keyword.operator.optional-chain.js.fjsx15 + 1: punctuation.accessor.optional-chain.js.fjsx15 set: optional-expression - match: \s*(\.)(?!\.) captures: From 66515c9b30c49fd191096a3f0007a15fb89e9e05 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Thu, 4 Jan 2018 11:15:02 -0200 Subject: [PATCH 388/407] [FLOW] Normalize scopes --- syntaxes/flow1/function.sublime-syntax | 5 +- syntaxes/flow1/indexer.sublime-syntax | 24 +++---- syntaxes/flow1/interface.sublime-syntax | 24 ++----- syntaxes/flow1/module.sublime-syntax | 13 +--- .../namespace-path.no-pop.sublime-syntax | 64 ++----------------- syntaxes/flow1/object.sublime-syntax | 32 +++------- .../flow1/optional-modifier.sublime-syntax | 4 +- syntaxes/flow1/prolog.sublime-syntax | 4 +- syntaxes/flow1/tuple.sublime-syntax | 12 +--- syntaxes/flow1/type-aliasing.sublime-syntax | 10 +-- syntaxes/flow1/type-expression.sublime-syntax | 12 +--- 11 files changed, 48 insertions(+), 156 deletions(-) diff --git a/syntaxes/flow1/function.sublime-syntax b/syntaxes/flow1/function.sublime-syntax index b63ef400..169144e2 100644 --- a/syntaxes/flow1/function.sublime-syntax +++ b/syntaxes/flow1/function.sublime-syntax @@ -74,11 +74,8 @@ contexts: return: - match: \s*(=>) captures: - 1: >- - flow - punctuation.definition.function.result.flow + 1: storage.type.function.arrow.flow set: optional-type-expression optional-type-expression: - include: Packages/Naomi/syntaxes/flow1/optional-type-expression.sublime-syntax - diff --git a/syntaxes/flow1/indexer.sublime-syntax b/syntaxes/flow1/indexer.sublime-syntax index 6c921930..b9d42e6a 100644 --- a/syntaxes/flow1/indexer.sublime-syntax +++ b/syntaxes/flow1/indexer.sublime-syntax @@ -26,18 +26,18 @@ contexts: main: - match: \s*(\[) captures: - 1: >- - flow - punctuation.definition.object.indexer.flow - set: [ indexer-end, optional-name ] + 1: punctuation.section.brackets.begin.flow + set: [ + optional-associated-type, + indexer-end, + optional-name + ] indexer-end: - match: \s*(]) captures: - 1: >- - flow - punctuation.definition.object.indexer.flow - set: optional-associated-type + 1: punctuation.section.brackets.end.flow + pop: true type-expression: - include: Packages/Naomi/syntaxes/flow1/type-expression.sublime-syntax @@ -53,12 +53,8 @@ contexts: ({{commonIdentifier}})(\?)? (?=\s*:) captures: - 1: >- - function.parameter.js.fjsx15 - entity.name.variable.js.fjsx15 - 2: >- - flow - keyword.operator.other.optional.flow + 1: variable.parameter.function.js.fjsx15 + 2: storage.modifier.optional.flow set: associated-type # Strings. - match: (?=\s*(?>'|"|`)) diff --git a/syntaxes/flow1/interface.sublime-syntax b/syntaxes/flow1/interface.sublime-syntax index 0c575e3d..be1a2b63 100644 --- a/syntaxes/flow1/interface.sublime-syntax +++ b/syntaxes/flow1/interface.sublime-syntax @@ -26,9 +26,7 @@ contexts: main: - match: \s*(interface)\b captures: - 1: >- - flow - storage.type.flow + 1: storage.type.interface.flow set: declaration declaration: @@ -36,9 +34,7 @@ contexts: # Extension. - match: \s*(extends)\b captures: - 1: >- - flow - storage.modifier.flow + 1: storage.modifier.extends.flow push: optional-type-expression # Template parameters. - match: (?=\s*<) @@ -49,9 +45,7 @@ contexts: # Identifier. - match: (?xi)\s*({{commonIdentifier}}) captures: - 1: >- - flow - entity.name.interface.flow + 1: entity.name.interface.flow optional-type-expression: - include: Packages/Naomi/syntaxes/flow1/optional-type-expression.sublime-syntax @@ -63,23 +57,19 @@ contexts: - include: comment-no-pop - match: \s*(\{) captures: - 1: >- - flow - punctuation.definition.interface.body.begin.flow + 1: punctuation.section.block.begin.flow set: [ body-end, statements-and-expressions ] body-end: - include: comment-no-pop - match: \s*(?>(,)|(;)) captures: - 1: punctuation.definition.object.js.fjsx15 - 2: keyword.other.terminator.js.fjsx15 + 1: punctuation.separator.comma.flow + 2: punctuation.terminator.flow push: statements-and-expressions - match: \s*(}) captures: - 1: >- - flow - punctuation.definition.interface.body.end.flow + 1: punctuation.section.brackets.end.flow pop: true - match: (?=\s*\S) push: statements-and-expressions diff --git a/syntaxes/flow1/module.sublime-syntax b/syntaxes/flow1/module.sublime-syntax index daf55249..83d6327d 100644 --- a/syntaxes/flow1/module.sublime-syntax +++ b/syntaxes/flow1/module.sublime-syntax @@ -34,10 +34,7 @@ contexts: # ES module. - match: \s*(module) captures: - 1: >- - flow - storage.type.flow - keyword.declaration.type-aliasing.flow + 1: storage.type.module.flow set: identifier common-js-module: @@ -46,9 +43,7 @@ contexts: association: - match: \s*(:) captures: - 1: >- - flow - keyword.operator.other.association.flow + 1: keyword.operator.other.flow pop: true object-literal: @@ -62,7 +57,5 @@ contexts: (?xi)\a* ({{commonIdentifier}}) captures: - 1: >- - flow - entity.name.module.flow + 1: entity.name.module.flow pop: true diff --git a/syntaxes/flow1/namespace-path.no-pop.sublime-syntax b/syntaxes/flow1/namespace-path.no-pop.sublime-syntax index 856e90db..0e0c916b 100644 --- a/syntaxes/flow1/namespace-path.no-pop.sublime-syntax +++ b/syntaxes/flow1/namespace-path.no-pop.sublime-syntax @@ -26,63 +26,13 @@ contexts: # Javascript/flow don’t have namespaces, this is just a visual cue to highlight # only the last element when a type is expected. main: - # Namespace delimited by dots. - match: | - (?xi)\s* - (?> - (?:\b - ({{commonIdentifier}})(\??\.) - ({{commonIdentifier}})(\??\.) - ) - | - (?:\b({{commonIdentifier}})(\??\.)) + (?xi) + \s*({{commonIdentifier}})\s* + (?> (\?\.) + | (\.) ) captures: - 1: >- - flow - entity.name.namespace.a.flow - 2: >- - flow - punctuation.definition.namespace.a.flow - 3: >- - flow - entity.name.namespace.b.flow - 4: >- - flow - punctuation.definition.namespace.b.flow - 5: >- - flow - entity.name.namespace.a.flow - 6: >- - flow - punctuation.definition.namespace.a.flow - # Namespace delimited by dollar signs. - - match: | - (?xi)\s* - (?> - (?:\b - ({{commonIdentifier}})(\$) - ({{commonIdentifier}})(\$) - ) - | - (?:\b({{commonIdentifier}})(\$)) - ) - captures: - 1: >- - flow - entity.name.namespace.a.flow - 2: >- - flow - punctuation.definition.namespace.a.flow - 3: >- - flow - entity.name.namespace.b.flow - 4: >- - flow - punctuation.definition.namespace.b.flow - 5: >- - flow - entity.name.namespace.a.flow - 6: >- - flow - punctuation.definition.namespace.a.flow + 1: variable.other.namespace.flow + 2: punctuation.accessor.optional-chain.flow + 3: punctuation.accessor.flow diff --git a/syntaxes/flow1/object.sublime-syntax b/syntaxes/flow1/object.sublime-syntax index f3945205..292d724b 100644 --- a/syntaxes/flow1/object.sublime-syntax +++ b/syntaxes/flow1/object.sublime-syntax @@ -31,44 +31,31 @@ contexts: # Exact. - match: \s*({)\s*(\|) captures: - 1: >- - flow - punctuation.definition.object.begin.flow - 2: >- - flow - punctuation.definition.object.begin.flow + 1: punctuation.section.block.begin.flow + 2: punctuation.section.block.begin.flow set: [ delimiters, optional-property-or-method ] # Normal. - match: \s*({) captures: - 1: >- - flow - punctuation.definition.object.begin.flow + 1: punctuation.section.block.begin.flow set: [ delimiters, optional-property-or-method ] delimiters: - - match: \s*(,|;) + - match: \s*(?:(,)|(;)) captures: - 1: >- - flow - punctuation.definition.object.flow + 1: punctuation.separator.comma.flow + 2: punctuation.terminator.flow push: optional-property-or-method # Exact. - match: \s*(\|)\s*(}) captures: - 1: >- - flow - punctuation.definition.object.end.flow - 2: >- - flow - punctuation.definition.object.end.flow + 1: punctuation.section.block.end.flow + 2: punctuation.section.block.end.flow pop: true # Normal. - match: \s*(}) captures: - 1: >- - flow - punctuation.definition.object.end.flow + 1: punctuation.section.block.end.flow pop: true optional-property-or-method: @@ -165,4 +152,3 @@ contexts: comment-no-pop: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - diff --git a/syntaxes/flow1/optional-modifier.sublime-syntax b/syntaxes/flow1/optional-modifier.sublime-syntax index f9116221..cdec777e 100644 --- a/syntaxes/flow1/optional-modifier.sublime-syntax +++ b/syntaxes/flow1/optional-modifier.sublime-syntax @@ -21,7 +21,5 @@ contexts: main: - match: \s*(\?) captures: - 1: >- - flow - keyword.operator.other.optional.flow + 1: storage.modifier.optional.flow pop: true diff --git a/syntaxes/flow1/prolog.sublime-syntax b/syntaxes/flow1/prolog.sublime-syntax index dca1c90b..20ec908f 100644 --- a/syntaxes/flow1/prolog.sublime-syntax +++ b/syntaxes/flow1/prolog.sublime-syntax @@ -25,7 +25,5 @@ contexts: | \/\*\s*@flow\s\*\/ )) captures: - 1: >- - flow - keyword.other.prolog.flow + 1: keyword.other.prolog.flow pop: true diff --git a/syntaxes/flow1/tuple.sublime-syntax b/syntaxes/flow1/tuple.sublime-syntax index dae91a0f..e0e648c1 100644 --- a/syntaxes/flow1/tuple.sublime-syntax +++ b/syntaxes/flow1/tuple.sublime-syntax @@ -21,23 +21,17 @@ contexts: main: - match: \s*(\[) captures: - 1: >- - flow - punctuation.definition.array.begin.flow + 1: punctuation.section.brackets.flow set: [ delimiters, optional-type-expression ] delimiters: - match: \s*(,) captures: - 1: >- - flow - punctuation.definition.array.flow + 1: punctuation.separator.flow push: optional-type-expression - match: \s*(]) captures: - 1: >- - flow - punctuation.definition.array.end.flow + 1: punctuation.section.brackets.end.flow pop: true optional-type-expression: diff --git a/syntaxes/flow1/type-aliasing.sublime-syntax b/syntaxes/flow1/type-aliasing.sublime-syntax index c3eae2b2..ca411b98 100644 --- a/syntaxes/flow1/type-aliasing.sublime-syntax +++ b/syntaxes/flow1/type-aliasing.sublime-syntax @@ -40,12 +40,8 @@ contexts: {{templateArguments}}? ) captures: - 1: >- - flow - storage.modifier.flow - 2: >- - flow - storage.type.flow + 1: storage.modifier.opaque.flow + 2: storage.type.flow set: [ punctuation, identifier @@ -56,7 +52,7 @@ contexts: (?xi)\s* ({{commonIdentifier}}) captures: - 1: entity.name.type.flow + 1: variable.type.flow pop: true punctuation: diff --git a/syntaxes/flow1/type-expression.sublime-syntax b/syntaxes/flow1/type-expression.sublime-syntax index f64bd15d..e7ba97f3 100644 --- a/syntaxes/flow1/type-expression.sublime-syntax +++ b/syntaxes/flow1/type-expression.sublime-syntax @@ -31,9 +31,7 @@ contexts: # Open new type expression group. - match: "{{expressionGroupBegin}}" captures: - 1: >- - flow - punctuation.definition.expression.group.begin.flow + 1: punctuation.section.group.begin.flow set: open-group # Start of the type expression. - match: "{{expressionBegin}}" @@ -52,9 +50,7 @@ contexts: # Open new type expression group. - match: "{{expressionGroupBegin}}" captures: - 1: >- - flow - punctuation.definition.expression.group.begin.flow + 1: punctuation.section.group.begin.flow push: open-group # Close the current type expression group. - include: close-group @@ -65,9 +61,7 @@ contexts: close-group: - match: \s*(\)) captures: - 1: >- - flow - punctuation.definition.expression.group.end.flow + 1: punctuation.section.group.end.flow set: optional-tail head: From 25b4bb70ed053c8dd7c938f43560a42e88fd36e9 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Thu, 4 Jan 2018 12:02:49 -0200 Subject: [PATCH 389/407] Change namespace and extends colors --- Candyman.scsscheme | 1 + Candyman.tmTheme | 37 ++++++++++++++++++-------------- schemes/candyman/_class.scss | 2 -- schemes/candyman/_modifier.scss | 5 +++++ schemes/candyman/_namespace.scss | 15 +++++++++++++ schemes/candyman/_variable.scss | 7 +----- 6 files changed, 43 insertions(+), 24 deletions(-) create mode 100644 schemes/candyman/_namespace.scss diff --git a/Candyman.scsscheme b/Candyman.scsscheme index 588aa2eb..832ad6c8 100644 --- a/Candyman.scsscheme +++ b/Candyman.scsscheme @@ -37,6 +37,7 @@ @import 'schemes/candyman/label'; @import 'schemes/candyman/markup'; @import 'schemes/candyman/modifier'; +@import 'schemes/candyman/namespace'; @import 'schemes/candyman/number'; @import 'schemes/candyman/object'; @import 'schemes/candyman/punctuation'; diff --git a/Candyman.tmTheme b/Candyman.tmTheme index 11af59d0..fdb539f6 100644 --- a/Candyman.tmTheme +++ b/Candyman.tmTheme @@ -930,8 +930,6 @@ .entity.name.class settings - background - #AED58106 foreground #aed581 @@ -941,8 +939,6 @@ .entity.other.inherited-class settings - background - #EA80FC06 foreground #ea80fc @@ -1559,6 +1555,26 @@ #b39ddb + + scope + .storage.modifier.extends + settings + + fontStyle + italic + foreground + #f36c60 + + + + scope + .variable.other.namespace + settings + + foreground + #bcaaa4 + + scope .storage.type.numeric @@ -1767,7 +1783,7 @@ scope - .variable.other.readwrite, .punctuation.definition.variable + .variable.other, .punctuation.definition.variable settings fontStyle @@ -1787,17 +1803,6 @@ #e0e0e0 - - scope - .variable.other.object - settings - - fontStyle - italic - foreground - #bcaaa4 - - scope .variable.language.prototype, .variable.language.this diff --git a/schemes/candyman/_class.scss b/schemes/candyman/_class.scss index b4e7f766..9d99e81b 100644 --- a/schemes/candyman/_class.scss +++ b/schemes/candyman/_class.scss @@ -12,10 +12,8 @@ .entity.name.class { foreground: $light-green-300; - background: rgba($light-green-300, .025); } .entity.other.inherited-class { foreground: $purple-a100; - background: rgba($purple-a100, .025); } diff --git a/schemes/candyman/_modifier.scss b/schemes/candyman/_modifier.scss index 2dbdf9cd..519e6090 100644 --- a/schemes/candyman/_modifier.scss +++ b/schemes/candyman/_modifier.scss @@ -16,4 +16,9 @@ foreground: $deep-purple-200; fontStyle: none; } + + &.modifier.extends { + foreground: $red-300; + fontStyle: italic; + } } diff --git a/schemes/candyman/_namespace.scss b/schemes/candyman/_namespace.scss new file mode 100644 index 00000000..075a6a43 --- /dev/null +++ b/schemes/candyman/_namespace.scss @@ -0,0 +1,15 @@ +// Licensed under the Apache License, Version 2.0 (the “License”); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +.variable.other.namespace { + foreground: $brown-200; +} diff --git a/schemes/candyman/_variable.scss b/schemes/candyman/_variable.scss index ba0958d1..b4268c4e 100644 --- a/schemes/candyman/_variable.scss +++ b/schemes/candyman/_variable.scss @@ -10,7 +10,7 @@ // License for the specific language governing permissions and limitations under // the License. -.variable.other.readwrite, +.variable.other, .punctuation.definition.variable { foreground: $gray-300; fontStyle: none; @@ -22,11 +22,6 @@ } .variable { - &.other.object { - foreground: $brown-200; - fontStyle: italic; - } - &.language { &.prototype, &.this { From e0946e7aa5e6119d19576bbc430899f537b94c8f Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Thu, 4 Jan 2018 12:21:26 -0200 Subject: [PATCH 390/407] [FJSX15] Remove dead code --- syntaxes/fjsx15/import.sublime-syntax | 1 - 1 file changed, 1 deletion(-) diff --git a/syntaxes/fjsx15/import.sublime-syntax b/syntaxes/fjsx15/import.sublime-syntax index 2fa9e79e..d12fcb79 100644 --- a/syntaxes/fjsx15/import.sublime-syntax +++ b/syntaxes/fjsx15/import.sublime-syntax @@ -55,7 +55,6 @@ contexts: - match: | (?x) \s*(import)\b - (?!\s*\.) captures: 1: keyword.control.import-export.js.fjsx15 set: targets From 4acbedff8500edaa850bc65011093c95c64698a5 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Thu, 4 Jan 2018 12:21:37 -0200 Subject: [PATCH 391/407] [FJSX15] Add function.sent and import.meta --- syntaxes/fjsx15/core.sublime-syntax | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/syntaxes/fjsx15/core.sublime-syntax b/syntaxes/fjsx15/core.sublime-syntax index 4273487e..fa02a456 100644 --- a/syntaxes/fjsx15/core.sublime-syntax +++ b/syntaxes/fjsx15/core.sublime-syntax @@ -73,9 +73,8 @@ contexts: - include: constants - include: variables - include: functions - # - include: variables - # - include: functions - # - include: import-properties + - include: function-properties + - include: import-properties - include: fundamental-objects - include: numbers-and-dates - include: text-processing @@ -227,6 +226,17 @@ contexts: arguments ] + function-properties: + - match: | + (?x) + \s*(function) + \s*(\.) + \s*(sent) + captures: + 1: support.type.object.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.variable.js.fsjx15 + fundamental-objects: - match: \s*(Object)\s*(\.) captures: @@ -257,6 +267,17 @@ contexts: 1: support.type.object.js.fjsx15 pop: true + import-properties: + - match: | + (?x) + \s*(import) + \s*(\.) + \s*(meta) + captures: + 1: support.type.object.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.variable.js.fsjx15 + object-property-or-function: # Function call. - match: | From da7c827aa2b178c6d5892ee1e60187d811c4dc38 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Thu, 4 Jan 2018 12:42:53 -0200 Subject: [PATCH 392/407] Change numbers color --- Candyman.tmTheme | 20 ++++++++++---------- schemes/candyman/_number.scss | 20 ++++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Candyman.tmTheme b/Candyman.tmTheme index fdb539f6..574d764c 100644 --- a/Candyman.tmTheme +++ b/Candyman.tmTheme @@ -1581,7 +1581,7 @@ settings foreground - #ffa726 + #ffd54f @@ -1592,7 +1592,7 @@ fontStyle foreground - #ffa726 + #ffd54f @@ -1601,7 +1601,7 @@ settings foreground - #ce93d8 + #4dd0e1 @@ -1610,7 +1610,7 @@ settings foreground - #ba68c8 + #4dd0e1 @@ -1619,7 +1619,7 @@ settings foreground - #4dd0e1 + #ff8a65 @@ -1628,7 +1628,7 @@ settings foreground - #4dd0e1 + #ff8a65 @@ -1637,7 +1637,7 @@ settings foreground - #dce775 + #bcaaa4 @@ -1646,7 +1646,7 @@ settings foreground - #dce775 + #bcaaa4 @@ -1655,7 +1655,7 @@ settings foreground - #e0e0e0 + #72d572 @@ -1664,7 +1664,7 @@ settings foreground - #e0e0e0 + #72d572 diff --git a/schemes/candyman/_number.scss b/schemes/candyman/_number.scss index b2cda97c..61b86bd6 100644 --- a/schemes/candyman/_number.scss +++ b/schemes/candyman/_number.scss @@ -11,38 +11,38 @@ // the License. .storage.type.numeric { - foreground: $orange-400; + foreground: $amber-300; } .constant.numeric { - foreground: $orange-400; + foreground: $amber-300; fontStyle: none; &.float { - foreground: $purple-200; + foreground: $cyan-300; .punctuation.defintion { - foreground: $purple-300; + foreground: $cyan-300; } } &.binary { - foreground: $cyan-300; + foreground: $deep-orange-300; .punctuation.definition { - foreground: $cyan-300; + foreground: $deep-orange-300; } } &.octal { - foreground: $lime-300; + foreground: $brown-200; .punctuation.definition { - foreground: $lime-300; + foreground: $brown-200; } } &.hex { - foreground: $gray-300; + foreground: $green-200; .punctuation.definition { - foreground: $gray-300; + foreground: $green-200; } } } From fb3ba6375dea9d9a9e89d76b21bd91d1efccaa99 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Thu, 4 Jan 2018 20:35:01 -0200 Subject: [PATCH 393/407] [FJSX15] Simplify function calls --- syntaxes/fjsx15/core.sublime-syntax | 2 +- syntaxes/fjsx15/decorator.sublime-syntax | 2 +- syntaxes/fjsx15/expression.sublime-syntax | 2 +- syntaxes/fjsx15/function-call.sublime-syntax | 2 +- .../function-call/arguments.sublime-syntax | 40 ------------------- syntaxes/fjsx15/jest.sublime-syntax | 2 +- syntaxes/fjsx15/node-js.sublime-syntax | 2 +- syntaxes/fjsx15/react-js.sublime-syntax | 2 +- syntaxes/fjsx15/web.sublime-syntax | 2 +- 9 files changed, 8 insertions(+), 48 deletions(-) delete mode 100644 syntaxes/fjsx15/function-call/arguments.sublime-syntax diff --git a/syntaxes/fjsx15/core.sublime-syntax b/syntaxes/fjsx15/core.sublime-syntax index fa02a456..a45f78fe 100644 --- a/syntaxes/fjsx15/core.sublime-syntax +++ b/syntaxes/fjsx15/core.sublime-syntax @@ -95,7 +95,7 @@ contexts: pop: true arguments: - - include: Packages/Naomi/syntaxes/fjsx15/function-call/arguments.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax function-call-meta-scope: - meta_scope: meta.function-call.js.fjsx15 diff --git a/syntaxes/fjsx15/decorator.sublime-syntax b/syntaxes/fjsx15/decorator.sublime-syntax index 661c3780..35bd8334 100644 --- a/syntaxes/fjsx15/decorator.sublime-syntax +++ b/syntaxes/fjsx15/decorator.sublime-syntax @@ -59,7 +59,7 @@ contexts: ] arguments: - - include: Packages/Naomi/syntaxes/fjsx15/function-call/arguments.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax # The decorator might be followed by a chain of function calls and we want to # to highlight them as decorators too. diff --git a/syntaxes/fjsx15/expression.sublime-syntax b/syntaxes/fjsx15/expression.sublime-syntax index 48b4a55c..a7d99866 100644 --- a/syntaxes/fjsx15/expression.sublime-syntax +++ b/syntaxes/fjsx15/expression.sublime-syntax @@ -132,7 +132,7 @@ contexts: function-call: - include: comment-no-pop - - include: Packages/Naomi/syntaxes/fjsx15/function-call/arguments.sublime-syntax + - include: main property-access: - include: comment-no-pop diff --git a/syntaxes/fjsx15/function-call.sublime-syntax b/syntaxes/fjsx15/function-call.sublime-syntax index a32ec6fd..1f63edc9 100644 --- a/syntaxes/fjsx15/function-call.sublime-syntax +++ b/syntaxes/fjsx15/function-call.sublime-syntax @@ -83,7 +83,7 @@ contexts: - include: Packages/Naomi/syntaxes/flow1/template/arguments.sublime-syntax arguments: - - include: Packages/Naomi/syntaxes/fjsx15/function-call/arguments.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax meta-scope: - meta_scope: meta.function-call.js.fjsx15 diff --git a/syntaxes/fjsx15/function-call/arguments.sublime-syntax b/syntaxes/fjsx15/function-call/arguments.sublime-syntax deleted file mode 100644 index 0646f9f7..00000000 --- a/syntaxes/fjsx15/function-call/arguments.sublime-syntax +++ /dev/null @@ -1,40 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -scope: ... - -contexts: - main: - - match: \s*(\() - captures: - 1: punctuation.section.group.begin.js.fjsx15 - set: [ delimiter, optional-expression ] - - delimiter: - - meta_scope: meta.group.js.fjsx15 - - match: \s*(\)) - captures: - 1: punctuation.section.group.end.js.fjsx15 - pop: true - - match: (?=\s*\S) - push: expression - - expression: - - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax - - optional-expression: - - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/jest.sublime-syntax b/syntaxes/fjsx15/jest.sublime-syntax index bb8bbb76..4a717f70 100644 --- a/syntaxes/fjsx15/jest.sublime-syntax +++ b/syntaxes/fjsx15/jest.sublime-syntax @@ -70,7 +70,7 @@ contexts: 1: punctuation.accessor.js.fjsx15 arguments: - - include: Packages/Naomi/syntaxes/fjsx15/function-call/arguments.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax optional-skip-only: - include: accessor-no-pop diff --git a/syntaxes/fjsx15/node-js.sublime-syntax b/syntaxes/fjsx15/node-js.sublime-syntax index 5c3e3a1f..a2a31cd8 100644 --- a/syntaxes/fjsx15/node-js.sublime-syntax +++ b/syntaxes/fjsx15/node-js.sublime-syntax @@ -26,7 +26,7 @@ contexts: - include: constants function-arguments: - - include: Packages/Naomi/syntaxes/fjsx15/function-call/arguments.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax module: - match: | diff --git a/syntaxes/fjsx15/react-js.sublime-syntax b/syntaxes/fjsx15/react-js.sublime-syntax index 9739c012..7d4715b2 100644 --- a/syntaxes/fjsx15/react-js.sublime-syntax +++ b/syntaxes/fjsx15/react-js.sublime-syntax @@ -26,7 +26,7 @@ contexts: - include: react-dom-functions arguments: - - include: Packages/Naomi/syntaxes/fjsx15/function-call/arguments.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax optional-property-type-and-value: - include: Packages/Naomi/syntaxes/fjsx15/class/property.sublime-syntax#optional-type-and-value diff --git a/syntaxes/fjsx15/web.sublime-syntax b/syntaxes/fjsx15/web.sublime-syntax index 7be447e1..b4424ab6 100644 --- a/syntaxes/fjsx15/web.sublime-syntax +++ b/syntaxes/fjsx15/web.sublime-syntax @@ -25,7 +25,7 @@ contexts: optional-template-and-arguments: - include: Packages/Naomi/syntaxes/flow1/template/arguments.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/function-call/arguments.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax - match: (?=\s*\S) pop: true From e01751595bb606798a022e7d0b92c704dc62d13c Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Thu, 4 Jan 2018 20:35:26 -0200 Subject: [PATCH 394/407] [FJSX15] Simplify imports --- syntaxes/fjsx15/import.sublime-syntax | 71 +++++++++++++++++++-------- 1 file changed, 51 insertions(+), 20 deletions(-) diff --git a/syntaxes/fjsx15/import.sublime-syntax b/syntaxes/fjsx15/import.sublime-syntax index d12fcb79..bbe0f4ed 100644 --- a/syntaxes/fjsx15/import.sublime-syntax +++ b/syntaxes/fjsx15/import.sublime-syntax @@ -57,7 +57,10 @@ contexts: \s*(import)\b captures: 1: keyword.control.import-export.js.fjsx15 - set: targets + set: [ + delimiter, + optional-target + ] function-call-meta-scope: - meta_scope: meta.function-call.js.fjsx15 @@ -65,42 +68,70 @@ contexts: pop: true arguments: - - include: Packages/Naomi/syntaxes/fjsx15/function-call/arguments.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax comment-no-pop: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - origin: - - match: \s*(from)\b - captures: - 1: keyword.control.import-export.origin.js.fjsx15 - set: origin-path - origin-path: - include: Packages/Naomi/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/literal/string/template.sublime-syntax - punctuation: + close-block: + - match: \s*(}) + captures: + 1: punctuation.section.block.end.js.fjsx15 + pop: true + + optional-target: + - match: (?=\s*(?>[,}]|from)) + pop: true + # All. + - match: \s*(\*) + captures: + 1: keyword.control.import-export.star.js.fjsx15 + pop: true + # Multiple targets. - match: \s*(\{) captures: 1: punctuation.section.block.begin.js.fjsx15 - - match: \s*(}) + set: [ + close-block, + delimiter, + optional-target + ] + # Simple. + - match: | + (?xi)\s* + ({{commonIdentifier}}) captures: - 1: punctuation.section.block.end.js.fjsx15 + 1: entity.name.variable.js.fjsx15 + set: optional-alias + + delimiter: - match: \s*(,) captures: 1: punctuation.separator.comma.js.fjsx15 + push: optional-target + # Origin. + - match: \s*(from)\b + captures: + 1: keyword.control.import-export.origin.js.fjsx15 + set: origin-path + # Anything else. + - match: (?=\s*\S) + pop: true - targets: - - include: comment-no-pop - - include: origin - - include: punctuation - - match: "" - push: - - include: sequence - - match: "" - pop: true + # targets: + # - include: comment-no-pop + # - include: origin + # - include: punctuation + # - match: "" + # push: + # - include: sequence + # - match: "" + # pop: true sequence: - include: Packages/Naomi/syntaxes/fjsx15/operator/typeof.sublime-syntax From 74469721aae663cd85ae745669d50b8233d4d3f6 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Thu, 4 Jan 2018 20:35:46 -0200 Subject: [PATCH 395/407] [FJSX15] Simplify new operator --- syntaxes/fjsx15/operator/new.sublime-syntax | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/fjsx15/operator/new.sublime-syntax b/syntaxes/fjsx15/operator/new.sublime-syntax index 65232da2..7b05a527 100644 --- a/syntaxes/fjsx15/operator/new.sublime-syntax +++ b/syntaxes/fjsx15/operator/new.sublime-syntax @@ -80,7 +80,7 @@ contexts: pop: true optional-arguments: - - include: Packages/Naomi/syntaxes/fjsx15/function-call/arguments.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax - match: (?=\s*\S) pop: true From 914c2351b484725b41305a7213d7ca528ac5a078 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Thu, 4 Jan 2018 21:53:38 -0200 Subject: [PATCH 396/407] [FJSX15] Restore type import --- syntaxes/fjsx15/import.sublime-syntax | 105 ++++------------------ syntaxes/flow1/type-import.sublime-syntax | 89 ++++++++++++++++++ 2 files changed, 108 insertions(+), 86 deletions(-) create mode 100644 syntaxes/flow1/type-import.sublime-syntax diff --git a/syntaxes/fjsx15/import.sublime-syntax b/syntaxes/fjsx15/import.sublime-syntax index bbe0f4ed..bbb6b28f 100644 --- a/syntaxes/fjsx15/import.sublime-syntax +++ b/syntaxes/fjsx15/import.sublime-syntax @@ -22,13 +22,6 @@ variables: [$_[:alpha:]] [$_[:alnum:]]* - templateArguments: | - (< - [^<>]* - \g<-1>? - [^<>]* - >) - contexts: main: - include: Packages/Naomi/syntaxes/fjsx15/core.sublime-syntax#import-properties @@ -73,6 +66,12 @@ contexts: comment-no-pop: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax + origin: + - match: \s*(from)\b + captures: + 1: keyword.control.import-export.origin.js.fjsx15 + set: origin-path + origin-path: - include: Packages/Naomi/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax @@ -87,6 +86,8 @@ contexts: optional-target: - match: (?=\s*(?>[,}]|from)) pop: true + # Type. + - include: Packages/Naomi/syntaxes/flow1/type-import.sublime-syntax # All. - match: \s*(\*) captures: @@ -101,101 +102,33 @@ contexts: delimiter, optional-target ] + # Aliased. + - match: | + (?xi)\s* + ({{commonIdentifier}}) + (?=\s+as) + captures: + 1: variable.other.readwrite.js.fjsx15 + set: alias # Simple. - match: | (?xi)\s* ({{commonIdentifier}}) captures: 1: entity.name.variable.js.fjsx15 - set: optional-alias + pop: true delimiter: - match: \s*(,) captures: 1: punctuation.separator.comma.js.fjsx15 push: optional-target - # Origin. - - match: \s*(from)\b - captures: - 1: keyword.control.import-export.origin.js.fjsx15 - set: origin-path + # From. + - include: origin # Anything else. - match: (?=\s*\S) pop: true - # targets: - # - include: comment-no-pop - # - include: origin - # - include: punctuation - # - match: "" - # push: - # - include: sequence - # - match: "" - # pop: true - - sequence: - - include: Packages/Naomi/syntaxes/fjsx15/operator/typeof.sublime-syntax - # Type. - - match: \s*(type)\b - captures: - 1: storage.type.flow - set: types - # Default. - - match: \s*(default)\b - captures: - 1: >- - storage.modifier.js.fjsx15 - keyword.control.import-export.default.js.fjsx15 - set: optional-alias - # All. - - match: \s*(\*) - captures: - 1: keyword.control.import-export.star.js.fjsx15 - set: optional-alias - # Simple. - - match: | - (?xi)\s* - ({{commonIdentifier}}) - captures: - 1: entity.name.readwrite.js.fjsx15 - set: optional-alias - - types: - - include: aliased-type - - match: \s*(}) - captures: - 1: punctuation.section.block.end.js.fjsx15 - pop: true - - match: \s*(\{) - captures: - 1: punctuation.section.block.begin.js.fjsx15 - push: - - include: aliased-type - - match: \s*(,) - captures: - 1: punctuation.separator.comma.js.fjsx15 - - match: (?=\s*}) - pop: true - - aliased-type: - - match: | - (?xi) - (?={{commonIdentifier}}) - set: [ - optional-alias, - simple-type - ] - - simple-type: - - include: Packages/Naomi/syntaxes/flow1/simple.sublime-syntax - - optional-alias: - - match: | - (?x) - (?=\s*(?>,|}|from)) - pop: true - - include: alias - alias: - match: \s*(as)\b captures: diff --git a/syntaxes/flow1/type-import.sublime-syntax b/syntaxes/flow1/type-import.sublime-syntax new file mode 100644 index 00000000..db5f143c --- /dev/null +++ b/syntaxes/flow1/type-import.sublime-syntax @@ -0,0 +1,89 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + +contexts: + main: + - match: \s*(type)\b + captures: + 1: storage.type.flow + set: optional-target + + optional-target: + - match: (?=\s*(?>[,}]|from)) + pop: true + # Multiple targets. + - match: \s*(\{) + captures: + 1: punctuation.section.block.begin.js.fjsx15 + set: [ + close-block, + delimiter, + optional-target + ] + # Aliased. + - match: | + (?xi)\s* + ({{commonIdentifier}}) + (?=\s+as) + captures: + 1: variable.other.type.js.fjsx15 + set: alias + # Simple. + - match: | + (?xi)\s* + ({{commonIdentifier}}) + captures: + 1: entity.name.type.js.fjsx15 + pop: true + + delimiter: + - match: \s*(,) + captures: + 1: punctuation.separator.comma.js.fjsx15 + push: optional-target + # From. + - include: origin + # Anything else. + - match: (?=\s*\S) + pop: true + + origin: + - include: Packages/Naomi/syntaxes/fjsx15/import.sublime-syntax#origin + + close-block: + - include: Packages/Naomi/syntaxes/fjsx15/import.sublime-syntax#close-block + + alias: + - match: \s*(as)\b + captures: + 1: keyword.control.import-export.as.js.fjsx15 + set: alias-name + + alias-name: + - match: | + (?xi)\s* + ({{commonIdentifier}}) + captures: + 1: entity.name.type.js.fjsx15 + pop: true From df9e79ab0471553b359bfbe598d682263239bbcf Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Thu, 4 Jan 2018 21:53:57 -0200 Subject: [PATCH 397/407] [FLOW] Fix generics scopes --- syntaxes/flow1/template/parameters.sublime-syntax | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/syntaxes/flow1/template/parameters.sublime-syntax b/syntaxes/flow1/template/parameters.sublime-syntax index 9f2a8f3e..d54e9684 100644 --- a/syntaxes/flow1/template/parameters.sublime-syntax +++ b/syntaxes/flow1/template/parameters.sublime-syntax @@ -34,7 +34,7 @@ contexts: (?xi) \s*({{commonIdentifier}}) captures: - 1: variable.other.type.flow + 1: variable.parameter.generic.flow set: optional-refinement optional-refinement: @@ -47,7 +47,7 @@ contexts: - match: \s*(,) captures: 1: punctuation.separator.comma.flow - push: optional-type-expression + set: [ delimiters, generic-identifier ] - match: \s*(>) captures: 1: punctuation.definition.generic.end.flow From 136ab9143e4e64af2360ce286cd06b8508e90840 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Thu, 4 Jan 2018 21:54:05 -0200 Subject: [PATCH 398/407] [FLOW] Fix type aliasing scopes --- syntaxes/flow1/type-aliasing.sublime-syntax | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/flow1/type-aliasing.sublime-syntax b/syntaxes/flow1/type-aliasing.sublime-syntax index ca411b98..09614a39 100644 --- a/syntaxes/flow1/type-aliasing.sublime-syntax +++ b/syntaxes/flow1/type-aliasing.sublime-syntax @@ -52,7 +52,7 @@ contexts: (?xi)\s* ({{commonIdentifier}}) captures: - 1: variable.type.flow + 1: entity.name.type.flow pop: true punctuation: From da1eb66f3356052037da146a46274ede4eb0e510 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Thu, 4 Jan 2018 21:54:18 -0200 Subject: [PATCH 399/407] Add generic color --- Candyman.scsscheme | 1 + Candyman.tmTheme | 13 ++++++++++++- schemes/candyman/_generic.scss | 16 ++++++++++++++++ schemes/candyman/_type.scss | 1 + 4 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 schemes/candyman/_generic.scss diff --git a/Candyman.scsscheme b/Candyman.scsscheme index 832ad6c8..5e5e1362 100644 --- a/Candyman.scsscheme +++ b/Candyman.scsscheme @@ -30,6 +30,7 @@ @import 'schemes/candyman/function-call'; @import 'schemes/candyman/function/body'; @import 'schemes/candyman/function/parameters'; +@import 'schemes/candyman/generic'; @import 'schemes/candyman/global/console'; @import 'schemes/candyman/global/jest'; @import 'schemes/candyman/json'; diff --git a/Candyman.tmTheme b/Candyman.tmTheme index 574d764c..766556c9 100644 --- a/Candyman.tmTheme +++ b/Candyman.tmTheme @@ -1075,6 +1075,17 @@ #ffe082 + + scope + .variable.parameter.generic + settings + + fontStyle + + foreground + #ea80fc + + scope .support.function.console.error @@ -1738,7 +1749,7 @@ scope - .variable.type, .variable.other.type + .entity.name.type, .variable.type, .variable.other.type settings foreground diff --git a/schemes/candyman/_generic.scss b/schemes/candyman/_generic.scss new file mode 100644 index 00000000..4d1bf422 --- /dev/null +++ b/schemes/candyman/_generic.scss @@ -0,0 +1,16 @@ +// Licensed under the Apache License, Version 2.0 (the “License”); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +.variable.parameter.generic { + foreground: $purple-a100; + fontStyle: none; +} diff --git a/schemes/candyman/_type.scss b/schemes/candyman/_type.scss index ddb0b9b2..93e5d6cb 100644 --- a/schemes/candyman/_type.scss +++ b/schemes/candyman/_type.scss @@ -10,6 +10,7 @@ // License for the specific language governing permissions and limitations under // the License. +.entity.name.type, .variable.type, .variable.other.type { foreground: $light-green-300; From b1bb662520a7a1d11d39c4b767aa05ba86d17228 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Thu, 4 Jan 2018 22:00:39 -0200 Subject: [PATCH 400/407] [FLOW] Fix array shorthand --- syntaxes/flow1/operator/array-shorthand.sublime-syntax | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/syntaxes/flow1/operator/array-shorthand.sublime-syntax b/syntaxes/flow1/operator/array-shorthand.sublime-syntax index 3fddec8e..490fe04f 100644 --- a/syntaxes/flow1/operator/array-shorthand.sublime-syntax +++ b/syntaxes/flow1/operator/array-shorthand.sublime-syntax @@ -22,6 +22,6 @@ contexts: - match: \s*((\[)\s*(])) captures: 1: meta.sequence.flow - 1: punctuation.section.brackets.begin.flow - 2: punctuation.section.brackets.end.flow + 2: punctuation.section.brackets.begin.flow + 3: punctuation.section.brackets.end.flow pop: true From ef547214915e94e785a29360ee799d783e0bae25 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Thu, 4 Jan 2018 22:02:55 -0200 Subject: [PATCH 401/407] [FLOW] Rename template to generic --- syntaxes/flow1/function.no-pop.sublime-syntax | 4 ++-- syntaxes/flow1/function.sublime-syntax | 12 ++++++------ .../arguments.no-pop.sublime-syntax | 2 +- .../{template => generic}/arguments.sublime-syntax | 0 .../parameters.no-pop.sublime-syntax | 2 +- .../{template => generic}/parameters.sublime-syntax | 0 syntaxes/flow1/interface.sublime-syntax | 8 ++++---- syntaxes/flow1/type-aliasing.sublime-syntax | 6 +++--- syntaxes/flow1/type-expression.sublime-syntax | 4 ++-- 9 files changed, 19 insertions(+), 19 deletions(-) rename syntaxes/flow1/{template => generic}/arguments.no-pop.sublime-syntax (89%) rename syntaxes/flow1/{template => generic}/arguments.sublime-syntax (100%) rename syntaxes/flow1/{template => generic}/parameters.no-pop.sublime-syntax (89%) rename syntaxes/flow1/{template => generic}/parameters.sublime-syntax (100%) diff --git a/syntaxes/flow1/function.no-pop.sublime-syntax b/syntaxes/flow1/function.no-pop.sublime-syntax index 9f2a34fd..32b0fbcc 100644 --- a/syntaxes/flow1/function.no-pop.sublime-syntax +++ b/syntaxes/flow1/function.no-pop.sublime-syntax @@ -18,7 +18,7 @@ hidden: true scope: ... variables: - templateArguments: | + genericArguments: | (< [^<>]* \g<-1>? @@ -49,7 +49,7 @@ contexts: - match: | (?xi) (?=\s* - {{templateArguments}}? + {{genericArguments}}? {{flowFunction}} ) push: declaration diff --git a/syntaxes/flow1/function.sublime-syntax b/syntaxes/flow1/function.sublime-syntax index 169144e2..1c296405 100644 --- a/syntaxes/flow1/function.sublime-syntax +++ b/syntaxes/flow1/function.sublime-syntax @@ -18,7 +18,7 @@ hidden: true scope: ... variables: - templateArguments: | + genericArguments: | (< [^<>]* \g<-1>? @@ -49,15 +49,15 @@ contexts: - match: | (?xi) (?=\s* - {{templateArguments}}? + {{genericArguments}}? {{flowFunction}} ) set: declaration declaration: - # Template parameters. + # Generic parameters. - match: (?=\s*<) - push: template-arguments + push: generic-arguments # Parameters. - match: (?=\s*\() set: [ @@ -65,8 +65,8 @@ contexts: parameters ] - template-arguments: - - include: Packages/Naomi/syntaxes/flow1/template/arguments.sublime-syntax + generic-arguments: + - include: Packages/Naomi/syntaxes/flow1/generic/arguments.sublime-syntax parameters: - include: Packages/Naomi/syntaxes/flow1/function/parameters.sublime-syntax diff --git a/syntaxes/flow1/template/arguments.no-pop.sublime-syntax b/syntaxes/flow1/generic/arguments.no-pop.sublime-syntax similarity index 89% rename from syntaxes/flow1/template/arguments.no-pop.sublime-syntax rename to syntaxes/flow1/generic/arguments.no-pop.sublime-syntax index 27f7cdc8..ac51d6d2 100644 --- a/syntaxes/flow1/template/arguments.no-pop.sublime-syntax +++ b/syntaxes/flow1/generic/arguments.no-pop.sublime-syntax @@ -23,4 +23,4 @@ contexts: push: arguments arguments: - - include: Packages/Naomi/syntaxes/flow1/template/arguments.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/generic/arguments.sublime-syntax diff --git a/syntaxes/flow1/template/arguments.sublime-syntax b/syntaxes/flow1/generic/arguments.sublime-syntax similarity index 100% rename from syntaxes/flow1/template/arguments.sublime-syntax rename to syntaxes/flow1/generic/arguments.sublime-syntax diff --git a/syntaxes/flow1/template/parameters.no-pop.sublime-syntax b/syntaxes/flow1/generic/parameters.no-pop.sublime-syntax similarity index 89% rename from syntaxes/flow1/template/parameters.no-pop.sublime-syntax rename to syntaxes/flow1/generic/parameters.no-pop.sublime-syntax index 489baec6..86009db2 100644 --- a/syntaxes/flow1/template/parameters.no-pop.sublime-syntax +++ b/syntaxes/flow1/generic/parameters.no-pop.sublime-syntax @@ -23,4 +23,4 @@ contexts: push: parameters parameters: - - include: Packages/Naomi/syntaxes/flow1/template/parameters.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/generic/parameters.sublime-syntax diff --git a/syntaxes/flow1/template/parameters.sublime-syntax b/syntaxes/flow1/generic/parameters.sublime-syntax similarity index 100% rename from syntaxes/flow1/template/parameters.sublime-syntax rename to syntaxes/flow1/generic/parameters.sublime-syntax diff --git a/syntaxes/flow1/interface.sublime-syntax b/syntaxes/flow1/interface.sublime-syntax index be1a2b63..b9b23a72 100644 --- a/syntaxes/flow1/interface.sublime-syntax +++ b/syntaxes/flow1/interface.sublime-syntax @@ -36,9 +36,9 @@ contexts: captures: 1: storage.modifier.extends.flow push: optional-type-expression - # Template parameters. + # Generic parameters. - match: (?=\s*<) - push: template-parameters + push: generic-parameters # Body. - match: (?=\s*\{) set: body @@ -50,8 +50,8 @@ contexts: optional-type-expression: - include: Packages/Naomi/syntaxes/flow1/optional-type-expression.sublime-syntax - template-parameters: - - include: Packages/Naomi/syntaxes/flow1/template/parameters.sublime-syntax + generic-parameters: + - include: Packages/Naomi/syntaxes/flow1/generic/parameters.sublime-syntax body: - include: comment-no-pop diff --git a/syntaxes/flow1/type-aliasing.sublime-syntax b/syntaxes/flow1/type-aliasing.sublime-syntax index 09614a39..5cfcc112 100644 --- a/syntaxes/flow1/type-aliasing.sublime-syntax +++ b/syntaxes/flow1/type-aliasing.sublime-syntax @@ -22,7 +22,7 @@ variables: [$_[:alpha:]] [$_[:alnum:]]* - templateArguments: | + genericArguments: | (< [^<>]* \g<-1>? @@ -37,7 +37,7 @@ contexts: (type)\b (?=\s+ {{commonIdentifier}} - {{templateArguments}}? + {{genericArguments}}? ) captures: 1: storage.modifier.opaque.flow @@ -57,7 +57,7 @@ contexts: punctuation: - meta_scope: meta.declaration.type.flow - - include: Packages/Naomi/syntaxes/flow1/template/parameters.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/generic/parameters.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/flow1/associated-type.no-pop.sublime-syntax - match: \s*(=) captures: diff --git a/syntaxes/flow1/type-expression.sublime-syntax b/syntaxes/flow1/type-expression.sublime-syntax index e7ba97f3..3c96b0d3 100644 --- a/syntaxes/flow1/type-expression.sublime-syntax +++ b/syntaxes/flow1/type-expression.sublime-syntax @@ -77,7 +77,7 @@ contexts: optional-tail: - include: comment-no-pop - # Array shorthand or template arguments. + # Array shorthand or generic arguments. - match: (?=\s*[\[<]) set: [ optional-tail, tail ] # Other operators. @@ -89,4 +89,4 @@ contexts: tail: - include: comment-no-pop - include: Packages/Naomi/syntaxes/flow1/operator/array-shorthand.sublime-syntax - - include: Packages/Naomi/syntaxes/flow1/template/arguments.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/generic/arguments.sublime-syntax From e7ceaf1ac94ced3f75696f8ef767165ae1a48df4 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Thu, 4 Jan 2018 22:04:47 -0200 Subject: [PATCH 402/407] [FJSX15] Rename template to generic --- .../arrow-function.no-pop.sublime-syntax | 8 ++++---- syntaxes/fjsx15/arrow-function.sublime-syntax | 8 ++++---- syntaxes/fjsx15/class.sublime-syntax | 18 +++++++++--------- syntaxes/fjsx15/class/method.sublime-syntax | 12 ++++++------ syntaxes/fjsx15/function-call.sublime-syntax | 12 ++++++------ .../fjsx15/function-expression.sublime-syntax | 8 ++++---- syntaxes/fjsx15/function.sublime-syntax | 8 ++++---- .../function/parameter/simple.sublime-syntax | 4 ++-- syntaxes/fjsx15/jsx1.sublime-syntax | 4 ++-- .../literal/object/property.sublime-syntax | 8 ++++---- .../fjsx15/variable-declaration.sublime-syntax | 4 ++-- syntaxes/fjsx15/variable.sublime-syntax | 8 ++++---- syntaxes/fjsx15/web.sublime-syntax | 8 ++++---- 13 files changed, 55 insertions(+), 55 deletions(-) diff --git a/syntaxes/fjsx15/arrow-function.no-pop.sublime-syntax b/syntaxes/fjsx15/arrow-function.no-pop.sublime-syntax index 156d62e6..d9ac9d04 100644 --- a/syntaxes/fjsx15/arrow-function.no-pop.sublime-syntax +++ b/syntaxes/fjsx15/arrow-function.no-pop.sublime-syntax @@ -22,14 +22,14 @@ variables: [$_[:alpha:]] [$_[:alnum:]]* - templateArguments: | + genericArguments: | (< [^<>]* \g<-1>? [^<>]* >) - templateParameters: "{{templateArguments}}" + genericParameters: "{{genericArguments}}" parameters: | (\( @@ -60,7 +60,7 @@ variables: simpleFlowType: | (?> {{string}} | {{commonIdentifier}} - {{templateArguments}}? + {{genericArguments}}? ) flowFunction: | @@ -96,7 +96,7 @@ contexts: (?xi) (?= (?:\s*async)? - \s*{{templateParameters}}? + \s*{{genericParameters}}? \s*{{parameters}} \s*{{type}}? \s*=> diff --git a/syntaxes/fjsx15/arrow-function.sublime-syntax b/syntaxes/fjsx15/arrow-function.sublime-syntax index 2ce64cc4..c7c6e8d9 100644 --- a/syntaxes/fjsx15/arrow-function.sublime-syntax +++ b/syntaxes/fjsx15/arrow-function.sublime-syntax @@ -22,7 +22,7 @@ variables: [$_[:alpha:]] [$_[:alnum:]]* - templateArguments: | + genericArguments: | (< [^<>]* \g<-1>? @@ -58,7 +58,7 @@ variables: simpleFlowType: | (?> {{string}} | {{commonIdentifier}} - {{templateArguments}}? + {{genericArguments}}? ) flowFunction: | @@ -94,7 +94,7 @@ contexts: (?xi) (?= (?:\s*async)? - \s*{{templateArguments}}? + \s*{{genericArguments}}? \s*{{parameters}} \s*{{type}}? \s*=> @@ -114,7 +114,7 @@ contexts: normal-arrow-function: - meta_scope: meta.function.js.fjsx15 - include: Packages/Naomi/syntaxes/fjsx15/async.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/flow1/template/parameters.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/generic/parameters.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function/parameters.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/body.sublime-syntax diff --git a/syntaxes/fjsx15/class.sublime-syntax b/syntaxes/fjsx15/class.sublime-syntax index 6e1f570c..c55cc6df 100644 --- a/syntaxes/fjsx15/class.sublime-syntax +++ b/syntaxes/fjsx15/class.sublime-syntax @@ -34,16 +34,16 @@ contexts: # Body. - match: (?=\s*\{) set: body - # Template parameters. + # Generic parameters. - match: (?=\s*<) - push: template-parameters + push: generic-parameters # Interfaces. - match: \s*(implements)\b captures: 1: storage.modifier.js.fjsx15 push: [ optional-target-class-or-namespace, - optional-template-arguments, + optional-generic-arguments, target-class-or-namespace ] # Extensions. @@ -51,7 +51,7 @@ contexts: captures: 1: storage.modifier.extends.js.fjsx15 push: [ - optional-template-arguments, + optional-generic-arguments, target-class-or-namespace ] # Identifier. @@ -64,8 +64,8 @@ contexts: comment: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - template-parameters: - - include: Packages/Naomi/syntaxes/flow1/template/parameters.sublime-syntax + generic-parameters: + - include: Packages/Naomi/syntaxes/flow1/generic/parameters.sublime-syntax type-expression: - include: Packages/Naomi/syntaxes/flow1/type-expression.sublime-syntax @@ -73,8 +73,8 @@ contexts: body: - include: Packages/Naomi/syntaxes/fjsx15/class/body.sublime-syntax - optional-template-arguments: - - include: Packages/Naomi/syntaxes/flow1/template/arguments.sublime-syntax + optional-generic-arguments: + - include: Packages/Naomi/syntaxes/flow1/generic/arguments.sublime-syntax - match: "" pop: true @@ -83,7 +83,7 @@ contexts: scope: punctuation.definition.implement-list.separator.js.fjsx15 set: [ optional-target-class-or-namespace, - optional-template-arguments, + optional-generic-arguments, target-class-or-namespace ] - match: (?=\s*\{) diff --git a/syntaxes/fjsx15/class/method.sublime-syntax b/syntaxes/fjsx15/class/method.sublime-syntax index 8aade13d..4443a497 100644 --- a/syntaxes/fjsx15/class/method.sublime-syntax +++ b/syntaxes/fjsx15/class/method.sublime-syntax @@ -45,7 +45,7 @@ variables: | {{commonIdentifier}} ) - templateParameters: | + genericParameters: | (< [^<>]* \g<-1>? @@ -62,7 +62,7 @@ contexts: (?xi) (?= \s*{{methodIdentifier}} - \s*{{templateParameters}}? + \s*{{genericParameters}}? \s*\( ) set: declaration @@ -75,9 +75,9 @@ contexts: # Body. - match: (?=\s*\{) set: body - # Template parameters. + # Generic parameters. - match: (?=\s*<) - push: template-parameters + push: generic-parameters # Parameters. - match: (?=\s*\() push: parameters @@ -116,8 +116,8 @@ contexts: - match: (?=\s*\S) pop: true - template-parameters: - - include: Packages/Naomi/syntaxes/flow1/template/parameters.sublime-syntax + generic-parameters: + - include: Packages/Naomi/syntaxes/flow1/generic/parameters.sublime-syntax parameters: - include: Packages/Naomi/syntaxes/fjsx15/function/parameters.sublime-syntax diff --git a/syntaxes/fjsx15/function-call.sublime-syntax b/syntaxes/fjsx15/function-call.sublime-syntax index 1f63edc9..564d5410 100644 --- a/syntaxes/fjsx15/function-call.sublime-syntax +++ b/syntaxes/fjsx15/function-call.sublime-syntax @@ -22,7 +22,7 @@ variables: [$_[:alpha:]] [$_[:alnum:]]* - templateArguments: | + genericArguments: | (< [^<>]* \g<-1>? @@ -31,20 +31,20 @@ variables: contexts: main: - # Template function call. + # Generic function call. - match: | (?xi) (?= \s*\#? \s*{{commonIdentifier}} - \s*{{templateArguments}} + \s*{{genericArguments}} \s*(\?\.)? \s*\( ) set: [ meta-scope, arguments, - template-arguments, + generic-arguments, identifier, optional-modifier ] @@ -79,8 +79,8 @@ contexts: 1: variable.function.js.fjsx15 pop: true - template-arguments: - - include: Packages/Naomi/syntaxes/flow1/template/arguments.sublime-syntax + generic-arguments: + - include: Packages/Naomi/syntaxes/flow1/generic/arguments.sublime-syntax arguments: - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax diff --git a/syntaxes/fjsx15/function-expression.sublime-syntax b/syntaxes/fjsx15/function-expression.sublime-syntax index 3df1ab4a..d39bacb0 100644 --- a/syntaxes/fjsx15/function-expression.sublime-syntax +++ b/syntaxes/fjsx15/function-expression.sublime-syntax @@ -49,9 +49,9 @@ contexts: # Body. - match: (?=\s*\{) set: body - # Template parameters. + # Generic parameters. - match: (?=\s*<) - push: template-parameters + push: generic-parameters # Parameters. - match: (?=\s*\() push: parameters @@ -70,8 +70,8 @@ contexts: comment-no-pop: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - template-parameters: - - include: Packages/Naomi/syntaxes/flow1/template/parameters.sublime-syntax + generic-parameters: + - include: Packages/Naomi/syntaxes/flow1/generic/parameters.sublime-syntax parameters: - include: Packages/Naomi/syntaxes/fjsx15/function/parameters.sublime-syntax diff --git a/syntaxes/fjsx15/function.sublime-syntax b/syntaxes/fjsx15/function.sublime-syntax index 12856bb7..cc84f2cf 100644 --- a/syntaxes/fjsx15/function.sublime-syntax +++ b/syntaxes/fjsx15/function.sublime-syntax @@ -51,9 +51,9 @@ contexts: # Body. - match: (?=\s*\{) set: body - # Template parameters. + # Generic parameters. - match: (?=\s*<) - push: template-parameters + push: generic-parameters # Parameters. - match: (?=\s*\() set: [ @@ -88,8 +88,8 @@ contexts: comment-no-pop: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - template-parameters: - - include: Packages/Naomi/syntaxes/flow1/template/parameters.sublime-syntax + generic-parameters: + - include: Packages/Naomi/syntaxes/flow1/generic/parameters.sublime-syntax parameters: - include: Packages/Naomi/syntaxes/fjsx15/function/parameters.sublime-syntax diff --git a/syntaxes/fjsx15/function/parameter/simple.sublime-syntax b/syntaxes/fjsx15/function/parameter/simple.sublime-syntax index 8fb25271..90d4ac4f 100644 --- a/syntaxes/fjsx15/function/parameter/simple.sublime-syntax +++ b/syntaxes/fjsx15/function/parameter/simple.sublime-syntax @@ -21,7 +21,7 @@ variables: commonIdentifier: | [$_[:alpha:]] [$_[:alnum:]]* - templateArguments: | + genericArguments: | (< [^<>]* \g<-1>? @@ -57,7 +57,7 @@ variables: simpleFlowType: | (?> {{string}} | {{commonIdentifier}} - {{templateArguments}}? + {{genericArguments}}? ) flowFunction: | diff --git a/syntaxes/fjsx15/jsx1.sublime-syntax b/syntaxes/fjsx15/jsx1.sublime-syntax index 09cf8483..9e7f40f2 100644 --- a/syntaxes/fjsx15/jsx1.sublime-syntax +++ b/syntaxes/fjsx15/jsx1.sublime-syntax @@ -41,7 +41,7 @@ contexts: # Embedded javascript. - match: \s*(\{) captures: - 1: punctuation.definition.template-expression.begin.jsx.jsx1 + 1: punctuation.definition.generic-expression.begin.jsx.jsx1 push: [ embedded-js-close, optional-expression @@ -53,7 +53,7 @@ contexts: - meta_scope: source.js.fjsx15 - match: \s*(}) captures: - 1: punctuation.definition.template-expression.end.jsx.jsx1 + 1: punctuation.definition.generic-expression.end.jsx.jsx1 pop: true optional-expression: diff --git a/syntaxes/fjsx15/literal/object/property.sublime-syntax b/syntaxes/fjsx15/literal/object/property.sublime-syntax index a2456bd8..852ad624 100644 --- a/syntaxes/fjsx15/literal/object/property.sublime-syntax +++ b/syntaxes/fjsx15/literal/object/property.sublime-syntax @@ -41,14 +41,14 @@ variables: | {{commonIdentifier}} ) - templateArguments: | + genericArguments: | (< [^<>]* \g<-1>? [^<>]* >) - templateParameters: "{{templateArguments}}" + genericParameters: "{{genericArguments}}" parameters: | (\( @@ -79,7 +79,7 @@ variables: simpleFlowType: | (?> {{string}} | {{commonIdentifier}} - {{templateArguments}}? + {{genericArguments}}? ) flowFunction: | @@ -146,7 +146,7 @@ contexts: \s*{{commonIdentifier}} \s*: (?:\s*async\b)? - \s*{{templateParameters}}? + \s*{{genericParameters}}? \s*{{parameters}} \s*=> ) diff --git a/syntaxes/fjsx15/variable-declaration.sublime-syntax b/syntaxes/fjsx15/variable-declaration.sublime-syntax index 1cdbc44f..162eabd2 100644 --- a/syntaxes/fjsx15/variable-declaration.sublime-syntax +++ b/syntaxes/fjsx15/variable-declaration.sublime-syntax @@ -26,7 +26,7 @@ variables: [$_[:upper:]] [$_[:upper:][:digit:]]* - templateArguments: | + genericArguments: | (< [^<>]* \g<-1>? @@ -62,7 +62,7 @@ variables: simpleFlowType: | (?> {{string}} | {{commonIdentifier}} - {{templateArguments}}? + {{genericArguments}}? ) flowFunction: | diff --git a/syntaxes/fjsx15/variable.sublime-syntax b/syntaxes/fjsx15/variable.sublime-syntax index 4f21b988..ef572181 100644 --- a/syntaxes/fjsx15/variable.sublime-syntax +++ b/syntaxes/fjsx15/variable.sublime-syntax @@ -22,7 +22,7 @@ variables: [$_[:alpha:]] [$_[:alnum:]]* - templateArguments: | + genericArguments: | (< [^<>]* \g<-1>? @@ -58,7 +58,7 @@ variables: simpleFlowType: | (?> {{string}} | {{commonIdentifier}} - {{templateArguments}}? + {{genericArguments}}? ) flowFunction: | @@ -101,7 +101,7 @@ contexts: \s*{{type}}? \s*= \s*(?:async\b)? - \s*{{templateArguments}}? + \s*{{genericArguments}}? \s*{{parameters}} \s*{{type}}? \s*=> @@ -174,7 +174,7 @@ contexts: normal-arrow-function: - meta_scope: meta.function.declaration.js.fjsx15 - include: Packages/Naomi/syntaxes/fjsx15/async.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/flow1/template/parameters.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/generic/parameters.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function/parameters.no-pop.sublime-syntax - match: (?=\s*=>) set: arrow-body diff --git a/syntaxes/fjsx15/web.sublime-syntax b/syntaxes/fjsx15/web.sublime-syntax index b4424ab6..fc3e66c6 100644 --- a/syntaxes/fjsx15/web.sublime-syntax +++ b/syntaxes/fjsx15/web.sublime-syntax @@ -23,8 +23,8 @@ contexts: - include: document-properties - include: window-functions - optional-template-and-arguments: - - include: Packages/Naomi/syntaxes/flow1/template/arguments.no-pop.sublime-syntax + optional-generic-and-arguments: + - include: Packages/Naomi/syntaxes/flow1/generic/arguments.no-pop.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax - match: (?=\s*\S) pop: true @@ -81,7 +81,7 @@ contexts: 1: support.type.object.dom.js.fjsx15 2: punctuation.accessor.js.fjsx15 3: support.function.js.fjsx15 - set: optional-template-and-arguments + set: optional-generic-and-arguments document-properties: - match: | @@ -245,4 +245,4 @@ contexts: 1: support.type.object.dom.js.fjsx15 2: punctuation.accessor.js.fjsx15 3: support.function.js.fjsx15 - set: optional-template-and-arguments + set: optional-generic-and-arguments From 3e44a66f3c2d6140deca132f874396c8c2d7b200 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Thu, 4 Jan 2018 22:06:52 -0200 Subject: [PATCH 403/407] [FLOW] Fix generic parameters in flow functions --- syntaxes/flow1/function.sublime-syntax | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/syntaxes/flow1/function.sublime-syntax b/syntaxes/flow1/function.sublime-syntax index 1c296405..5a532b90 100644 --- a/syntaxes/flow1/function.sublime-syntax +++ b/syntaxes/flow1/function.sublime-syntax @@ -57,7 +57,7 @@ contexts: declaration: # Generic parameters. - match: (?=\s*<) - push: generic-arguments + push: generic-parameters # Parameters. - match: (?=\s*\() set: [ @@ -65,8 +65,8 @@ contexts: parameters ] - generic-arguments: - - include: Packages/Naomi/syntaxes/flow1/generic/arguments.sublime-syntax + generic-parameters: + - include: Packages/Naomi/syntaxes/flow1/generic/parameters.sublime-syntax parameters: - include: Packages/Naomi/syntaxes/flow1/function/parameters.sublime-syntax From 8b2a78ce8145f28b3335f745f241941ef87c386d Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Fri, 5 Jan 2018 11:07:02 -0200 Subject: [PATCH 404/407] [FJSX15] Expand import scopes --- syntaxes/fjsx15/import.sublime-syntax | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/syntaxes/fjsx15/import.sublime-syntax b/syntaxes/fjsx15/import.sublime-syntax index bbb6b28f..620d4f49 100644 --- a/syntaxes/fjsx15/import.sublime-syntax +++ b/syntaxes/fjsx15/import.sublime-syntax @@ -31,7 +31,7 @@ contexts: (import)\b (?=\s*\() captures: - 1: support.function.js.fjsx15 + 1: support.function.import.js.fjsx15 set: [ function-call-meta-scope, arguments @@ -42,14 +42,14 @@ contexts: (import)\b (?=\s*(?>"|'|`)) captures: - 1: keyword.control.import-export.js.fjsx15 + 1: keyword.control.import-export.import.js.fjsx15 set: origin-path # Other. - match: | (?x) \s*(import)\b captures: - 1: keyword.control.import-export.js.fjsx15 + 1: keyword.control.import-export.import.js.fjsx15 set: [ delimiter, optional-target From 3ab065a879fcbeddb59f6866d9003ce4a510565c Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Fri, 5 Jan 2018 11:52:46 -0200 Subject: [PATCH 405/407] [FJSX15] Simplify exports and normalize scopes --- syntaxes/fjsx15/export.sublime-syntax | 262 +++++----------------- syntaxes/flow1/type-export.sublime-syntax | 93 ++++++++ 2 files changed, 147 insertions(+), 208 deletions(-) create mode 100644 syntaxes/flow1/type-export.sublime-syntax diff --git a/syntaxes/fjsx15/export.sublime-syntax b/syntaxes/fjsx15/export.sublime-syntax index b9214bd1..7e336051 100644 --- a/syntaxes/fjsx15/export.sublime-syntax +++ b/syntaxes/fjsx15/export.sublime-syntax @@ -22,218 +22,84 @@ variables: [$_[:alpha:]] [$_[:alnum:]]* - keywords: | - (?> await - | break - | case - | catch - | class - | const - | continue - | debugger - | delete - | do - | else - | enum - | export - | extends - | finally - | for - | function - | if - | imp(?>lements|ort) - | in(?:stanceof)? - | interface - | let - | new - | package - | private - | protected - | public - | return - | static - | super - | switch - | this - | throw - | try - | typeof - | var - | void - | while - | with - | yield - ) - contexts: main: - # Export multiple types. - - match: | - (?x) - \s*(export) - (?:\s*(opaque))? - \s*(type) - \s*({) - captures: - 1: keyword.control.import-export.js.fjsx15 - 2: >- - flow - storage.modifier.flow - 3: >- - flow - storage.type.flow - 4: punctuation.definition.export.list.begin.js.fjsx15 - set: types - # Export object literal. - - match: | - (?x) - \s*(export) - \s*(default) - (?=\s*{) - captures: - 1: keyword.control.import-export.js.fjsx15 - 2: >- - storage.modifier.js.fjsx15 - keyword.control.export.default.js.fjsx15 - set: object-literal - # Export default from. - - match: | - (?x) - \s*(export) - \s*(default) - (?=\s*from) - captures: - 1: keyword.control.import-export.js.fjsx15 - 2: >- - storage.modifier.js.fjsx15 - keyword.control.import-export.default.js.fjsx15 - set: origin - # Export statements. - - match: | - (?x) - \s*(export) - (?= - (?:\s*opaque)? - \s*(?> async - | class - | const - | function - | interface - | let - | type - | var - ) - ) - captures: - 1: keyword.control.import-export.js.fjsx15 - # set: statement-and-expression - # Export default. - - match: | - (?x) - \s*(export) - \s*(default) - captures: - 1: keyword.control.import-export.js.fjsx15 - 2: >- - storage.modifier.js.fjsx15 - keyword.control.import-export.default.js.fjsx15 - # set: statement-and-expression - # Other. - - match: | - (?x) - \s*(export)\b - (?!\s*\.) + - match: \s*(export) captures: - 1: keyword.control.import-export.js.fjsx15 - set: targets + 1: keyword.control.import-export.export.js.fjsx15 + set: possible-statements-and-expressions - comment: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - - # statement-and-expression: - # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax - - object-literal: - - include: Packages/Naomi/syntaxes/fjsx15/literal/object.sublime-syntax - - origin: - - match: \s*(from)\b + possible-statements-and-expressions: + - match: (?=\s*(?>[*{]|type(?:of)?)) + set: [ delimiter, optional-target ] + # Default statements and expressions. + - match: \s*(default) captures: - 1: keyword.control.export.origin.js.fjsx15 - set: origin-path - - origin-path: - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/template.sublime-syntax + 1: keyword.control.import-export.default.js.fjsx15 + set: statements-and-expressions + # Other statements. + - include: Packages/Naomi/syntaxes/fjsx15/statement.sublime-syntax - export-list-begin: - - match: \s*(\{) - captures: - 1: punctuation.definition.export.list.begin.js.fjsx15 - set: export-list + statements-and-expressions: + - include: Packages/Naomi/syntaxes/fjsx15/statement.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax - export-list: - - match: \s*(}) - captures: - 1: punctuation.definition.export.list.end.js.fjsx15 - set: comma-origin-escape - - match: "" - push: - - include: targets - - match: "" - pop: true + origin: + - include: Packages/Naomi/syntaxes/fjsx15/import.sublime-syntax#origin - comma: - - match: \s*(,) - captures: - 1: punctuation.definition.export.item.js.fjsx15 + close-block: + - include: Packages/Naomi/syntaxes/fjsx15/import.sublime-syntax#close-block - targets: - - include: comment - - include: origin - - include: export-list-begin - - include: comma - - include: alias - # Default. - - match: \s*(default)\b - captures: - 1: >- - storage.modifier.js.fjsx15 - keyword.control.export.default.js.fjsx15 + optional-target: + - match: (?=\s*(?>[,}]|from)) + pop: true + # Type. + - include: Packages/Naomi/syntaxes/flow1/type-export.sublime-syntax # All. - match: \s*(\*) captures: - 1: keyword.operator.other.export.all.js.fjsx15 + 1: keyword.control.import-export.star.js.fjsx15 + pop: true + # Multiple targets. + - match: \s*(\{) + captures: + 1: punctuation.section.block.begin.js.fjsx15 + set: [ + close-block, + delimiter, + optional-target + ] + # Aliased. + - match: | + (?xi)\s* + ({{commonIdentifier}}) + (?=\s+as) + captures: + 1: variable.other.readwrite.js.fjsx15 + set: alias # Simple. - match: | (?xi)\s* - (?!{{keywords}}) ({{commonIdentifier}}) captures: - 1: >- - export.js.fjsx15 - entity.name.ambiguous.js.fjsx15 - set: alias-comma-origin-escape - - match: (?=\s*\S) - pop: true - - comma-origin-escape: - - match: (?=\s*(?>,|from)) - set: targets - - match: (?=\s*\S) + 1: variable.other.readwrite.js.fjsx15 pop: true - alias-comma-origin-escape: - - match: (?=\s*(?>,|as|from)) - set: targets + delimiter: + - match: \s*(,) + captures: + 1: punctuation.separator.comma.js.fjsx15 + push: optional-target + # From. + - include: origin + # Anything else. - match: (?=\s*\S) pop: true alias: - match: \s*(as)\b captures: - 1: keyword.other.alias.js.fjsx15 + 1: keyword.control.import-export.as.js.fjsx15 set: alias-name alias-name: @@ -241,25 +107,5 @@ contexts: (?xi)\s* ({{commonIdentifier}}) captures: - 1: entity.name.alias.js.fjsx15 - pop: true - - types: - - match: \s*(,) - captures: - 1: punctuation.definition.export.item.js.fjsx15 - - match: \s*(}) - captures: - 1: punctuation.definition.export.list.end.js.fjsx15 + 1: variable.other.readwrite.js.fjsx15 pop: true - - include: alias - - include: type - - type: - - match: | - (?xi) - (?={{commonIdentifier}}) - push: simple-type - - simple-type: - - include: Packages/Naomi/syntaxes/flow1/simple.sublime-syntax diff --git a/syntaxes/flow1/type-export.sublime-syntax b/syntaxes/flow1/type-export.sublime-syntax new file mode 100644 index 00000000..d63666f9 --- /dev/null +++ b/syntaxes/flow1/type-export.sublime-syntax @@ -0,0 +1,93 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +scope: ... + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + +contexts: + main: + - match: \s*(typeof)\b + captures: + 1: keyword.operator.word.typeof.flow + set: optional-target + - match: \s*(type)\b + captures: + 1: storage.type.flow + set: optional-target + + optional-target: + - match: (?=\s*(?>[,}]|from)) + pop: true + # Multiple targets. + - match: \s*(\{) + captures: + 1: punctuation.section.block.begin.js.fjsx15 + set: [ + close-block, + delimiter, + optional-target + ] + # Aliased. + - match: | + (?xi)\s* + ({{commonIdentifier}}) + (?=\s+as) + captures: + 1: variable.other.type.js.fjsx15 + set: alias + # Simple. + - match: | + (?xi)\s* + ({{commonIdentifier}}) + captures: + 1: variable.other.type.js.fjsx15 + pop: true + + delimiter: + - match: \s*(,) + captures: + 1: punctuation.separator.comma.js.fjsx15 + push: optional-target + # From. + - include: origin + # Anything else. + - match: (?=\s*\S) + pop: true + + origin: + - include: Packages/Naomi/syntaxes/fjsx15/import.sublime-syntax#origin + + close-block: + - include: Packages/Naomi/syntaxes/fjsx15/import.sublime-syntax#close-block + + alias: + - match: \s*(as)\b + captures: + 1: keyword.control.import-export.as.js.fjsx15 + set: alias-name + + alias-name: + - match: | + (?xi)\s* + ({{commonIdentifier}}) + captures: + 1: variable.other.type.js.fjsx15 + pop: true From 51d28eada9157d608327db26174df73c8f673375 Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Fri, 5 Jan 2018 11:53:27 -0200 Subject: [PATCH 406/407] [FJSX15] Add typeof to flow imports --- syntaxes/flow1/type-import.sublime-syntax | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/syntaxes/flow1/type-import.sublime-syntax b/syntaxes/flow1/type-import.sublime-syntax index db5f143c..48e631cf 100644 --- a/syntaxes/flow1/type-import.sublime-syntax +++ b/syntaxes/flow1/type-import.sublime-syntax @@ -24,6 +24,10 @@ variables: contexts: main: + - match: \s*(typeof)\b + captures: + 1: keyword.operator.word.typeof.flow + set: optional-target - match: \s*(type)\b captures: 1: storage.type.flow From 3e3a35d705dcc42f8b443bde5eb008b0152d924c Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Fri, 5 Jan 2018 11:53:46 -0200 Subject: [PATCH 407/407] Rebalance candyman colors --- Candyman.tmTheme | 8 ++++---- schemes/candyman/_keyword.scss | 6 +++--- schemes/candyman/_type.scss | 1 + 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Candyman.tmTheme b/Candyman.tmTheme index 766556c9..e0474a79 100644 --- a/Candyman.tmTheme +++ b/Candyman.tmTheme @@ -1395,7 +1395,7 @@ settings foreground - #ff7997 + #f48fb1 @@ -1450,7 +1450,7 @@ fontStyle foreground - #72d572 + #f48fb1 @@ -1512,7 +1512,7 @@ fontStyle italic foreground - #ff7997 + #84ffff @@ -1749,7 +1749,7 @@ scope - .entity.name.type, .variable.type, .variable.other.type + .entity.name.interface, .entity.name.type, .variable.type, .variable.other.type settings foreground diff --git a/schemes/candyman/_keyword.scss b/schemes/candyman/_keyword.scss index e5d806bd..9833759c 100644 --- a/schemes/candyman/_keyword.scss +++ b/schemes/candyman/_keyword.scss @@ -11,7 +11,7 @@ // the License. .keyword { - foreground: $red-a100; + foreground: $pink-200; &.control { &.conditional { @@ -35,7 +35,7 @@ } &.import-export { - foreground: $green-200; + foreground: $pink-200; fontStyle: none; &.as, @@ -66,7 +66,7 @@ } &.word { - foreground: $red-a100; + foreground: $cyan-a100; fontStyle: italic; &.of { diff --git a/schemes/candyman/_type.scss b/schemes/candyman/_type.scss index 93e5d6cb..25762d64 100644 --- a/schemes/candyman/_type.scss +++ b/schemes/candyman/_type.scss @@ -10,6 +10,7 @@ // License for the specific language governing permissions and limitations under // the License. +.entity.name.interface, .entity.name.type, .variable.type, .variable.other.type {