Skip to content

Commit

Permalink
[Java] Rename ternary operator scopes
Browse files Browse the repository at this point in the history
  • Loading branch information
deathaxe committed Apr 8, 2021
1 parent 3061eff commit b469b7c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
6 changes: 3 additions & 3 deletions Java/Java.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -1701,7 +1701,7 @@ contexts:

ternary-initializers:
- match: \?
scope: keyword.operator.ternary.java
scope: keyword.operator.conditional.ternary.java
push: ternary-initializer-body

ternary-initializer-body:
Expand Down Expand Up @@ -2356,7 +2356,7 @@ contexts:
- match: '[~|&\^]'
scope: keyword.operator.bitwise.java
- match: '\?'
scope: keyword.operator.ternary.java
scope: keyword.operator.conditional.ternary.java
push: ternary-expression
# https://docs.oracle.com/javase/specs/jls/se13/html/jls-15.html#jls-15.20.2
- match: instanceof{{break}}
Expand All @@ -2367,7 +2367,7 @@ contexts:

operator-ternary-colon:
- match: ':'
scope: keyword.operator.ternary.java
scope: keyword.operator.conditional.ternary.java
pop: 1

ternary-expression:
Expand Down
44 changes: 22 additions & 22 deletions Java/tests/syntax_test_java.java
Original file line number Diff line number Diff line change
Expand Up @@ -2916,13 +2916,13 @@ class FieldDeclarationTests {
// ^^ storage.modifier.array.java
// ^ keyword.operator.assignment.java
// ^^^^^^^^^ variable.other.java
// ^ keyword.operator.ternary.java
// ^ keyword.operator.conditional.ternary.java
// ^ punctuation.section.braces.begin.java
// ^ meta.number.integer.decimal.java constant.numeric.value.java
// ^ punctuation.separator.comma.java
// ^ meta.number.integer.decimal.java constant.numeric.value.java
// ^ punctuation.section.braces.end.java
// ^ keyword.operator.ternary.java
// ^ keyword.operator.conditional.ternary.java
// ^ punctuation.section.braces.begin.java
// ^ meta.number.integer.decimal.java constant.numeric.value.java
// ^ punctuation.separator.comma.java
Expand All @@ -2942,23 +2942,23 @@ class FieldDeclarationTests {
// ^^ storage.modifier.array.java
// ^ keyword.operator.assignment.java
// ^^^^^^^^^ variable.other.java
// ^ keyword.operator.ternary.java
// ^ keyword.operator.conditional.ternary.java
// ^^^ variable.function.java
// ^ punctuation.section.group.begin.java
// ^ punctuation.section.group.end.java
// ^ keyword.operator.ternary.java
// ^ keyword.operator.conditional.ternary.java
// ^ punctuation.section.braces.begin.java
// ^ meta.number.integer.decimal.java constant.numeric.value.java
// ^ punctuation.separator.comma.java
// ^ meta.number.integer.decimal.java constant.numeric.value.java
// ^ punctuation.section.braces.end.java
// ^ keyword.operator.ternary.java
// ^ keyword.operator.conditional.ternary.java
// ^ punctuation.section.braces.begin.java
// ^ meta.number.integer.decimal.java constant.numeric.value.java
// ^ punctuation.separator.comma.java
// ^ meta.number.integer.decimal.java constant.numeric.value.java
// ^ punctuation.section.braces.end.java
// ^ keyword.operator.ternary.java
// ^ keyword.operator.conditional.ternary.java
// ^ punctuation.section.braces.begin.java
// ^ meta.number.integer.decimal.java constant.numeric.value.java
// ^ punctuation.separator.comma.java
Expand Down Expand Up @@ -5709,9 +5709,9 @@ void testClassicCaseLabels(boolean startWeek) {
// ^ - meta.statement.conditional.case
// ^^^^ keyword.control.conditional.case.java
// ^^^^^^^^^ variable.other.java
// ^ keyword.operator.ternary.java
// ^ keyword.operator.conditional.ternary.java
// ^^^^^^ constant.other.java
// ^ keyword.operator.ternary.java
// ^ keyword.operator.conditional.ternary.java
// ^^^^^^ constant.other.java
// ^ punctuation.separator.expressions.java
case SUNDAY:
Expand Down Expand Up @@ -6099,11 +6099,11 @@ void run() {
// ^^^^ variable.other.java
// ^ keyword.operator.assignment.java
// ^^^^ variable.other.java
// ^ keyword.operator.ternary.java
// ^ keyword.operator.conditional.ternary.java
// ^^^ keyword.other.storage.new.java
// ^^^ storage.type.class.java
// ^^ punctuation.definition.generic.diamond.java
// ^ keyword.operator.ternary.java
// ^ keyword.operator.conditional.ternary.java
// ^^^ keyword.other.storage.new.java
// ^^^ storage.type.class.java
// ^ punctuation.section.brackets.begin.java
Expand Down Expand Up @@ -6131,11 +6131,11 @@ void run() {
// ^^^^ variable.other.java
// ^ keyword.operator.assignment.java
// ^^^^ variable.other.java
// ^ keyword.operator.ternary.java
// ^ keyword.operator.conditional.ternary.java
// ^^^ keyword.other.storage.new.java
// ^^^ storage.type.class.java
// ^^ punctuation.definition.generic.diamond.java
// ^ keyword.operator.ternary.java
// ^ keyword.operator.conditional.ternary.java
// ^^^ keyword.other.storage.new.java
// ^^^ storage.type.class.java
// ^ punctuation.section.brackets.begin.java
Expand Down Expand Up @@ -8073,14 +8073,14 @@ void run() {
// ^^^^^^^^^^^^^^ meta.function-call.arguments.java meta.group.java
// ^ punctuation.section.group.begin.java
// ^^^^ variable.other.java
// ^ keyword.operator.ternary.java
// ^ keyword.operator.conditional.ternary.java
// ^^^^ variable.other.java
// ^ punctuation.accessor.dot.java
// ^^^^^^^^^^ variable.function.java
// ^^^^^^ storage.type.class.java
// ^^ punctuation.accessor.double-colon.java
// ^^^^ variable.function.reference.java
// ^ keyword.operator.ternary.java
// ^ keyword.operator.conditional.ternary.java
// ^^^^ variable.other.java
// ^ punctuation.section.group.end.java
// ^^ punctuation.accessor.double-colon.java
Expand Down Expand Up @@ -8668,9 +8668,9 @@ class TypeComparisonExpressionsTests {
// ^ variable.other.java
// ^^^^^^^^^^ keyword.other.storage.instanceof.java
// ^ storage.type.class.java
// ^ keyword.operator.ternary.java
// ^ keyword.operator.conditional.ternary.java
// ^^^^ constant.numeric.value.java
// ^ keyword.operator.ternary.java
// ^ keyword.operator.conditional.ternary.java
// ^^ constant.numeric.base.java
// ^^^^^^^^ constant.numeric.value.java
// ^ punctuation.terminator.java
Expand Down Expand Up @@ -9332,9 +9332,9 @@ int operatorsTests() {
// ^ punctuation.section.group.end.java
// ^ keyword.operator.comparison.java
// ^ variable.other.java
// ^ keyword.operator.ternary.java
// ^ keyword.operator.conditional.ternary.java
// ^ variable.other.java
// ^ keyword.operator.ternary.java
// ^ keyword.operator.conditional.ternary.java
// ^ variable.other.java

b=e.a(b<b)>b?b:b;
Expand All @@ -9351,9 +9351,9 @@ int operatorsTests() {
// ^ punctuation.section.group.end.java
// ^ keyword.operator.comparison.java
// ^ variable.other.java
// ^ keyword.operator.ternary.java
// ^ keyword.operator.conditional.ternary.java
// ^ variable.other.java
// ^ keyword.operator.ternary.java
// ^ keyword.operator.conditional.ternary.java
// ^ variable.other.java

a[0] = true;
Expand Down Expand Up @@ -9475,9 +9475,9 @@ int operatorsTests() {

int foo = true ? 1 : 2;
// ^^^^ constant.language.boolean.true.java
// ^ keyword.operator.ternary.java
// ^ keyword.operator.conditional.ternary.java
// ^ meta.number.integer.decimal.java constant.numeric.value.java
// ^ keyword.operator.ternary.java
// ^ keyword.operator.conditional.ternary.java
// ^ meta.number.integer.decimal.java constant.numeric.value.java
// ^ punctuation.terminator.java

Expand Down

0 comments on commit b469b7c

Please sign in to comment.