diff --git a/PowerShell.sublime-syntax b/PowerShell.sublime-syntax index 40149c4..053ea20 100644 --- a/PowerShell.sublime-syntax +++ b/PowerShell.sublime-syntax @@ -340,12 +340,20 @@ contexts: inside-unquoted-string: - meta_include_prototype: false - meta_scope: string.unquoted.powershell - - match: (?=[\s#|>;,]|$) + - match: $|(?=[\s#|>;,()}]) pop: 1 + - match: \{ + push: inside-unquoted-string-brace - include: path-punctuation - include: escape-sequences - include: string-wildcards + inside-unquoted-string-brace: + - meta_include_prototype: false + - match: \} + pop: 1 + - include: inside-unquoted-string + pop-end-of-command: - include: line-continuations - include: pop-eol diff --git a/tests/syntax_test_PowerShell.ps1 b/tests/syntax_test_PowerShell.ps1 index 41ed626..d8721da 100644 --- a/tests/syntax_test_PowerShell.ps1 +++ b/tests/syntax_test_PowerShell.ps1 @@ -1873,6 +1873,75 @@ $a3[1..2] # ^ punctuation.definition.parameter.powershell # ^^^^^^^^^^^^^^ string.unquoted.powershell - keyword + New-Object -TypeName System(Component) +# ^^^^^^^^^^ meta.function-call.powershell support.function.powershell +# @@@@@@@@@@ reference +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function-call.arguments.powershell +# ^^^^^^^^^ variable.parameter.option.powershell +# ^ punctuation.definition.parameter.powershell +# ^^^^^^ string.unquoted.powershell +# ^^^^^^^^^^^ - string +# @@@@@@@@@ reference + + New-Object -TypeName System.Component) +# ^^^^^^^^^^ meta.function-call.powershell support.function.powershell +# @@@@@@@@@@ reference +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function-call.arguments.powershell +# ^^^^^^^^^ variable.parameter.option.powershell +# ^ punctuation.definition.parameter.powershell +# ^^^^^^^^^^^^^^^^ string.unquoted.powershell +# ^ - meta.function-call - string + + (New-Object -TypeName SystemComponent).run() +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.group.powershell +# ^ punctuation.section.group.begin.powershell +# ^^^^^^^^^^ meta.function-call.powershell support.function.powershell +# @@@@@@@@@@ reference +# ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function-call.arguments.powershell +# ^^^^^^^^^ variable.parameter.option.powershell +# ^ punctuation.definition.parameter.powershell +# ^^^^^^^^^^^^^^^ string.unquoted.powershell +# ^ punctuation.section.group.end.powershell +# ^ punctuation.accessor.dot.powershell +# ^^^ meta.function-call.powershell variable.function.powershell +# @@@ reference +# ^^ meta.function-call.arguments.powershell +# ^ punctuation.section.arguments.begin.powershell +# ^ punctuation.section.arguments.end.powershell + + New-Object -TypeName System[Component] +# ^^^^^^^^^^ meta.function-call.powershell support.function.powershell +# @@@@@@@@@@ reference +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function-call.arguments.powershell +# ^^^^^^^^^ variable.parameter.option.powershell +# ^ punctuation.definition.parameter.powershell +# ^^^^^^^^^^^^^^^^^ string.unquoted.powershell + + New-Object -TypeName System.Component] +# ^^^^^^^^^^ meta.function-call.powershell support.function.powershell +# @@@@@@@@@@ reference +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function-call.arguments.powershell +# ^^^^^^^^^ variable.parameter.option.powershell +# ^ punctuation.definition.parameter.powershell +# ^^^^^^^^^^^^^^^^^ string.unquoted.powershell + + New-Object -TypeName System{Compon{ent}} +# ^^^^^^^^^^ meta.function-call.powershell support.function.powershell +# @@@@@@@@@@ reference +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function-call.arguments.powershell +# ^^^^^^^^^ variable.parameter.option.powershell +# ^ punctuation.definition.parameter.powershell +# ^^^^^^^^^^^^^^^^^^^ string.unquoted.powershell + + New-Object -TypeName System.Component} +# ^^^^^^^^^^ meta.function-call.powershell support.function.powershell +# @@@@@@@@@@ reference +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function-call.arguments.powershell +# ^^^^^^^^^ variable.parameter.option.powershell +# ^ punctuation.definition.parameter.powershell +# ^^^^^^^^^^^^^^^^ string.unquoted.powershell +# ^^ - meta.function-call - string + echo `"test`" # ^^^^ meta.function-call.powershell variable.function.powershell # @@@@ reference