-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathXAML-Language.ps.ps1
More file actions
25 lines (21 loc) · 821 Bytes
/
Copy pathXAML-Language.ps.ps1
File metadata and controls
25 lines (21 loc) · 821 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Language function XAML {
<#
.SYNOPSIS
XAML PipeScript Language Definition.
.DESCRIPTION
Allows PipeScript to generate XAML.
Multiline comments blocks like this ```<!--{}-->``` will be treated as blocks of PipeScript.
Executed output will be converted to XAML
#>
[ValidatePattern('\.xaml$')]
param()
$FilePattern = '\.xaml$'
# We start off by declaring a number of regular expressions:
$startComment = '<\!--' # * Start Comments ```<!--```
$endComment = '-->' # * End Comments ```-->```
$Whitespace = '[\s\n\r]{0,}'
# * StartPattern ```$StartComment + '{' + $Whitespace```
$startPattern = "(?<PSStart>${startComment}\{$Whitespace)"
# * EndPattern ```$whitespace + '}' + $EndComment```
$endPattern = "(?<PSEnd>$Whitespace\}${endComment}\s{0,})"
}