File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ Language function Conf {
2
+ <#
3
+ . SYNOPSIS
4
+ Conf PipeScript Language Definition
5
+ . DESCRIPTION
6
+ Allows PipeScript to generate conf files
7
+ #>
8
+ [ValidatePattern (' \.conf$' )]
9
+ param ()
10
+
11
+ $FilePattern = ' \.conf'
12
+
13
+ # Conf supports single line comments only. They start with `;` or `#`
14
+ $SingleLineCommentStart = " [;#]"
15
+
16
+ # Any Language can be parsed with a series of regular expresssions.
17
+ # For languages that only support single comments:
18
+ # * The capture group IsSingleLine must be defined.
19
+ # * Whitespace should not be allowed (it makes nested blocks hard to end)
20
+ $startComment = " (?>(?<IsSingleLine>$SingleLineCommentStart )(?>PipeScript|PS)?\{)"
21
+ $endComment = " (?>$SingleLineCommentStart (?:PipeScript)?\})"
22
+
23
+ # To support templates, a language has to declare `$StartPattern` and `$EndPattern`:
24
+ $StartPattern = " (?<PSStart>${startComment} )"
25
+ $EndPattern = " (?<PSEnd>${endComment} )"
26
+
27
+ # Conf files are a data language
28
+ $DataLanguage = $true
29
+ # and are generally case sensitive.
30
+ $CaseSensitive = $true
31
+ }
You can’t perform that action at this time.
0 commit comments