From 0f5c4b6abcd825bc53a1667965c0390a46700e94 Mon Sep 17 00:00:00 2001 From: James Brundage <@github.com> Date: Sat, 11 Nov 2023 01:08:48 -0800 Subject: [PATCH] feat: Adding Language Command Type (Fixes #519) --- PipeScript.ps.psd1 | 67 +++++++++++++++++++++++++++------------------- 1 file changed, 40 insertions(+), 27 deletions(-) diff --git a/PipeScript.ps.psd1 b/PipeScript.ps.psd1 index c524c28bf..b89956712 100644 --- a/PipeScript.ps.psd1 +++ b/PipeScript.ps.psd1 @@ -86,6 +86,19 @@ ' CommandType = '(?>Function|Alias)' } + + 'Language' = @{ + Description = 'Language Commands describe languages' + Pattern = ' + Language # Language + (?> + \.ps1$ # ending with .ps1 + | # or + \p{P} # followed by punctuation + ) + ' + CommandType = '(?>Function)' + } 'Interface' = @{ Description = 'An Interface Command' @@ -154,35 +167,35 @@ ' } - 'Transform' = @{ - Description = 'Transforms' - Pattern = ' - (?> - # Transforms have two forms, one that is very "query" friendly + 'Transform' = @{ + Description = 'Transforms' + Pattern = ' + (?> + # Transforms have two forms, one that is very "query" friendly + \=\> # => + (?[^\p{Ps}\<]+)? # Optional transform name + [\p{Ps}\<] # Transform From Type Start + (?[^\p{Pe}\>]+) # TransformFrom + [^\p{Pe}\>] # Transform From Type End + (?: \=\> # => - (?[^\p{Ps}\<]+)? # Optional transform name - [\p{Ps}\<] # Transform From Type Start - (?[^\p{Pe}\>]+) # TransformFrom - [^\p{Pe}\>] # Transform From Type End - (?: - \=\> # => - (?[^\p{Ps}\<]+)? # Optional to name - [\p{Ps}\<] # Transform To Type Start - (?[^\p{Pe}\>]+) # Transform To - [^\p{Pe}\>] # Transform To Type End - )? - | - # The other form is fairly normal: - Transform(?>s|er)? # Transform or Transforms or Transformer - (?> - \.ps1$ # ending with .ps1 - | # or - \p{P} # followed by punctuation - ) + (?[^\p{Ps}\<]+)? # Optional to name + [\p{Ps}\<] # Transform To Type Start + (?[^\p{Pe}\>]+) # Transform To + [^\p{Pe}\>] # Transform To Type End + )? + | + # The other form is fairly normal: + Transform(?>s|er)? # Transform or Transforms or Transformer + (?> + \.ps1$ # ending with .ps1 + | # or + \p{P} # followed by punctuation ) - ' - ExcludeCommandType = '(?>Application|Script|Cmdlet)' - } + ) + ' + ExcludeCommandType = '(?>Application|Script|Cmdlet)' + } 'Template' = @{