Skip to content

Commit

Permalink
[D] Fix mixin() arguments lists (#3402)
Browse files Browse the repository at this point in the history
Fixes #3390
  • Loading branch information
deathaxe authored May 29, 2022
1 parent 785993a commit e9dbab9
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
4 changes: 2 additions & 2 deletions D/D.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ contexts:
set:
- match: '\('
scope: punctuation.section.parens.begin.d
set: [basic-type2, basic-type2-after-parens, value]
set: [basic-type2, basic-type2-after-parens, value-list]
- match: '{{name_lookahead}}'
set: [basic-type2, type-identifier-ref]
- match: '(?=\S)'
Expand Down Expand Up @@ -1052,7 +1052,7 @@ contexts:
captures:
1: keyword.control.d
2: punctuation.section.parens.begin.d
set: [first-value-parens-after, value]
set: [first-value-parens-after, value-list]
# Match a regular function call so we properly highlight the name as a
# function
- match: '(?=[[:alpha:]0-9_\.]+\s*\()'
Expand Down
29 changes: 29 additions & 0 deletions D/tests/syntax_test_d.d
Original file line number Diff line number Diff line change
Expand Up @@ -1810,6 +1810,35 @@ extern(1)
// ^ meta.function.d meta.block.d punctuation.section.block.begin.d
// ^ meta.function.d meta.block.d punctuation.section.block.end.d
mixin("alias A", "= B;") foo() {};
//^^^^^ keyword.control.d
// ^ punctuation.section.parens.begin.d
// ^^^^^^^^^ meta.string.d string.quoted.double.d
// ^ punctuation.separator.sequence.d
// ^^^^^^ meta.string.d string.quoted.double.d
// ^ punctuation.section.parens.end.d
// ^^^ meta.function.d entity.name.function.d
// ^ meta.function.parameters.d punctuation.section.group.begin.d
// ^ meta.function.parameters.d punctuation.section.group.end.d
// ^ meta.function.d meta.block.d punctuation.section.block.begin.d
// ^ meta.function.d meta.block.d punctuation.section.block.end.d
// ^ punctuation.terminator.d
function mixin("alias A", "= B;") () {};
//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.d
// ^^ meta.function.parameters.d
// ^^ meta.function.d meta.block.d
// ^^^^^ keyword.control.d
// ^ punctuation.section.parens.begin.d
// ^^^^^^^^^ meta.string.d string.quoted.double.d
// ^ punctuation.separator.sequence.d
// ^^^^^^ meta.string.d string.quoted.double.d
// ^ punctuation.section.parens.end.d
// ^ punctuation.section.group.begin.d
// ^ punctuation.section.group.end.d
// ^ punctuation.section.block.begin.d
// ^ punctuation.section.block.end.d
// ^ punctuation.terminator.d
foo:
//^^^ entity.name.label.d
Expand Down

0 comments on commit e9dbab9

Please sign in to comment.