Skip to content

Commit 4059685

Browse files
author
James Brundage
committed
Fixing merge conflict
1 parent d136ba6 commit 4059685

10 files changed

+37
-300
lines changed

Invoke-PipeScript.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,10 @@
497497
elseif ($script:TypeAcceleratorsList -notcontains $transpilerStepName -and $transpilerStepName -notin 'Ordered') {
498498
$psCmdlet.WriteError(
499499
[Management.Automation.ErrorRecord]::new(
500-
[exception]::new("Unable to find a transpiler for [$TranspilerStepName]")
500+
[exception]::new("Unable to find a transpiler for [$TranspilerStepName]"),
501+
'Transpiler.Not.Found',
502+
'ParserError',
503+
$command
501504
)
502505
)
503506

Transpilers/Core/PipeScript.ParameterAttribute.psx.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<#
2+
23
#>
34
[ValidateScript({
45
$_.Parent -is [Management.Automation.Language.ParameterAst]

Transpilers/Core/PipeScript.TypeExpression.psx.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ process {
5858
} else {
5959
$TypeExpressionAst.TypeName.Name
6060
}
61-
61+
6262
if ($transpilerStepName -eq 'ordered') { return }
6363

6464
$foundTranspiler =

Transpilers/Parameters/ValidateTypes.psx.ps1

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,33 @@ $TypeName,
5050
$VariableAST
5151
)
5252

53+
# Determine the list of real types at this point in time
54+
$realTypes =
55+
@(foreach ($tn in $typeName) {
56+
if ($tn -as [type]) {
57+
$tn -as [type]
58+
}
59+
})
60+
61+
# If all of the types are .NET types
62+
if ($realTypes.Length -eq $TypeName.Length) {
63+
$checkTypes = @"
64+
`$validTypeList = [$($realTypes -join '],[')]
65+
"@ + {
66+
67+
$thisType = $_.GetType()
68+
$IsTypeOk =
69+
$(@( foreach ($validType in $validTypeList) {
70+
if ($_ -as $validType) {
71+
$true;break
72+
}
73+
}))
74+
}
75+
76+
77+
} else {
5378

54-
$checkTypes = @"
79+
$checkTypes = @"
5580
`$validTypeList = '$($typeName -join "','")'
5681
"@ + {
5782
$thisType = @(
@@ -87,7 +112,7 @@ $IsTypeOk =
87112
}
88113
}) -eq $true) -as [bool]
89114
}
90-
115+
}
91116
if ($PSCmdlet.ParameterSetName -eq 'Parameter') {
92117
[scriptblock]::Create(@"
93118
[ValidateScript({

Transpilers/Syntax/RegexLiteral.psx.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
# This will become:
1616
1717
[regex]::new('[a|b]', 'IgnoreCase')
18+
.EXAMPLE
19+
Invoke-PipeScript {
20+
'/[a|b]/'.Matches('ab')
21+
}
1822
.EXAMPLE
1923
{
2024
"/[$a|$b]/"

docs/Decorate-Transpiler.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

docs/Explicit-Transpiler.md

Lines changed: 0 additions & 35 deletions
This file was deleted.

docs/Help-Transpiler.md

Lines changed: 0 additions & 84 deletions
This file was deleted.

docs/Include-Transpiler.md

Lines changed: 0 additions & 63 deletions
This file was deleted.

docs/ProxyCommand-Transpiler.md

Lines changed: 0 additions & 110 deletions
This file was deleted.

0 commit comments

Comments
 (0)