diff --git a/D/D.sublime-syntax b/D/D.sublime-syntax index 49fb20387b..7cb8c7ec6d 100644 --- a/D/D.sublime-syntax +++ b/D/D.sublime-syntax @@ -1718,6 +1718,7 @@ contexts: - match: '}' scope: punctuation.section.block.end.d pop: true + - include: attribute-in - match: '(?=\b({{name}})\b)' push: enum-member - include: not-whitespace-illegal diff --git a/D/tests/syntax_test_d.d b/D/tests/syntax_test_d.d index 184de94615..036f146c6e 100644 --- a/D/tests/syntax_test_d.d +++ b/D/tests/syntax_test_d.d @@ -941,6 +941,43 @@ extern(1) 1 //^ meta.enum.d invalid.illegal.d } + enum Boo { +//^^^^^^^^^^^ meta.enum.d +//^^^^ keyword.declaration.enum.d +// ^^^ entity.name.enum.d +// ^ punctuation.section.block.begin.d + deprecated foo, + //^^^^^^^^^^^^^^^^ meta.enum.d + //^^^^^^^^^^ keyword.other.deprecated.d + // ^^^ entity.name.constant.d + // ^ punctuation.separator.sequence.d + @Test bar = 2, + //^^^^^^^^^^^^^^^ meta.enum.d + //^ punctuation.definition.annotation.begin.d + // ^^^^ meta.path.d storage.type.d + // ^^^ entity.name.constant.d + // ^ keyword.operator.assignment.d + // ^ meta.number.integer.decimal.d + // ^ punctuation.separator.sequence.d + deprecated( "Oops!" ) boo, + //^^^^^^^^^^^^^^^^^^^^^^^^^ meta.enum.d + //^^^^^^^^^^ keyword.other.deprecated.d + // ^ punctuation.section.parens.begin.d + // ^^^^^^^ string.quoted.double.d + // ^ punctuation.section.parens.end.d + // ^^^ entity.name.constant.d + // ^ punctuation.separator.sequence.d + @("Test") par = 2, + //^^^^^^^^^^^^^^^^^^^ meta.enum.d + //^ punctuation.definition.annotation.begin.d + // ^ punctuation.section.parens.begin.d + // ^^^^^^ string.quoted.double.d + // ^ punctuation.section.parens.end.d + // ^^^ entity.name.constant.d + // ^ keyword.operator.assignment.d + // ^ meta.number.integer.decimal.d + // ^ punctuation.separator.sequence.d + } //^ meta.enum.d punctuation.section.block.end.d enum Foo : int { a = 12 } //^^^^^^^^^^^^^^^^^^^^^^^^^ meta.enum.d