Skip to content

Commit 687b2a4

Browse files
author
James Brundage
committed
Merge branch 'PipeScriptImprovements' of https://github.com/StartAutomating/PipeScript into PipeScriptImprovements
2 parents c3672e7 + 93dee39 commit 687b2a4

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

Transpilers/Syntax/README.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ This directory and it's subdirectories contain syntax changes that enable common
6060
6161
# This will become:
6262
63-
[regex]::new("[$a|$b]", 'IgnoreCase'
63+
[regex]::new("[$a|$b]", 'IgnoreCase')
6464
~~~
6565

6666
## RegexLiteral Example 3
@@ -76,14 +76,23 @@ This directory and it's subdirectories contain syntax changes that enable common
7676
/
7777
'@
7878
} | .>PipeScript
79+
80+
# This will become:
81+
82+
[regex]::new(@'
83+
# Heredocs Regex literals will have IgnorePatternWhitespace by default, which allows comments
84+
^ # Match the string start
85+
(?<indent>\s{0,1})
86+
'@, 'IgnorePatternWhitespace,IgnoreCase')
7987
~~~
8088

8189
## RegexLiteral Example 4
8290

8391

8492
~~~PowerShell
93+
$Keywords = "looking", "for", "these", "words"
94+
8595
{
86-
$Keywords = "looking", "for", "these", "words"
8796
@"
8897
/
8998
# Double quoted heredocs can still contain variables
@@ -93,5 +102,15 @@ $($Keywords -join '|') # followed by keywords
93102
/
94103
"@
95104
} | .>PipeScript
105+
106+
107+
# This will become:
108+
109+
[regex]::new(@"
110+
# Double quoted heredocs can still contain variables
111+
[\s\p{P}]{0,1} # Whitespace or punctuation
112+
$($Keywords -join '|') # followed by keywords
113+
[\s\p{P}]{0,1} # followed by whitespace or punctuation
114+
"@, 'IgnorePatternWhitespace,IgnoreCase')
96115
~~~
97116

0 commit comments

Comments
 (0)