-
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.
HQRM: Add QA test for class-based localization (#133)
- Loading branch information
1 parent
3011179
commit d29c880
Showing
6 changed files
with
669 additions
and
27 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
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
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,42 @@ | ||
<# | ||
.SYNOPSIS | ||
Returns the class definition ASTs for a script file. | ||
.PARAMETER FullName | ||
Full path to the script file. | ||
#> | ||
function Get-ClassDefinitionAst | ||
{ | ||
param | ||
( | ||
[Parameter(Mandatory = $true)] | ||
[System.String] | ||
$FullName | ||
) | ||
|
||
$tokens, $parseErrors = $null | ||
|
||
$ast = [System.Management.Automation.Language.Parser]::ParseFile( | ||
$FullName, | ||
[ref] $tokens, | ||
[ref] $parseErrors | ||
) | ||
|
||
if ($parseErrors) | ||
{ | ||
throw $parseErrors | ||
} | ||
|
||
$astFilter = { | ||
param | ||
( | ||
[Parameter()] | ||
[System.Management.Automation.Language.Ast] | ||
$Ast | ||
) | ||
|
||
$Ast -is [System.Management.Automation.Language.TypeDefinitionAst] | ||
} | ||
|
||
return $ast.FindAll($astFilter, $true) | ||
} |
Oops, something went wrong.