-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Porting PHP Template to Language Function (Fixes #614)
- Loading branch information
James Brundage
committed
Nov 11, 2023
1 parent
d6042e6
commit 5e319ff
Showing
2 changed files
with
22 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Language function PHP { | ||
<# | ||
.SYNOPSIS | ||
PHP Template Transpiler. | ||
.DESCRIPTION | ||
Allows PipeScript to generate PHP. | ||
Multiline comments blocks like this ```<!--{}-->``` will be treated as blocks of PipeScript. | ||
JavaScript/CSS/PHP comment blocks like ```/*{}*/``` will also be treated as blocks of PipeScript. | ||
#> | ||
[ValidatePattern('\.php$')] | ||
param() | ||
# 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,})" | ||
} |
This file was deleted.
Oops, something went wrong.