diff --git a/D/D.sublime-syntax b/D/D.sublime-syntax index 3afd80f95d..49fb20387b 100644 --- a/D/D.sublime-syntax +++ b/D/D.sublime-syntax @@ -665,7 +665,7 @@ contexts: captures: 1: meta.path.d storage.type.d 2: punctuation.section.parens.begin.d - set: [meta-function-call, uda-after, value-list] + set: [meta-function-call, uda-after, argument-list] - match: '({{name}})\b' scope: meta.path.d storage.type.d set: value-after @@ -1284,7 +1284,7 @@ contexts: - meta_scope: meta.function-call.d - match: '\(' scope: punctuation.section.parens.begin.d - set: [meta-function-call, value-parens-after, value-list] + set: [meta-function-call, value-parens-after, argument-list] - match: (?=\S) set: value-after new-anonymous-after-args: @@ -1401,7 +1401,7 @@ contexts: set: [value-after, value-identifier] - match: '\(' scope: punctuation.section.parens.begin.d - set: [meta-function-call, value-parens-after, value-list] + set: [meta-function-call, value-parens-after, argument-list] - match: '\[' scope: punctuation.section.brackets.begin.d set: [value-bracket-after, value-list] @@ -1497,6 +1497,24 @@ contexts: set: value-after - include: not-whitespace-illegal-pop + argument-list: + - match: '(?=\)|}|]|;|:)' + pop: true + - match: '({{name}})\s*(:)' + captures: + 1: variable.parameter.d + 2: keyword.operator.assignment.d + set: [argument-list-after, value] + - match: '(?=\S)' + set: [argument-list-after, value] + argument-list-after: + - match: '(?=\)|}|]|;|:)' + pop: true + - match: ',' + scope: punctuation.separator.sequence.d + set: argument-list + - include: not-whitespace-illegal-pop + value-list: - match: '(?=\)|}|]|;|:)' pop: true diff --git a/D/tests/syntax_test_d.d b/D/tests/syntax_test_d.d index b49098a360..184de94615 100644 --- a/D/tests/syntax_test_d.d +++ b/D/tests/syntax_test_d.d @@ -3282,3 +3282,15 @@ extern(1) // ^ keyword.operator.assignment.d // ^^^^ constant.language.d // ^ punctuation.terminator.d + + myFn(x: 10, y: 20); +// ^^^^^^^^^^^^^^^^^^ meta.function-call.d +// ^ punctuation.section.parens.begin.d +// ^ variable.parameter.d +// ^ keyword.operator.assignment.d +// ^^ constant.numeric.value.d +// ^ punctuation.separator.sequence.d +// ^ variable.parameter.d +// ^ keyword.operator.assignment.d +// ^^ constant.numeric.value.d +// ^ punctuation.section.parens.end.d