From e180d24b49acf8cf1f93dc498b823ddf1272b157 Mon Sep 17 00:00:00 2001 From: matteocoder <22897138+matteocoder@users.noreply.github.com> Date: Wed, 8 Jan 2025 19:28:39 +0100 Subject: [PATCH] Consume string with a trailing dot before checking for keywords This makes negative lookbehind assertions on keywords unnecessary. --- PowerShell.sublime-syntax | 52 +++++++++++++++++--------------- Tests/syntax_test_PowerShell.ps1 | 12 ++++---- 2 files changed, 34 insertions(+), 30 deletions(-) diff --git a/PowerShell.sublime-syntax b/PowerShell.sublime-syntax index 1668c59..ed6041c 100644 --- a/PowerShell.sublime-syntax +++ b/PowerShell.sublime-syntax @@ -75,73 +75,77 @@ contexts: - include: main - match: \b[\w.-]+\.(?i:exe|com|cmd|bat)\b scope: variable.function.powershell + # Consume a string with a trailing dot + # to prevent members with particular names from being recognized as keywords. + - match: \b[\w-]+(?=\.) + push: members # Exceptions - - match: (?