Skip to content

Commit 0c6634f

Browse files
Merge pull request #182 from StartAutomating/PipeScriptReflectionAndMore
Pipe script reflection and more
2 parents 4c9575a + 54ab23a commit 0c6634f

25 files changed

+831
-177
lines changed

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
## 0.1.1:
2+
* New Keywords:
3+
* await (Fixes #181)
4+
* New-PipeScript:
5+
* Allowing -Parameter to be supplied via reflection (Fixes #171)
6+
* Adding -ParameterHelp (Fixes #172)
7+
* Adding -WeaklyTyped (Fixes #174)
8+
* Update-PipeScript:
9+
* Adding -RegexReplacement (Fixes #178)
10+
* Adding -RegionReplacement (Fixes #179)
11+
* Use-PipeScript:
12+
* Supporting Get-Command -Syntax (Fixes #177)
13+
* Types/Formatting Fixes:
14+
* CommandAST/AttributeAST: Adding .Args/.Arguments/.Parameters aliases (Fixes #176)
15+
* CommandAST: Fixing .GetParameter (Fixes #175)
16+
* Updating PSToken control (more colorization) (Fixes #166)
17+
* YAML Formatter indent / primitive support (Fixes #180)
18+
---
19+
120
## 0.1:
221
* PipeScript can now Transpile Protocols (Fixes #168)
322
* PipeScript can transpile http[s] protocol (Fixes #169)

Formatting/PSToken.control.ps1

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,34 @@ Write-FormatView -AsControl -Name "PSToken" -TypeName "n/a" -Action {
55
$token = $_
66
$prevEnd = $_.PreviousToken.Start + $_.PreviousToken.Length
77
$substring = $_.Text.Substring($prevEnd, $token.Start - $prevEnd)
8-
if ($substring) { $substring} else { ''}
8+
if ($substring) { $substring} else { '' }
99
}
1010

1111
Write-FormatViewExpression -If {
1212
$_.Type -eq 'Comment'
1313
} -ForegroundColor Success -Property Content
1414

1515
Write-FormatViewExpression -If {
16-
$_.Type -in 'Keyword', 'String'
16+
$_.Type -in 'Keyword', 'String', 'CommandArgument'
1717
} -ForegroundColor Verbose -Property Content
1818

1919
Write-FormatViewExpression -If {
2020
$_.Type -in 'Variable', 'Command'
21-
} -ForegroundColor Warning -ScriptBlock {
22-
$_.Content
23-
}
21+
} -ForegroundColor Warning -Property Content
22+
23+
Write-FormatViewExpression -If {
24+
$_.Type -in 'CommandParameter'
25+
} -ForegroundColor Magenta -Property Content
2426

2527
Write-FormatViewExpression -If {
2628
$_.Type -in 'Operator','GroupStart', 'GroupEnd'
27-
} -ForegroundColor Blue -Property Content
29+
} -ForegroundColor Magenta -Property Content
2830

2931
Write-FormatViewExpression -If {
30-
$_.Type -notin 'Comment', 'GroupStart', 'GroupEnd', 'Variable', 'Operator', 'Command','Keyword', 'String'
32+
$_.Type -notin 'Comment',
33+
'Keyword', 'String', 'CommandArgument',
34+
'Variable', 'Command',
35+
'CommandParameter',
36+
'Operator','GroupStart', 'GroupEnd'
3137
} -Property Content
3238
}

Formatting/YAML.format.ps1

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
11
Write-FormatView -Typename YAML -Action {
2-
Format-YAML -inputObject $_
2+
$inputObject = $_
3+
if ($inputObject.psobject.properties['Indent'].Value -as [int]) {
4+
$indentLevel = $inputObject.Indent -as [int]
5+
$inputCopy = [Ordered]@{}
6+
foreach ($prop in $inputObject.psobject.properties) {
7+
if ($prop.Name -eq 'indent') { continue }
8+
$inputCopy[$prop.Name] = $prop.Value
9+
}
10+
Format-YAML -inputObject $inputCopy -Indent $indentLevel
11+
} else {
12+
Format-YAML -inputObject $inputObject
13+
}
14+
315
}

0 commit comments

Comments
 (0)