Skip to content

Commit e68d371

Browse files
author
James Brundage
committed
Updating Core Template Transpiler (Improving docs, re #285)
1 parent ef567e8 commit e68d371

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

Transpilers/Core/PipeScript.Template.psx.ps1

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
<#
22
.Synopsis
3-
Inline Transpiler
3+
Template Transpiler
44
.Description
5-
The PipeScript Core Inline Transpiler. This makes Source Generators with inline PipeScript work.
5+
The PipeScript Core Template Transpiler.
6+
7+
This allows PipeScript to generate many other languages.
68
79
Regardless of underlying source language, a source generator works in a fairly straightforward way.
810
911
Inline PipeScript will be embedded within the file (usually in comments).
1012
11-
If a Regular Expression can match each section, then the content in each section can be replaced.
12-
.EXAMPLE
13-
template html "<div class='/*{param($className)}*/'></div>" -ClassName MyClass -Content MyContent
13+
If a Regular Expression can match each section, then the content in each section can be replaced.
1414
#>
1515

1616
[ValidateScript({
@@ -378,7 +378,7 @@ process {
378378

379379
$templateToString = {
380380
param()
381-
381+
382382
if ($args) {
383383
$this.Evaluate($args)
384384
}
@@ -434,6 +434,9 @@ process {
434434
}
435435
}
436436
$null, $templateElements = foreach ($sentenceArg in $mySentence.ArgumentList) {
437+
if ($sentenceArg.StringConstantType -eq 'Bareword' -and $sentenceArg.Value -eq 'template') {
438+
continue
439+
}
437440
$convertedAst =
438441
if ($sentenceArg.ConvertFromAst) {
439442
$sentenceArg.ConvertFromAst()

0 commit comments

Comments
 (0)