From 2f29d0d4366230db9235020d278aa76f53d9091f Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Wed, 5 Oct 2016 12:14:27 -0300 Subject: [PATCH] [FJSX15] Make semicolon optional in some statements and expressions. --- syntaxes/fjsx15/expression.sublime-syntax | 3 +-- syntaxes/js15/operator/other.sublime-syntax | 24 +++++++++------------ 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/syntaxes/fjsx15/expression.sublime-syntax b/syntaxes/fjsx15/expression.sublime-syntax index 199ac1df..8194f2a9 100644 --- a/syntaxes/fjsx15/expression.sublime-syntax +++ b/syntaxes/fjsx15/expression.sublime-syntax @@ -24,8 +24,7 @@ variables: contexts: main: - - include: Packages/Naomi/syntaxes/fjsx15/class.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/interface.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/statement.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/literal/object.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/arrow-function.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/function.sublime-syntax diff --git a/syntaxes/js15/operator/other.sublime-syntax b/syntaxes/js15/operator/other.sublime-syntax index 55bccff6..d32023a4 100644 --- a/syntaxes/js15/operator/other.sublime-syntax +++ b/syntaxes/js15/operator/other.sublime-syntax @@ -47,28 +47,24 @@ contexts: pop: true - match: \? scope: operator.js.js15 - set: [ - ternary-value-b, - ternary-value-a - ] + set: ternary-condition - match: \. scope: operator.member.access.js.js15 set: member-access - ternary-value-a: - - match: ":" - scope: operator.js.js15 + ternary-condition: + - match: \s*(:) + captures: + 1: operator.js.js15 pop: true - - include: expression - - ternary-value-b: - - include: expression + - match: (?=\S) + push: + - match: (?=:) + pop: true + - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax member-access: - meta_content_scope: member.js.js15 - include: Packages/Naomi/syntaxes/fjsx15/function-call.sublime-syntax - include: Packages/Naomi/syntaxes/js15/constant.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/variable.sublime-syntax - - expression: - - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax