Skip to content

Commit

Permalink
feat: Porting Bicep Template to Language Function (Fixes #592)
Browse files Browse the repository at this point in the history
  • Loading branch information
James Brundage committed Nov 11, 2023
1 parent 6b428cf commit d561920
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 72 deletions.
30 changes: 30 additions & 0 deletions Commands/Languages/Bicep/Bicep-Language.ps.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Language function Bicep {
<#
.SYNOPSIS
Bicep Language Definition.
.DESCRIPTION
Allows PipeScript to generate Bicep templates.
Multiline comments blocks like ```/*{}*/``` will be treated as blocks of PipeScript.
Multiline comments can be preceeded or followed by 'empty' syntax, which will be ignored.
* ```''```
* ```{}```
#>
[ValidatePattern('\.bicep$')]
param(
)


# We start off by declaring a number of regular expressions:
$startComment = '/\*' # * Start Comments ```\*```
$endComment = '\*/' # * End Comments ```/*```
$Whitespace = '[\s\n\r]{0,}'
# * IgnoredContext
$IgnoredContext = "(?<ignore>(?>$("''", "\{\}" -join '|'))\s{0,}){0,1}"
# * StartRegex ```$IgnoredContext + $StartComment + '{' + $Whitespace```
$StartPattern = "(?<PSStart>${IgnoredContext}${startComment}\{$Whitespace)"
# * EndRegex ```$whitespace + '}' + $EndComment + $ignoredContext```
$EndPattern = "(?<PSEnd>$Whitespace\}${endComment}\s{0,}${IgnoredContext})"
}
72 changes: 0 additions & 72 deletions Transpilers/Templates/Bicep.Template.psx.ps1

This file was deleted.

0 comments on commit d561920

Please sign in to comment.